@promptbook/utils
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
153 lines (152 loc) • 6.14 kB
TypeScript
import { z as schema } from 'zod';
/** Read-only host requests and scoped TEAM consultations; there is deliberately no shell operation. */
declare const PLANNING_READ_SCHEMA: schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"list">;
path: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"read">;
path: schema.ZodString;
startLine: schema.ZodNumber;
lineCount: schema.ZodNumber;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"search">;
path: schema.ZodString;
query: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"git">;
operation: schema.ZodEnum<{
status: "status";
diff: "diff";
log: "log";
}>;
}, schema.core.$strict>, schema.ZodObject<{
message: schema.ZodString;
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
kind: schema.ZodLiteral<"team">;
toolName: schema.ZodString;
}, schema.core.$strict>], "kind">;
/** Proposed changes are data, never instructions executed by a harness. */
declare const PLANNING_PROPOSAL_SCHEMA: schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"create">;
title: schema.ZodString;
body: schema.ZodString;
priority: schema.ZodNumber;
isReady: schema.ZodBoolean;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"edit">;
path: schema.ZodString;
find: schema.ZodString;
replace: schema.ZodString;
isReady: schema.ZodBoolean;
}, schema.core.$strict>], "kind">;
/** Strict validation prevents unsupported operations from reaching any filesystem code. */
declare const PLANNING_REPLY_SCHEMA: schema.ZodObject<{
message: schema.ZodString;
reads: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"list">;
path: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"read">;
path: schema.ZodString;
startLine: schema.ZodNumber;
lineCount: schema.ZodNumber;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"search">;
path: schema.ZodString;
query: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"git">;
operation: schema.ZodEnum<{
status: "status";
diff: "diff";
log: "log";
}>;
}, schema.core.$strict>, schema.ZodObject<{
message: schema.ZodString;
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
kind: schema.ZodLiteral<"team">;
toolName: schema.ZodString;
}, schema.core.$strict>], "kind">>;
proposals: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"create">;
title: schema.ZodString;
body: schema.ZodString;
priority: schema.ZodNumber;
isReady: schema.ZodBoolean;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"edit">;
path: schema.ZodString;
find: schema.ZodString;
replace: schema.ZodString;
isReady: schema.ZodBoolean;
}, schema.core.$strict>], "kind">>;
}, schema.core.$strict>;
/**
* The same response contract constrains Codex output and validates it at the host boundary.
* @private internal constant of `coder plan`
*/
export declare const PLANNING_RESPONSE_SCHEMA: schema.core.ZodStandardJSONSchemaPayload<schema.ZodObject<{
message: schema.ZodString;
reads: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"list">;
path: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"read">;
path: schema.ZodString;
startLine: schema.ZodNumber;
lineCount: schema.ZodNumber;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"search">;
path: schema.ZodString;
query: schema.ZodString;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"git">;
operation: schema.ZodEnum<{
status: "status";
diff: "diff";
log: "log";
}>;
}, schema.core.$strict>, schema.ZodObject<{
message: schema.ZodString;
context: schema.ZodNonOptional<schema.ZodOptional<schema.ZodString>>;
kind: schema.ZodLiteral<"team">;
toolName: schema.ZodString;
}, schema.core.$strict>], "kind">>;
proposals: schema.ZodArray<schema.ZodDiscriminatedUnion<[schema.ZodObject<{
kind: schema.ZodLiteral<"create">;
title: schema.ZodString;
body: schema.ZodString;
priority: schema.ZodNumber;
isReady: schema.ZodBoolean;
}, schema.core.$strict>, schema.ZodObject<{
kind: schema.ZodLiteral<"edit">;
path: schema.ZodString;
find: schema.ZodString;
replace: schema.ZodString;
isReady: schema.ZodBoolean;
}, schema.core.$strict>], "kind">>;
}, schema.core.$strict>>;
/** @private internal type of `coder plan` */
export type PlanningRead = Exclude<schema.infer<typeof PLANNING_READ_SCHEMA>, {
kind: 'team';
}>;
/** @private internal type of `coder plan` */
export type PlanningProposal = schema.infer<typeof PLANNING_PROPOSAL_SCHEMA>;
/** @private internal type of `coder plan` */
export type PlanningReply = schema.infer<typeof PLANNING_REPLY_SCHEMA>;
/** @private internal type of `coder plan` */
export type PlanningMessage = {
readonly role: 'user' | 'planner' | 'context';
readonly content: string;
};
/**
* Rejects malformed or unsupported harness output before processing reads or proposed writes.
* @private internal utility of `coder plan`
*/
export declare function parsePlanningReply(output: string): PlanningReply;
/**
* Describes the host-mediated planning protocol, independent of the selected Book's instructions.
* @private internal constant of `coder plan`
*/
export declare const PLANNING_PROTOCOL: string;
export {};