@a5c-ai/babysitter-sdk 0.0.183-staging.dd5dc0db → 0.0.183-staging.dfcd1fad
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/sessionCreate.d.ts.map +1 -1
- package/dist/cli/commands/sessionCreate.js +530 -36
- package/dist/cli/commands/sessionCreatePrompts.d.ts +37 -3
- package/dist/cli/commands/sessionCreatePrompts.d.ts.map +1 -1
- package/dist/cli/commands/sessionCreatePrompts.js +130 -6
- 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 +8 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +29 -1
- package/dist/harness/claudeCode.d.ts.map +1 -1
- package/dist/harness/claudeCode.js +112 -6
- package/dist/harness/codex.d.ts.map +1 -1
- package/dist/harness/codex.js +123 -22
- package/dist/harness/geminiCli.d.ts.map +1 -1
- package/dist/harness/geminiCli.js +30 -0
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.d.ts.map +1 -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/ohMyPi.d.ts.map +1 -1
- package/dist/harness/ohMyPi.js +16 -0
- package/dist/harness/pi.d.ts +5 -1
- package/dist/harness/pi.d.ts.map +1 -1
- package/dist/harness/pi.js +61 -0
- package/dist/harness/piSecureSandbox.d.ts.map +1 -1
- package/dist/harness/piSecureSandbox.js +33 -3
- package/dist/harness/piWrapper.d.ts.map +1 -1
- package/dist/harness/piWrapper.js +49 -4
- package/dist/harness/types.d.ts +20 -1
- package/dist/harness/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sessionCreate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EACV,sBAAsB,
|
|
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;AAsLD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,sBAAsB,EAAE,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,sBAAsB,GAAG,SAAS,CAYpC;AAiwDD,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,MAAM,CAAC,CAiFjB"}
|