@a5c-ai/babysitter-sdk 0.0.182 → 0.0.183-staging.2dca8387
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/harnessInstall.d.ts +8 -0
- package/dist/cli/commands/harnessInstall.d.ts.map +1 -0
- package/dist/cli/commands/harnessInstall.js +94 -0
- package/dist/cli/commands/hookRun.d.ts +1 -1
- package/dist/cli/commands/hookRun.d.ts.map +1 -1
- package/dist/cli/commands/hookRun.js +16 -0
- package/dist/cli/commands/processLibrary.d.ts +16 -0
- package/dist/cli/commands/processLibrary.d.ts.map +1 -0
- package/dist/cli/commands/processLibrary.js +152 -0
- package/dist/cli/commands/sessionCreate.d.ts +27 -0
- package/dist/cli/commands/sessionCreate.d.ts.map +1 -0
- package/dist/cli/commands/sessionCreate.js +1288 -0
- package/dist/cli/commands/sessionCreatePrompts.d.ts +39 -0
- package/dist/cli/commands/sessionCreatePrompts.d.ts.map +1 -0
- package/dist/cli/commands/sessionCreatePrompts.js +183 -0
- package/dist/cli/commands/skill.d.ts +3 -3
- package/dist/cli/commands/skill.d.ts.map +1 -1
- package/dist/cli/commands/skill.js +63 -12
- package/dist/cli/commands/templates/process-generation-prompt.md +101 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +260 -15
- package/dist/harness/claudeCode.d.ts.map +1 -1
- package/dist/harness/claudeCode.js +158 -21
- package/dist/harness/codex.d.ts +4 -3
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +310 -35
- package/dist/harness/customAdapter.d.ts +14 -0
- package/dist/harness/customAdapter.d.ts.map +1 -0
- package/dist/harness/customAdapter.js +108 -0
- package/dist/harness/discovery.d.ts +78 -0
- package/dist/harness/discovery.d.ts.map +1 -0
- package/dist/harness/discovery.js +301 -0
- package/dist/harness/geminiCli.d.ts.map +1 -1
- package/dist/harness/geminiCli.js +33 -0
- package/dist/harness/index.d.ts +7 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +19 -1
- package/dist/harness/installSupport.d.ts +34 -0
- package/dist/harness/installSupport.d.ts.map +1 -0
- package/dist/harness/installSupport.js +194 -0
- package/dist/harness/invoker.d.ts +47 -0
- package/dist/harness/invoker.d.ts.map +1 -0
- package/dist/harness/invoker.js +143 -0
- package/dist/harness/ohMyPi.d.ts +17 -0
- package/dist/harness/ohMyPi.d.ts.map +1 -0
- package/dist/harness/ohMyPi.js +46 -0
- package/dist/harness/pi.d.ts +5 -1
- package/dist/harness/pi.d.ts.map +1 -1
- package/dist/harness/pi.js +64 -0
- package/dist/harness/piSecureSandbox.d.ts +21 -0
- package/dist/harness/piSecureSandbox.d.ts.map +1 -0
- package/dist/harness/piSecureSandbox.js +373 -0
- package/dist/harness/piWrapper.d.ts +87 -0
- package/dist/harness/piWrapper.d.ts.map +1 -0
- package/dist/harness/piWrapper.js +479 -0
- package/dist/harness/registry.d.ts +1 -1
- package/dist/harness/registry.d.ts.map +1 -1
- package/dist/harness/registry.js +6 -3
- package/dist/harness/types.d.ts +168 -0
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/interaction/askUserQuestion.d.ts +25 -0
- package/dist/interaction/askUserQuestion.d.ts.map +1 -0
- package/dist/interaction/askUserQuestion.js +163 -0
- package/dist/interaction/index.d.ts +2 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +17 -0
- package/dist/processLibrary/active.d.ts +65 -0
- package/dist/processLibrary/active.d.ts.map +1 -0
- package/dist/processLibrary/active.js +205 -0
- package/dist/tasks/serializer.d.ts.map +1 -1
- package/dist/tasks/serializer.js +2 -0
- package/package.json +5 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HarnessInstallOptions } from "../../harness";
|
|
2
|
+
export interface HarnessInstallCommandArgs extends HarnessInstallOptions {
|
|
3
|
+
harnessName?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function handleHarnessInstall(args: HarnessInstallCommandArgs): Promise<number>;
|
|
6
|
+
export declare function handleHarnessInstallPlugin(args: HarnessInstallCommandArgs): Promise<number>;
|
|
7
|
+
export declare function formatHarnessInstallError(error: unknown, json: boolean): number;
|
|
8
|
+
//# sourceMappingURL=harnessInstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harnessInstall.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/harnessInstall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,eAAe,CAAC;AAQvB,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA0FD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAM3F;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAMjG;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAW/E"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleHarnessInstall = handleHarnessInstall;
|
|
4
|
+
exports.handleHarnessInstallPlugin = handleHarnessInstallPlugin;
|
|
5
|
+
exports.formatHarnessInstallError = formatHarnessInstallError;
|
|
6
|
+
const harness_1 = require("../../harness");
|
|
7
|
+
const exceptions_1 = require("../../runtime/exceptions");
|
|
8
|
+
function supportsColors() {
|
|
9
|
+
if (process.env.NO_COLOR !== undefined)
|
|
10
|
+
return false;
|
|
11
|
+
if (process.env.FORCE_COLOR !== undefined)
|
|
12
|
+
return true;
|
|
13
|
+
return Boolean(process.stderr?.isTTY);
|
|
14
|
+
}
|
|
15
|
+
function formatInstallResult(payload, json) {
|
|
16
|
+
if (json) {
|
|
17
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (payload.warning) {
|
|
21
|
+
console.log(`Warning: ${payload.warning}`);
|
|
22
|
+
}
|
|
23
|
+
if (payload.summary) {
|
|
24
|
+
console.log(payload.summary);
|
|
25
|
+
}
|
|
26
|
+
if (payload.command) {
|
|
27
|
+
console.log(`Command: ${payload.command}`);
|
|
28
|
+
}
|
|
29
|
+
if (payload.output) {
|
|
30
|
+
console.log(payload.output);
|
|
31
|
+
}
|
|
32
|
+
if (payload.location) {
|
|
33
|
+
console.log(`Location: ${payload.location}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function requireHarnessName(harnessName, commandName) {
|
|
37
|
+
if (!harnessName) {
|
|
38
|
+
throw new exceptions_1.BabysitterRuntimeError("MissingArgument", `${commandName} requires a harness name as the first argument`, {
|
|
39
|
+
category: exceptions_1.ErrorCategory.Validation,
|
|
40
|
+
suggestions: [`babysitter ${commandName} codex`],
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return harnessName;
|
|
44
|
+
}
|
|
45
|
+
function requireInstallMethod(harnessName, commandName, kind) {
|
|
46
|
+
const adapter = (0, harness_1.getAdapterByName)(harnessName);
|
|
47
|
+
if (!adapter) {
|
|
48
|
+
throw new exceptions_1.BabysitterRuntimeError("UnsupportedHarnessInstall", `${commandName} does not support "${harnessName}" yet.`, {
|
|
49
|
+
category: exceptions_1.ErrorCategory.Validation,
|
|
50
|
+
suggestions: [
|
|
51
|
+
"Supported harnesses: claude-code, codex, gemini-cli, pi, oh-my-pi",
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const run = adapter[kind];
|
|
56
|
+
if (!run) {
|
|
57
|
+
throw new exceptions_1.BabysitterRuntimeError("UnsupportedHarnessInstall", `${commandName} does not support "${harnessName}" yet.`, {
|
|
58
|
+
category: exceptions_1.ErrorCategory.Validation,
|
|
59
|
+
suggestions: [
|
|
60
|
+
"Supported harnesses: claude-code, codex, gemini-cli, pi, oh-my-pi",
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
adapter,
|
|
66
|
+
run: run.bind(adapter),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function handleHarnessInstall(args) {
|
|
70
|
+
const harnessName = requireHarnessName(args.harnessName, "harness:install");
|
|
71
|
+
const { run } = requireInstallMethod(harnessName, "harness:install", "installHarness");
|
|
72
|
+
const result = await run(args);
|
|
73
|
+
formatInstallResult(result, args.json);
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
async function handleHarnessInstallPlugin(args) {
|
|
77
|
+
const harnessName = requireHarnessName(args.harnessName, "harness:install-plugin");
|
|
78
|
+
const { run } = requireInstallMethod(harnessName, "harness:install-plugin", "installPlugin");
|
|
79
|
+
const result = await run(args);
|
|
80
|
+
formatInstallResult(result, args.json);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
function formatHarnessInstallError(error, json) {
|
|
84
|
+
const err = error instanceof Error
|
|
85
|
+
? error
|
|
86
|
+
: new Error(String(error));
|
|
87
|
+
if (json) {
|
|
88
|
+
console.error(JSON.stringify((0, exceptions_1.toStructuredError)(err), null, 2));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.error((0, exceptions_1.formatErrorWithContext)(err, { colors: supportsColors() }));
|
|
92
|
+
}
|
|
93
|
+
return 1;
|
|
94
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export interface HookRunCommandArgs {
|
|
14
14
|
hookType: string;
|
|
15
|
-
/** Which host tool is invoking the hook.
|
|
15
|
+
/** Which host tool is invoking the hook. Auto-detected from caller env, falls back to "claude-code". */
|
|
16
16
|
harness: string;
|
|
17
17
|
pluginRoot?: string;
|
|
18
18
|
stateDir?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hookRun.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/hookRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"hookRun.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/hookRun.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAUH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgID,wBAAsB,aAAa,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA2E7E"}
|
|
@@ -167,6 +167,22 @@ async function handleHookRun(args) {
|
|
|
167
167
|
}
|
|
168
168
|
return 1;
|
|
169
169
|
}
|
|
170
|
+
if (adapter.supportsHookType && !adapter.supportsHookType(hookType)) {
|
|
171
|
+
const message = adapter.getUnsupportedHookMessage
|
|
172
|
+
? adapter.getUnsupportedHookMessage(hookType)
|
|
173
|
+
: `Harness "${harness}" does not support hook type "${hookType}".`;
|
|
174
|
+
const error = {
|
|
175
|
+
error: "UNSUPPORTED_HOOK_TYPE",
|
|
176
|
+
message,
|
|
177
|
+
};
|
|
178
|
+
if (json) {
|
|
179
|
+
process.stderr.write(JSON.stringify(error, null, 2) + "\n");
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
process.stderr.write(`Error: ${message}\n`);
|
|
183
|
+
}
|
|
184
|
+
return 1;
|
|
185
|
+
}
|
|
170
186
|
switch (hookType) {
|
|
171
187
|
case "stop":
|
|
172
188
|
return await adapter.handleStopHook(args);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ProcessLibraryCommandArgs {
|
|
2
|
+
subcommand: "clone" | "update" | "use" | "active";
|
|
3
|
+
repo?: string;
|
|
4
|
+
dir?: string;
|
|
5
|
+
ref?: string;
|
|
6
|
+
runId?: string;
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
stateDir?: string;
|
|
9
|
+
json: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function handleProcessLibraryClone(args: ProcessLibraryCommandArgs): Promise<number>;
|
|
12
|
+
export declare function handleProcessLibraryUpdate(args: ProcessLibraryCommandArgs): Promise<number>;
|
|
13
|
+
export declare function handleProcessLibraryUse(args: ProcessLibraryCommandArgs): Promise<number>;
|
|
14
|
+
export declare function handleProcessLibraryActive(args: ProcessLibraryCommandArgs): Promise<number>;
|
|
15
|
+
export declare function handleProcessLibraryCommand(args: ProcessLibraryCommandArgs): Promise<number>;
|
|
16
|
+
//# sourceMappingURL=processLibrary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processLibrary.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/processLibrary.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACf;AAoBD,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CA6BjB;AAED,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleProcessLibraryClone = handleProcessLibraryClone;
|
|
4
|
+
exports.handleProcessLibraryUpdate = handleProcessLibraryUpdate;
|
|
5
|
+
exports.handleProcessLibraryUse = handleProcessLibraryUse;
|
|
6
|
+
exports.handleProcessLibraryActive = handleProcessLibraryActive;
|
|
7
|
+
exports.handleProcessLibraryCommand = handleProcessLibraryCommand;
|
|
8
|
+
const active_1 = require("../../processLibrary/active");
|
|
9
|
+
function requireArg(value, name, command, json) {
|
|
10
|
+
if (!value) {
|
|
11
|
+
const message = `[${command}] ${name} is required`;
|
|
12
|
+
if (json) {
|
|
13
|
+
console.log(JSON.stringify({ error: "missing_argument", message }));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.error(message);
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
async function handleProcessLibraryClone(args) {
|
|
23
|
+
const repo = requireArg(args.repo, "--repo", "process-library:clone", args.json);
|
|
24
|
+
if (!repo)
|
|
25
|
+
return 1;
|
|
26
|
+
const dir = requireArg(args.dir, "--dir", "process-library:clone", args.json);
|
|
27
|
+
if (!dir)
|
|
28
|
+
return 1;
|
|
29
|
+
try {
|
|
30
|
+
const result = await (0, active_1.cloneProcessLibrary)({ repo, dir, ref: args.ref });
|
|
31
|
+
if (args.json) {
|
|
32
|
+
console.log(JSON.stringify({ success: true, ...result }, null, 2));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
console.log(`Process library cloned.\n Repo: ${result.repo}\n Dir: ${result.dir}\n Revision: ${result.revision}`);
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
41
|
+
if (args.json) {
|
|
42
|
+
console.log(JSON.stringify({ error: "clone_failed", message }));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.error(`[process-library:clone] ${message}`);
|
|
46
|
+
}
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function handleProcessLibraryUpdate(args) {
|
|
51
|
+
const dir = requireArg(args.dir, "--dir", "process-library:update", args.json);
|
|
52
|
+
if (!dir)
|
|
53
|
+
return 1;
|
|
54
|
+
try {
|
|
55
|
+
const result = await (0, active_1.updateProcessLibrary)({ dir, ref: args.ref });
|
|
56
|
+
if (args.json) {
|
|
57
|
+
console.log(JSON.stringify({ success: true, ...result }, null, 2));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
console.log(`Process library updated.\n Dir: ${result.dir}\n Revision: ${result.revision}`);
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
66
|
+
if (args.json) {
|
|
67
|
+
console.log(JSON.stringify({ error: "update_failed", message }));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
console.error(`[process-library:update] ${message}`);
|
|
71
|
+
}
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function handleProcessLibraryUse(args) {
|
|
76
|
+
const dir = requireArg(args.dir, "--dir", "process-library:use", args.json);
|
|
77
|
+
if (!dir)
|
|
78
|
+
return 1;
|
|
79
|
+
try {
|
|
80
|
+
const result = await (0, active_1.bindActiveProcessLibrary)({
|
|
81
|
+
dir,
|
|
82
|
+
stateDir: args.stateDir,
|
|
83
|
+
runId: args.runId,
|
|
84
|
+
sessionId: args.sessionId,
|
|
85
|
+
ref: args.ref,
|
|
86
|
+
});
|
|
87
|
+
if (args.json) {
|
|
88
|
+
console.log(JSON.stringify({ success: true, ...result }, null, 2));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
console.log(`Active process library updated.\n Scope: ${result.bindingScope}\n Dir: ${result.binding.dir}\n State: ${result.stateFile}`);
|
|
92
|
+
}
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
97
|
+
if (args.json) {
|
|
98
|
+
console.log(JSON.stringify({ error: "bind_failed", message }));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
console.error(`[process-library:use] ${message}`);
|
|
102
|
+
}
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function handleProcessLibraryActive(args) {
|
|
107
|
+
try {
|
|
108
|
+
const result = await (0, active_1.resolveActiveProcessLibrary)({
|
|
109
|
+
stateDir: args.stateDir,
|
|
110
|
+
runId: args.runId,
|
|
111
|
+
sessionId: args.sessionId,
|
|
112
|
+
});
|
|
113
|
+
if (args.json) {
|
|
114
|
+
console.log(JSON.stringify(result, null, 2));
|
|
115
|
+
}
|
|
116
|
+
else if (!result.binding) {
|
|
117
|
+
console.log(`No active process-library binding found.\n State: ${result.stateFile}`);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
console.log(`Active process library.\n Scope: ${result.bindingScope}\n Dir: ${result.binding.dir}\n Revision: ${result.binding.revision ?? "unknown"}`);
|
|
121
|
+
}
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
126
|
+
if (args.json) {
|
|
127
|
+
console.log(JSON.stringify({ error: "active_failed", message }));
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
console.error(`[process-library:active] ${message}`);
|
|
131
|
+
}
|
|
132
|
+
return 1;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function handleProcessLibraryCommand(args) {
|
|
136
|
+
switch (args.subcommand) {
|
|
137
|
+
case "clone":
|
|
138
|
+
return handleProcessLibraryClone(args);
|
|
139
|
+
case "update":
|
|
140
|
+
return handleProcessLibraryUpdate(args);
|
|
141
|
+
case "use":
|
|
142
|
+
return handleProcessLibraryUse(args);
|
|
143
|
+
case "active":
|
|
144
|
+
return handleProcessLibraryActive(args);
|
|
145
|
+
default: {
|
|
146
|
+
const _exhaustive = args.subcommand;
|
|
147
|
+
void _exhaustive;
|
|
148
|
+
console.error("[process-library] Unknown subcommand");
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* session:create command handler.
|
|
3
|
+
*
|
|
4
|
+
* Drives a full babysitter session lifecycle through two agentic phases:
|
|
5
|
+
* Phase 1 - Unbound interview / intent / process-definition
|
|
6
|
+
* Phase 2 - Bound orchestration loop with hook-style continuation semantics
|
|
7
|
+
*
|
|
8
|
+
* Both phases are driven through a Pi agent session and LLM-callable tools.
|
|
9
|
+
* Interactive user input is exposed through an AskUserQuestion tool instead of
|
|
10
|
+
* direct imperative prompts inside the host loop.
|
|
11
|
+
*/
|
|
12
|
+
import type { HarnessDiscoveryResult } from "../../harness/types";
|
|
13
|
+
export interface SessionCreateArgs {
|
|
14
|
+
prompt?: string;
|
|
15
|
+
harness?: string;
|
|
16
|
+
processPath?: string;
|
|
17
|
+
workspace?: string;
|
|
18
|
+
model?: string;
|
|
19
|
+
maxIterations?: number;
|
|
20
|
+
runsDir: string;
|
|
21
|
+
json: boolean;
|
|
22
|
+
verbose: boolean;
|
|
23
|
+
interactive?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function selectHarness(discovered: HarnessDiscoveryResult[], preferred?: string): HarnessDiscoveryResult | undefined;
|
|
26
|
+
export declare function handleSessionCreate(parsed: SessionCreateArgs): Promise<number>;
|
|
27
|
+
//# sourceMappingURL=sessionCreate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sessionCreate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EACV,sBAAsB,EAIvB,MAAM,qBAAqB,CAAC;AA0B7B,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA+ID,wBAAgB,aAAa,CAC3B,UAAU,EAAE,sBAAsB,EAAE,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,sBAAsB,GAAG,SAAS,CAYpC;AA69CD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,MAAM,CAAC,CAiFjB"}
|