noskills 4.5.2 → 5.0.0
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/README.md +497 -18
- package/noskills.js +145 -1
- package/package.json +14 -1
- package/{chunks/ajan-bridge-BNPC757J.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
- package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
- package/ts/chunks/approve-R7MCYHCS.js +1 -0
- package/ts/chunks/ask-GBLFPNFX.js +2 -0
- package/ts/chunks/block-YEKLMXHR.js +1 -0
- package/ts/chunks/cancel-7NS4WM2N.js +1 -0
- package/ts/chunks/chunk-2CLD527I.js +1 -0
- package/ts/chunks/chunk-34AWV7DB.js +1 -0
- package/ts/chunks/chunk-3M26Y3NG.js +27 -0
- package/{chunks/chunk-J25XTDQQ.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
- package/ts/chunks/chunk-5ALJRBMW.js +22 -0
- package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
- package/ts/chunks/chunk-6BKTY7SA.js +4 -0
- package/ts/chunks/chunk-6M7PCVUR.js +1 -0
- package/ts/chunks/chunk-6O2RXYTM.js +3 -0
- package/ts/chunks/chunk-7DIQYKPL.js +3 -0
- package/ts/chunks/chunk-7J6R2D2K.js +2 -0
- package/ts/chunks/chunk-AW3XJGEP.js +1 -0
- package/ts/chunks/chunk-BRC46A3N.js +39 -0
- package/ts/chunks/chunk-C5LYQDQH.js +368 -0
- package/ts/chunks/chunk-CCYWFSXR.js +3 -0
- package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
- package/ts/chunks/chunk-CSP2GUD4.js +29 -0
- package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
- package/ts/chunks/chunk-DGYDUGTM.js +1 -0
- package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
- package/ts/chunks/chunk-FLLYK5FU.js +1 -0
- package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
- package/{chunks/chunk-FYFUEK4U.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
- package/ts/chunks/chunk-HNQA5O2S.js +2 -0
- package/ts/chunks/chunk-HUP7XWW6.js +1 -0
- package/ts/chunks/chunk-J3XNDEMU.js +4 -0
- package/ts/chunks/chunk-K6FVY52W.js +5 -0
- package/ts/chunks/chunk-KQJGXVWX.js +91 -0
- package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
- package/ts/chunks/chunk-M6CAJL36.js +1 -0
- package/ts/chunks/chunk-MPHTBN7E.js +1 -0
- package/ts/chunks/chunk-NYIFCLEG.js +1 -0
- package/ts/chunks/chunk-RRDWQKZY.js +1 -0
- package/ts/chunks/chunk-RVNSKPFL.js +1 -0
- package/ts/chunks/chunk-S5F2DAAG.js +5 -0
- package/ts/chunks/chunk-SCYP2G2T.js +3 -0
- package/ts/chunks/chunk-SWP6BJR6.js +147 -0
- package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
- package/ts/chunks/chunk-T2X4E35X.js +1 -0
- package/ts/chunks/chunk-TDLTCTV4.js +1 -0
- package/ts/chunks/chunk-TKBGNLNV.js +1 -0
- package/ts/chunks/chunk-UY4YFVSW.js +3 -0
- package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
- package/ts/chunks/chunk-W46BJM2F.js +1 -0
- package/ts/chunks/chunk-W7KQFMHV.js +1 -0
- package/ts/chunks/chunk-XGRZPTAD.js +24 -0
- package/ts/chunks/chunk-XTQFSF6C.js +1 -0
- package/ts/chunks/chunk-YN3SHWBR.js +1 -0
- package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
- package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
- package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
- package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
- package/ts/chunks/concern-EDWQHU4H.js +1 -0
- package/ts/chunks/config-E7BDBHPK.js +1 -0
- package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
- package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
- package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
- package/ts/chunks/diagrams-H62JGTIS.js +1 -0
- package/ts/chunks/done-U3TOSZIX.js +1 -0
- package/ts/chunks/followup-J2HJU3ZT.js +1 -0
- package/ts/chunks/free-73WMLMCT.js +1 -0
- package/ts/chunks/gemini-GA6P4M7D.js +1 -0
- package/ts/chunks/init-6CVDGRY2.js +1 -0
- package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
- package/ts/chunks/kiro-BJSKSAUC.js +1 -0
- package/ts/chunks/learn-7Q2VWZMI.js +7 -0
- package/ts/chunks/ledger-XR4AHZRX.js +2 -0
- package/ts/chunks/list-CUQCPXZH.js +1 -0
- package/ts/chunks/manager-WTLJ5C2I.js +3 -0
- package/ts/chunks/mod-BZA5TFW7.js +1 -0
- package/ts/chunks/mod-RWA5ZPYH.js +1 -0
- package/ts/chunks/mod-X372UNSQ.js +1 -0
- package/ts/chunks/mod-XVE4ZWPY.js +1 -0
- package/ts/chunks/next-CEYZSYGB.js +20 -0
- package/ts/chunks/node-33JV5VS3.js +15 -0
- package/ts/chunks/node-XYP2DQHR.js +74 -0
- package/{chunks/node-2XIHQ2M4.js → ts/chunks/node-ZSGIX7K3.js} +1 -1
- package/ts/chunks/ollama-X6OGN5BW.js +1 -0
- package/ts/chunks/openai-TV7KLQ2C.js +1 -0
- package/ts/chunks/openai-YPM2E7QS.js +30 -0
- package/ts/chunks/opencode-AK6WWZRF.js +1 -0
- package/ts/chunks/pack-EOUSZGJT.js +5 -0
- package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
- package/ts/chunks/purge-GPMC5A6Y.js +5 -0
- package/ts/chunks/reopen-LPVNZN5I.js +1 -0
- package/ts/chunks/reset-RNLPXGWQ.js +1 -0
- package/ts/chunks/review-ZGAY5XCN.js +1 -0
- package/ts/chunks/rule-SNBQ4VZD.js +6 -0
- package/ts/chunks/run-4TDP4C7Z.js +3 -0
- package/ts/chunks/sdk-MEVPL5WT.js +1 -0
- package/ts/chunks/session-J7TSLNEH.js +1 -0
- package/ts/chunks/spec-3NSPFDIC.js +1 -0
- package/ts/chunks/status-DIEA2OGR.js +1 -0
- package/ts/chunks/sync-HZNKILSP.js +1 -0
- package/ts/chunks/validate-MWHDOF2F.js +1 -0
- package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
- package/ts/chunks/watch-P6HABMAS.js +7 -0
- package/ts/chunks/web-BMIC3VJQ.js +1 -0
- package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
- package/ts/noskills.js +2 -0
- package/chunks/anthropic-ZKOMTKX2.js +0 -1
- package/chunks/approve-3TKOHYHH.js +0 -1
- package/chunks/ask-UB26SBWQ.js +0 -2
- package/chunks/block-Q4WAIX7X.js +0 -1
- package/chunks/browser-BGFD24RX.js +0 -1
- package/chunks/bun-WZ7BVR7Y.js +0 -1
- package/chunks/cancel-DY76ADX4.js +0 -1
- package/chunks/chunk-34RPTI4K.js +0 -29
- package/chunks/chunk-3JTDWOAJ.js +0 -2
- package/chunks/chunk-5FX4EBFY.js +0 -5
- package/chunks/chunk-5RLCKUIF.js +0 -2
- package/chunks/chunk-7PBHRFOZ.js +0 -3
- package/chunks/chunk-7PPUGTKL.js +0 -4
- package/chunks/chunk-AB3N327V.js +0 -1
- package/chunks/chunk-AUZWXMWA.js +0 -27
- package/chunks/chunk-BYPCI5VU.js +0 -1
- package/chunks/chunk-CH6A3LES.js +0 -91
- package/chunks/chunk-CKIZYL4O.js +0 -3
- package/chunks/chunk-CTTMQSHF.js +0 -1
- package/chunks/chunk-DEHRWREM.js +0 -1
- package/chunks/chunk-DYCGJ4RY.js +0 -4
- package/chunks/chunk-ENP4P2YH.js +0 -0
- package/chunks/chunk-EVJYA7S3.js +0 -21
- package/chunks/chunk-FE4MKOI4.js +0 -1
- package/chunks/chunk-GNMOE7H3.js +0 -48
- package/chunks/chunk-HB62UGZI.js +0 -2
- package/chunks/chunk-IFE5SYGK.js +0 -1
- package/chunks/chunk-IM73MYMS.js +0 -1
- package/chunks/chunk-JYVB6UAV.js +0 -1
- package/chunks/chunk-KJLEPI7T.js +0 -1
- package/chunks/chunk-KRRPOVQG.js +0 -1
- package/chunks/chunk-LGQEWL5X.js +0 -1
- package/chunks/chunk-LJEWPIEI.js +0 -1
- package/chunks/chunk-LKZZ4JN5.js +0 -110
- package/chunks/chunk-NGCBWJML.js +0 -2
- package/chunks/chunk-NPWXEWRN.js +0 -4
- package/chunks/chunk-O4KKKYCH.js +0 -1
- package/chunks/chunk-ONJVI5AZ.js +0 -23
- package/chunks/chunk-OP4XAIGW.js +0 -1
- package/chunks/chunk-PSX63TYP.js +0 -2
- package/chunks/chunk-Q4TI7EYT.js +0 -5
- package/chunks/chunk-SLO22P65.js +0 -1
- package/chunks/chunk-T6NZVA6P.js +0 -7
- package/chunks/chunk-TCSIXKUD.js +0 -3
- package/chunks/chunk-VJRCTYGL.js +0 -1
- package/chunks/chunk-VXU6XZ66.js +0 -39
- package/chunks/chunk-WDKWHGJU.js +0 -146
- package/chunks/chunk-XDPATEP5.js +0 -1
- package/chunks/chunk-Y45DQJSS.js +0 -3
- package/chunks/chunk-Y5E7ZCCX.js +0 -1
- package/chunks/chunk-YUTDPPXX.js +0 -1
- package/chunks/chunk-Z7OYXH3J.js +0 -1
- package/chunks/claude-code-OQJIUKZP.js +0 -1
- package/chunks/cmd-46ZIHXLB.js +0 -1
- package/chunks/concern-UIGVWDFS.js +0 -1
- package/chunks/config-72Z4PIJN.js +0 -1
- package/chunks/decision-ledger-5IPPTRT7.js +0 -1
- package/chunks/delegate-OV6NY434.js +0 -1
- package/chunks/deno-YM5PW6ZM.js +0 -1
- package/chunks/diagrams-CBCUA47B.js +0 -1
- package/chunks/diagrams-OX4FBDGP.js +0 -1
- package/chunks/done-V54GSSTY.js +0 -1
- package/chunks/followup-NL7EPIGF.js +0 -1
- package/chunks/free-KD344KRL.js +0 -1
- package/chunks/gemini-23EOEXSF.js +0 -1
- package/chunks/init-WDRNFT57.js +0 -1
- package/chunks/invoke-hook-I3NTD36Q.js +0 -13
- package/chunks/kiro-TPAAIMY6.js +0 -1
- package/chunks/learn-WBWNJEB2.js +0 -7
- package/chunks/ledger-QYK252DV.js +0 -1
- package/chunks/list-WO6RS7JX.js +0 -1
- package/chunks/loader-command-3A5FK2RF.js +0 -1
- package/chunks/loader-reactor-YZM7HO4G.js +0 -1
- package/chunks/manager-ZSPRC5R4.js +0 -3
- package/chunks/mod-7VTKN6Q5.js +0 -1
- package/chunks/mod-B6LBGYON.js +0 -1
- package/chunks/mod-MMHDQRNF.js +0 -1
- package/chunks/mod-RBGAMGZA.js +0 -1
- package/chunks/mod-SFSUQWSB.js +0 -8
- package/chunks/mod-SV4VELMH.js +0 -1
- package/chunks/next-QXCLZ7P3.js +0 -15
- package/chunks/node-BXYZKSJY.js +0 -15
- package/chunks/node-DMUOWFGA.js +0 -69
- package/chunks/node-J4GTOSL2.js +0 -1
- package/chunks/ollama-MXRDGQDF.js +0 -1
- package/chunks/openai-LE47IWMQ.js +0 -30
- package/chunks/openai-MSJF4B6H.js +0 -1
- package/chunks/opencode-ZDHKR2P6.js +0 -1
- package/chunks/pack-NS64WU6M.js +0 -5
- package/chunks/plan-export-HECAF7D4.js +0 -3
- package/chunks/purge-PSQNN42H.js +0 -4
- package/chunks/reopen-L37M5XUI.js +0 -1
- package/chunks/reset-OOTZXW6Q.js +0 -1
- package/chunks/review-QLD6WSOB.js +0 -1
- package/chunks/rule-OOANQBHB.js +0 -6
- package/chunks/run-YHCIRY7Z.js +0 -3
- package/chunks/sdk-OQIHH3OY.js +0 -1
- package/chunks/session-OWWDH7KA.js +0 -1
- package/chunks/spec-O7F525UN.js +0 -1
- package/chunks/status-SZZXY7V3.js +0 -1
- package/chunks/sync-3RYRGTEA.js +0 -1
- package/chunks/unstable_chmod-44MCKF3B.js +0 -1
- package/chunks/validate-UZD6JBSG.js +0 -1
- package/chunks/vertexai-CVCRCO24.js +0 -1
- package/chunks/watch-5DNM646U.js +0 -8
- package/chunks/web-662LNB3K.js +0 -1
- package/chunks/wontfix-UDCTLHNB.js +0 -1
- package/chunks/workerd-I7MLRCLJ.js +0 -1
- /package/{chunks/chunk-5OTECUN7.js → ts/chunks/chunk-ATNTR7M5.js} +0 -0
- /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
- /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
- /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
- /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
- /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
package/noskills.js
CHANGED
|
@@ -1,2 +1,146 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// pkg/@eserstack/noskills/scripts/npm-launcher.ts
|
|
4
|
+
import * as childProcess from "node:child_process";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
import * as nodeModule from "node:module";
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import * as url from "node:url";
|
|
9
|
+
var process = globalThis.process;
|
|
10
|
+
var PLATFORM_PACKAGES = {
|
|
11
|
+
"darwin-arm64": "@eserstack/noskills-darwin-arm64",
|
|
12
|
+
"darwin-x64": "@eserstack/noskills-darwin-x64",
|
|
13
|
+
"linux-arm64": "@eserstack/noskills-linux-arm64",
|
|
14
|
+
"linux-x64": "@eserstack/noskills-linux-x64",
|
|
15
|
+
"win32-x64": "@eserstack/noskills-win32-x64"
|
|
16
|
+
};
|
|
17
|
+
var TS_BUNDLE_ENV = "NOSKILLS_TS_BUNDLE";
|
|
18
|
+
var findBinary = (platform, arch, resolvePackageJson, exists) => {
|
|
19
|
+
const key = `${platform}-${arch}`;
|
|
20
|
+
const name = PLATFORM_PACKAGES[key];
|
|
21
|
+
if (name === void 0) {
|
|
22
|
+
return {
|
|
23
|
+
kind: "missing",
|
|
24
|
+
message: `noskills: no prebuilt binary for ${key}. The npm package ships one for ${Object.keys(
|
|
25
|
+
PLATFORM_PACKAGES
|
|
26
|
+
).join(
|
|
27
|
+
", "
|
|
28
|
+
)}; on another platform, build cmd/noskills from https://github.com/eser/stack with Go.`
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
let manifest;
|
|
32
|
+
try {
|
|
33
|
+
manifest = resolvePackageJson(name);
|
|
34
|
+
} catch {
|
|
35
|
+
return {
|
|
36
|
+
kind: "missing",
|
|
37
|
+
message: `noskills: the platform package ${name} is not installed. npm installs it as an optional dependency of noskills; reinstall noskills without --omit=optional or --no-optional.`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const binary = path.join(
|
|
41
|
+
path.dirname(manifest),
|
|
42
|
+
platform === "win32" ? "noskills.exe" : "noskills"
|
|
43
|
+
);
|
|
44
|
+
if (!exists(binary)) {
|
|
45
|
+
return {
|
|
46
|
+
kind: "missing",
|
|
47
|
+
message: `noskills: ${name} has no binary at ${binary}; reinstall noskills.`
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { kind: "found", path: binary };
|
|
51
|
+
};
|
|
52
|
+
var EXECUTE_BITS = 73;
|
|
53
|
+
var ensureExecutable = (binary, platform, access) => {
|
|
54
|
+
if (platform === "win32" || access.isExecutable(binary)) {
|
|
55
|
+
return { kind: "ready" };
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
access.chmod(binary, access.mode(binary) | EXECUTE_BITS);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
61
|
+
return {
|
|
62
|
+
kind: "failed",
|
|
63
|
+
message: `noskills: ${binary} is not executable and the launcher cannot change its mode (${reason}). Run \`chmod +x ${binary}\` as the owner of the install (with sudo for a global one), or reinstall noskills.`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return { kind: "ready" };
|
|
67
|
+
};
|
|
68
|
+
var exitCodeOf = (code, signal) => {
|
|
69
|
+
if (code !== null) {
|
|
70
|
+
return code;
|
|
71
|
+
}
|
|
72
|
+
const number = signal === null ? void 0 : nodeSignalNumber(signal);
|
|
73
|
+
return number === void 0 ? 1 : 128 + number;
|
|
74
|
+
};
|
|
75
|
+
var nodeSignalNumber = (signal) => {
|
|
76
|
+
const numbers = {
|
|
77
|
+
SIGHUP: 1,
|
|
78
|
+
SIGINT: 2,
|
|
79
|
+
SIGQUIT: 3,
|
|
80
|
+
SIGKILL: 9,
|
|
81
|
+
SIGTERM: 15
|
|
82
|
+
};
|
|
83
|
+
return numbers[signal];
|
|
84
|
+
};
|
|
85
|
+
var main = () => {
|
|
86
|
+
const require2 = nodeModule.createRequire(import.meta.url);
|
|
87
|
+
const lookup = findBinary(
|
|
88
|
+
process.platform,
|
|
89
|
+
process.arch,
|
|
90
|
+
(name) => require2.resolve(`${name}/package.json`),
|
|
91
|
+
(file) => fs.existsSync(file)
|
|
92
|
+
);
|
|
93
|
+
if (lookup.kind === "missing") {
|
|
94
|
+
process.stderr.write(`${lookup.message}
|
|
95
|
+
`);
|
|
96
|
+
process.exitCode = 1;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const preparation = ensureExecutable(lookup.path, process.platform, {
|
|
100
|
+
isExecutable: (file) => {
|
|
101
|
+
try {
|
|
102
|
+
fs.accessSync(file, fs.constants.X_OK);
|
|
103
|
+
return true;
|
|
104
|
+
} catch {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
mode: (file) => fs.statSync(file).mode,
|
|
109
|
+
chmod: (file, mode) => fs.chmodSync(file, mode)
|
|
110
|
+
});
|
|
111
|
+
if (preparation.kind === "failed") {
|
|
112
|
+
process.stderr.write(`${preparation.message}
|
|
113
|
+
`);
|
|
114
|
+
process.exitCode = 1;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const here = path.dirname(url.fileURLToPath(import.meta.url));
|
|
118
|
+
const child = childProcess.spawn(lookup.path, process.argv.slice(2), {
|
|
119
|
+
stdio: "inherit",
|
|
120
|
+
env: {
|
|
121
|
+
...process.env,
|
|
122
|
+
[TS_BUNDLE_ENV]: path.join(here, "ts", "noskills.js")
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
const forward = (signal) => () => {
|
|
126
|
+
if (process.platform !== "win32") {
|
|
127
|
+
child.kill(signal);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
131
|
+
process.on(signal, forward(signal));
|
|
132
|
+
}
|
|
133
|
+
child.on("error", (error) => {
|
|
134
|
+
process.stderr.write(
|
|
135
|
+
`noskills: cannot run ${lookup.path}: ${error.message}
|
|
136
|
+
`
|
|
137
|
+
);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
});
|
|
140
|
+
child.on("exit", (code, signal) => {
|
|
141
|
+
process.exit(exitCodeOf(code, signal));
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// pkg/@eserstack/noskills/scripts/noskills-launcher.ts
|
|
146
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "noskills",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"noskills": "./noskills.js"
|
|
7
7
|
},
|
|
8
|
+
"optionalDependencies": {
|
|
9
|
+
"@eserstack/ajan-darwin-arm64": "5.0.0",
|
|
10
|
+
"@eserstack/ajan-darwin-x64": "5.0.0",
|
|
11
|
+
"@eserstack/ajan-linux-arm64": "5.0.0",
|
|
12
|
+
"@eserstack/ajan-linux-x64": "5.0.0",
|
|
13
|
+
"@eserstack/ajan-win32-x64": "5.0.0",
|
|
14
|
+
"@eserstack/ajan-wasm": "5.0.0",
|
|
15
|
+
"@eserstack/noskills-darwin-arm64": "5.0.0",
|
|
16
|
+
"@eserstack/noskills-darwin-x64": "5.0.0",
|
|
17
|
+
"@eserstack/noskills-linux-arm64": "5.0.0",
|
|
18
|
+
"@eserstack/noskills-linux-x64": "5.0.0",
|
|
19
|
+
"@eserstack/noskills-win32-x64": "5.0.0"
|
|
20
|
+
},
|
|
8
21
|
"repository": {
|
|
9
22
|
"type": "git",
|
|
10
23
|
"url": "https://github.com/eser/stack"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-MPHTBN7E.js";import"./chunk-YN3SHWBR.js";import"./chunk-CL55MNGD.js";import"./chunk-HISXAZ4Y.js";export{a as AjanBridgeModel,b as AjanBridgeModelFactory,c as createBridgeFactories,e as getBridgeLoadError,d as tryLoadBridgeFactories};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-W46BJM2F.js";import"./chunk-GCPGG4YB.js";import"./chunk-T2X4E35X.js";import"./chunk-YN3SHWBR.js";import"./chunk-CL55MNGD.js";import"./chunk-HISXAZ4Y.js";export{a as AnthropicModel,b as anthropicFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"./chunk-7DIQYKPL.js";import"./chunk-D2UKX2VW.js";import{a as L,d as N}from"./chunk-HLDPASM6.js";import{h as S}from"./chunk-7J6R2D2K.js";import{L as b,k as x,n as I,z as f}from"./chunk-5ALJRBMW.js";import"./chunk-SWRVSRYY.js";import"./chunk-FLLYK5FU.js";import{c,d as $}from"./chunk-W7KQFMHV.js";import{c as o,d as p,f as n,g as m,k as w,o as v,q as E,r as C}from"./chunk-BRC46A3N.js";import"./chunk-TKBGNLNV.js";import"./chunk-XGRZPTAD.js";import"./chunk-XTQFSF6C.js";import{B as A,F as D,H as u,U as _,r as R,u as y,w as O}from"./chunk-SWP6BJR6.js";import{C as P}from"./chunk-M4U4Y3XQ.js";import{a as g,b as i}from"./chunk-CL55MNGD.js";import"./chunk-HISXAZ4Y.js";var Q=async T=>{let e=v({renderer:C.ansi(),sink:E.stdout()}),{root:r}=await _(),h=await $(r),l=O(T,h);if(!l.ok)return e.writeln(n(l.error)),await e.close(),i({exitCode:1});let t;try{t=await y(r,l.spec,h)}catch(s){let a=s instanceof Error?s.message:String(s);return e.writeln(n(a)),await e.close(),i({exitCode:1})}let V=await A(r);if(t.spec!==null){let s=`${r}/${R.specDir(t.spec)}`;try{await P.fs.stat(s)}catch{return e.writeln(n(`Active spec '${t.spec}' directory not found.`)),e.writeln(p(`Run \`${c(`spec ${t.spec} reset`)}\` to return to idle.`)),await e.close(),i({exitCode:1})}}let d=b(t);if(d.length>0&&(t.phase==="SPEC_PROPOSAL"||t.phase==="DISCOVERY_REFINEMENT")){e.writeln(n(`Cannot approve \u2014 ${d.length} pending delegation(s):`)),e.writeln("");for(let s of d)e.writeln(` ${s.questionId}: delegated to `,o(s.delegatedTo),p(` (pending since ${s.delegatedAt.slice(0,10)})`));return e.writeln(""),e.writeln(p("All delegations must be answered before approval.")),await e.close(),i({exitCode:1})}if(t.phase==="SPEC_PROPOSAL"){if(t.classification===null&&t.spec!==null){let F=(await D(r)).filter(U=>V?.concerns.includes(U.id)??!1);try{await k(r,t,F)}catch{}}let s=await S(r),a=I(t);a=f(a,"SPEC_PROPOSAL","SPEC_APPROVED",s),await u(r,a),a.spec!==null&&(await L(r,a.spec,"approved"),await N(r,a.spec,"approved")),e.writeln(m("\u2714")," Spec approved. Phase: ",w("SPEC_APPROVED")),e.writeln("When ready, run ",o(`${c(`spec ${l.spec} next --answer="start"`)}`)," to begin execution.")}else if(t.phase==="DISCOVERY_REFINEMENT"){let s=await S(r),a=x(t);a=f(a,"DISCOVERY_REFINEMENT","SPEC_PROPOSAL",s),await u(r,a),e.writeln(m("\u2714")," Discovery answers approved. Phase: ",w("SPEC_PROPOSAL")),e.writeln("Review the spec and run ",o(c("approve"))," again to approve.")}else t.phase==="DISCOVERY"&&t.discovery.completed?(e.writeln(p("Discovery complete. Spec draft already generated.")),e.writeln("Review the spec and run ",o(c("approve"))," again when in SPEC_PROPOSAL phase.")):e.writeln(n(`Cannot approve in phase: ${t.phase}`));return await e.close(),g(void 0)};export{Q as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as V}from"./chunk-RVNSKPFL.js";import{b as Se}from"./chunk-NYIFCLEG.js";import{a as K,b as C,c as E,d as P,f as T,g as ce,h as ye,j as ue,k as G,l as fe,o as U,p as de,q,r as pe}from"./chunk-BRC46A3N.js";import{b as J,c as k,f as I}from"./chunk-ZAY6LSJD.js";import{C as x}from"./chunk-M4U4Y3XQ.js";import"./chunk-ZW5C5IGT.js";import{e as Ce}from"./chunk-RRDWQKZY.js";import{a as me}from"./chunk-GCPGG4YB.js";import{b as xe}from"./chunk-T2X4E35X.js";import"./chunk-YN3SHWBR.js";import{a as F,b as m,d as W}from"./chunk-CL55MNGD.js";import{d as _}from"./chunk-HISXAZ4Y.js";var f=r=>typeof r=="string"?r.split(".").filter(Boolean):r,w=(r,e=".")=>r.join(e),S=r=>r.join("\0");var B=(r,e)=>r.length<e.length?!1:e.every((t,o)=>r[o]===t);var O=(r,e)=>{let t=typeof e=="string"?[e]:e;return[...r,...t]};var L={};_(L,{configure:()=>er,getEffectiveConfig:()=>ee,getFilterNames:()=>ir,getLoggerCategories:()=>gr,getRegistryState:()=>Xe,getSinkNames:()=>ar,isConfigured:()=>Ze,registerConfigureHook:()=>Z,registerFilter:()=>nr,registerLogger:()=>sr,registerLoggerCacheClear:()=>X,registerSink:()=>rr,reset:()=>Pe,unregisterFilter:()=>or,unregisterSink:()=>tr});var i={Trace:1,Debug:5,Info:9,Notice:10,Warning:13,Error:17,Critical:21,Alert:22,Emergency:23},ve={[i.Trace]:"Trace",[i.Debug]:"Debug",[i.Info]:"Info",[i.Notice]:"Notice",[i.Warning]:"Warning",[i.Error]:"Error",[i.Critical]:"Critical",[i.Alert]:"Alert",[i.Emergency]:"Emergency"};import*as Y from"node:async_hooks";var $,z,Ke=()=>($===void 0&&($=new Y.AsyncLocalStorage),$),Ge=()=>(z===void 0&&(z=new Y.AsyncLocalStorage),z),he,Te,Q=r=>{he=r},ke=r=>{Te=r},we=()=>{$=void 0,z=void 0},Ue=()=>he??Ke(),qe=()=>Te??Ge();var Re=()=>{let r=Ue();return r?r.getStore()??{}:{}};var Je=()=>{let r=qe();return r?r.getStore()??[]:[]},Le=r=>{let e=Je();return e.length===0?r:O(e,r)};var Ve=r=>r.map(e=>({category:f(e.category),hasLevel:e.lowestLevel!==void 0,...e.sinks!==void 0&&{sinks:e.sinks},...e.parentSinks!==void 0&&{parentSinks:e.parentSinks},...e.filters!==void 0&&{filters:e.filters}})),Be=(r,e)=>{let t=e.map((l,g)=>({index:g,length:f(l.category).length})).filter(({index:l})=>B(r,f(e[l].category))).sort((l,g)=>g.length-l.length),o=new Set,n=new Set,s=-1,a=!0;for(let{index:l}of t){let g=e[l];if(s<0&&g.lowestLevel!==void 0&&(s=l),!!a){for(let u of g.sinks??[])o.add(u);for(let u of g.filters??[])n.add(u);g.sinks!==void 0&&g.sinks.length>0&&g.parentSinks==="override"&&(a=!1)}}return{levelIndex:s,sinks:[...o],filters:[...n]}},Ye=(r,e)=>{J();let t=k();if(t===null)return null;let o;try{o=t.call("logResolveConfig",{category:r,loggers:Ve(e)})}catch{return null}return o.error!==void 0&&o.error!==""||o.levelIndex===void 0||o.sinks===void 0||o.filters===void 0?null:{levelIndex:o.levelIndex,sinks:o.sinks,filters:o.filters}},Ae=(r,e)=>e.length===0?{levelIndex:-1,sinks:[],filters:[]}:Ye(r,e)??Be(r,e);var Fe=null,X=r=>{Fe=r},Ee=null,Z=r=>{Ee=r},c=null,p=new Map,Xe=()=>c,Ze=()=>c!==null,er=async r=>{(r.reset||c===null)&&await Pe(),c={sinks:new Map(Object.entries(r.sinks)),filters:new Map(Object.entries(r.filters??{})),loggers:new Map,contextLocalStorage:r.contextLocalStorage};for(let e of r.loggers){let t=f(e.category),o=S(t);c.loggers.set(o,{...e,category:t})}r.contextLocalStorage&&Q(r.contextLocalStorage),p.clear(),await Ee?.(r.loggers)},Pe=async()=>{if(c)for(let r of c.sinks.values()){let e=r;typeof e.dispose=="function"?await e.dispose():typeof e[Symbol.asyncDispose]=="function"&&await e[Symbol.asyncDispose]()}c=null,p.clear(),Fe?.(),Q(void 0),ke(void 0),we()},ee=r=>{let e=S(r),t=p.get(e);if(t)return t;let o={sinks:[],filters:[],lowestLevel:i.Info};if(!c)return o;let n=Array.from(c.loggers.values()),s=Ae(r,n),a=n[s.levelIndex];a?.lowestLevel!==void 0&&(o.lowestLevel=a.lowestLevel);for(let l of s.sinks){let g=c.sinks.get(l);g&&o.sinks.push(g)}for(let l of s.filters){let g=c.filters.get(l);g&&o.filters.push(g)}return p.set(e,o),o},rr=(r,e)=>{if(!c)throw new Error("Logging not configured. Call configure() first.");c.sinks.set(r,e),p.clear()},tr=r=>{c&&(c.sinks.delete(r),p.clear())},nr=(r,e)=>{if(!c)throw new Error("Logging not configured. Call configure() first.");c.filters.set(r,e),p.clear()},or=r=>{c&&(c.filters.delete(r),p.clear())},sr=r=>{if(!c)throw new Error("Logging not configured. Call configure() first.");let e=f(r.category),t=S(e);c.loggers.set(t,{...r,category:e}),p.clear()},ar=()=>c?Array.from(c.sinks.keys()):[],ir=()=>c?Array.from(c.filters.keys()):[],gr=()=>c?Array.from(c.loggers.values()).map(r=>f(r.category)):[];var j={};_(j,{DEFAULT_LEVEL:()=>yr,Logger:()=>A,clearLoggerCache:()=>Ne,current:()=>xr,getLogger:()=>mr});var lr="[circular cause]",cr=r=>{let e=new Set,t=n=>n instanceof Error?e.has(n)?lr:o(n):n,o=n=>{e.add(n);let s={name:n.name,message:n.message};for(let[l,g]of Object.entries(n))s[l]=t(g);s.stack=n.stack,n instanceof AggregateError&&(s.errors=Array.isArray(n.errors)?n.errors.map(t):n.errors);let a=n.cause;return a!==void 0&&(s.cause=t(a)),e.delete(n),s};return o(r)},Ie=(r,e)=>e instanceof Error?cr(e):e,b=r=>{try{return JSON.stringify(r,Ie)}catch{return null}};var yr=i.Info,M=r=>r<=4?"TRACE":r<=8?"DEBUG":r<=12?"INFO":r<=16?"WARN":r<=20?"ERROR":r<=24?"FATAL":"PANIC",te=r=>r instanceof Error?r.message:String(r),ie=r=>{try{console.error(r)}catch{}},ne=!1,ur=r=>{ne||(ne=!0,ie(`[eserstack/logging] Go logging backend unavailable (${r}); log records now go to a local console sink on stderr. Reported once per process.`))},fr=(r,e,t,o)=>{let n=Object.keys(o).length>0?` ${b(o)??'{"attrs":"unserializable"}'}`:"";ie(`${new Date().toISOString()} ${M(e)} ${w(r)}: ${t}${n}`)},oe=new WeakSet,re=(r,e,t)=>{oe.has(e)||(oe.add(e),ie(`[eserstack/logging] a configured log ${r} failed (${te(t)}); the records it fails on are lost. Reported once per ${r}.`))},dr=(r,e,t)=>{for(let o of t)try{if(!o(r))return}catch(n){re("filter",o,n);return}for(let o of e)try{let n=o(r);n!==void 0&&Promise.resolve(n).catch(s=>{re("sink",o,s)})}catch(n){re("sink",o,n)}},R=new Map,se=0,pr=()=>{let r=k();if(r!==null)for(let e of R.values())for(let{handle:t}of e)try{r.call("logClose",t)}catch{}R.clear(),se+=1},A=class r{category;parent;#r;#e=null;#n=-1;#o=!1;constructor(e,t=null,o={}){this.category=f(e),this.parent=t,this.#r=o}#s(){return ee(this.category)}#t(e){this.#o=!0,ur(e)}#a(){if(this.#n===se)return this.#e;this.#n=se,this.#e=null;try{let e=I(),t=S(this.category),o=M(this.#s().lowestLevel),n=R.get(t)??[],s=n.find(l=>l.level===o);if(s!==void 0)return this.#e=s.handle,this.#e;let a=e.call("logCreate",{scopeName:w(this.category),level:o});if(a.handle===void 0||a.handle==="")return this.#t(a.error??`logCreate returned ${JSON.stringify(a)}`),null;this.#e=a.handle,n.push({handle:a.handle,level:o}),R.set(t,n)}catch(e){return this.#t(te(e)),null}return this.#e}#i(e,t,o,n){let s=b({handle:e,level:M(t),message:o,attrs:n});if(s===null)return!1;try{let a=I().call("logWrite",s);if(a.error===void 0||a.error==="")return!0;this.#t(a.error)}catch(a){this.#t(te(a))}return!1}#g(e,t,o){let n=this.#o?null:this.#a();n!==null&&this.#i(n,e,t,o)||fr(this.category,e,t,o)}getChild(e){let t=O(this.category,f(e));return new r(t,this,this.#r)}with(e){return new r(this.category,this.parent,{...this.#r,...e})}get loggerName(){return w(this.category)}asString(e,t=!1){return typeof e=="string"?t?`"${e}"`:e:e===null||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||typeof e>"u"||typeof e=="symbol"?String(e):e instanceof Error?e.stack??`${e.name}: ${e.message}`:e!==null&&typeof e=="object"?Array.isArray(e)?JSON.stringify(e):`{${Object.entries(e).map(([o,n])=>`"${o}":${this.asString(n,!0)}`).join(",")}}`:"undefined"}async log(e,t,...o){let n=this.#s();if(e<n.lowestLevel)return t instanceof Function?void 0:t;let s,a;t instanceof Function?(s=t(),a=this.asString(s)):a=this.asString(t);let l=Re()??{};if(n.sinks.length>0)return dr({message:a,rawMessage:a,args:o,datetime:new Date,severity:e,category:this.category,properties:this.#r,context:l},n.sinks,n.filters),t instanceof Function?s:t;let g={...this.#r,...l};return o.length>0&&(g.args=o),this.#g(e,a,g),t instanceof Function?s:t}debug(e,...t){return this.log(i.Debug,e,...t)}info(e,...t){return this.log(i.Info,e,...t)}warn(e,...t){return this.log(i.Warning,e,...t)}error(e,...t){return this.log(i.Error,e,...t)}critical(e,...t){return this.log(i.Critical,e,...t)}emergency(e,...t){return this.log(i.Emergency,e,...t)}alert(e,...t){return this.log(i.Alert,e,...t)}notice(e,...t){return this.log(i.Notice,e,...t)}trace(e,...t){return this.log(i.Trace,e,...t)}},ae=new Map,mr=r=>{let e=Le(f(r)),t=S(e),o=ae.get(t);return o===void 0&&(o=new A(e),ae.set(t,o)),o},Ne=()=>{ae.clear(),pr(),ne=!1,oe=new WeakSet};X(Ne);Z(r=>{let e=k();if(!(e===null||R.size===0))for(let t of r){if(t.lowestLevel===void 0)continue;let o=f(t.category),n=S(o),s=M(t.lowestLevel);for(let a of R.get(n)??[])e.call("logConfigure",{handle:a.handle,level:s}),a.level=s}});var xr=new A(["default"]);var H={};_(H,{fingersCrossedSink:()=>Lr,getBufferedSink:()=>Rr,getOutputSink:()=>kr,getRecordCollectorSink:()=>De,getTestSink:()=>br,withFilter:()=>wr});var Sr={[i.Trace]:"TRCE",[i.Debug]:"DBUG",[i.Info]:"INFO",[i.Notice]:"NOTC",[i.Warning]:"WARN",[i.Error]:"ERRO",[i.Critical]:"CRIT",[i.Alert]:"ALRT",[i.Emergency]:"EMRG"};var Cr=(r,e)=>{if(e==="none")return"";if(typeof e=="function")return e(r);let t=r.toISOString(),o=t.slice(0,10),n=t.slice(11,19),s=t.slice(19);switch(e){case"rfc3339":return t;case"date-time-timezone":case void 0:return`${o} ${n}${s}`;case"date-time":return`${o} ${n}`;case"time-timezone":return`${n}${s}`;case"time":return n;case"date":return o}},vr=r=>b(r)??String(r),hr=(r,e)=>{let t={...e,...r},o=Object.entries(t);return o.length===0?"":" "+o.map(([n,s])=>{let a=typeof s=="string"?s:vr(s);return`${n}=${a}`}).join(" ")};var Tr=(r,e)=>{switch(r){case i.Trace:return P(ue(e));case i.Debug:return fe(e);case i.Info:return ce(e);case i.Notice:return G(e);case i.Warning:return ye(e);case i.Error:return T(e);case i.Critical:return E(T(e));case i.Alert:return E(T(e));case i.Emergency:return E(T(e));default:return C(e)}},$e=r=>{let e=Cr(r.datetime,"date-time-timezone"),t=Sr[r.severity]??"????",o=r.category.length>0?w(r.category):"",n=hr(r.properties,r.context),s=[];return e&&s.push(P(e),C(" ")),s.push(Tr(r.severity,t),C(" ")),o&&s.push(G(`[${o}]`),C(" ")),r.severity>=i.Error?s.push(T(r.message)):s.push(C(r.message)),n.trim()&&s.push(C(" "),P(n.trim())),s};var kr=(r,e)=>{let t=e?.formatter??$e;return o=>{let n=t(o);r.writeln(...n)}},wr=(r,e)=>t=>{if(e(t))return r(t)},Rr=(r,e={})=>{let{maxSize:t=100,flushIntervalMs:o=5e3}=e,n=[],s=null,a=async()=>{if(n.length===0)return;let u=n;n=[],s!==null&&(clearTimeout(s),s=null),await Promise.all(u.map(y=>r(y)))},l=()=>{s===null&&(s=setTimeout(()=>{s=null,a().catch(()=>{})},o))},g=async u=>{n.push(u),n.length>=t?await a():l()};return g.flush=a,g},Lr=(r,e={})=>{let{triggerLevel:t=i.Error,maxBufferSize:o=1e3}=e,n=[],s=!1,a=async()=>{let u=n;n=[],s=!0,await Promise.all(u.map(y=>r(y)))},l=()=>{n=[],s=!1},g=async u=>{if(s){await r(u);return}if(u.severity>=t){n.push(u),await a();return}n.push(u),n.length>o&&n.shift()};return g.flush=a,g.clear=l,g},De=()=>{let r=[];return{sink:t=>{r.push(t)},records:r}},br=De;var rt=Ce.getTracer("@eserstack/logging");var ge=(r,e,t)=>{let o=r.streamText(e,t);return{name:`ai-text/${r.provider}/${r.modelId}`,readable:new ReadableStream({async start(n){try{for await(let s of o)if(s.kind==="content_delta")n.enqueue(K(s.textDelta));else if(s.kind==="error"){n.error(s.error);return}n.close()}catch(s){n.error(s)}}})}};var Ir=new Map([["cc","claude-code"],["ol","ollama"],["oc","opencode"],["oai","openai"],["ant","anthropic"],["gem","gemini"],["vtx","vertexai"],["kr","kiro"]]),Or=new Map([["claude-code","Claude Code"],["ollama","Ollama"],["opencode","OpenCode"],["kiro","Kiro"],["anthropic","Anthropic API"],["openai","OpenAI API"],["gemini","Gemini API"],["vertexai","Vertex AI"]]),Nr=r=>Ir.get(r)??r,$r=async r=>{if(r){let e=x.process.stderr.getWriter(),t=U({renderer:pe.ansi(),sink:q.writable(new WritableStream({async write(o){await e.write(new TextEncoder().encode(String(o.data)))},close(){e.releaseLock()}}))});await L.configure({sinks:{stderr:H.getOutputSink(t)},loggers:[{category:["ai"],lowestLevel:i.Debug,sinks:["stderr"]}]})}return j.getLogger(["ai","ask"])},zr=async r=>{if(await r.info("Auto-detecting AI provider..."),await V("claude"))return await r.info("Claude Code detected."),"claude-code";try{if((await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok)return await r.info("Ollama detected at localhost:11434."),"ollama"}catch{}if(await V("opencode"))return await r.info("OpenCode detected."),"opencode";if(x.capabilities.env){if(x.env.has("ANTHROPIC_API_KEY")||x.env.has("ANTHROPIC_AUTH_TOKEN"))return await r.info("Anthropic API key detected."),"anthropic";if(x.env.has("OPENAI_API_KEY"))return await r.info("OpenAI API key detected."),"openai"}throw new Error("No AI provider detected. Install claude, ollama, or set ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN / OPENAI_API_KEY.")},Dr=async r=>{let t=await(await import("./mod-XVE4ZWPY.js")).factoryFor(r);if(t===void 0)throw new Error(`Unknown provider: ${r}`);return t},je='Usage: ai ask "your prompt" [-p provider] [-m model] [--max-tokens n] [--effort level] [--json] [--verbose]',Mr=new Set(["low","medium","high","xhigh","max"]),jr=r=>Mr.has(r),Hr=new Set(["-p","--provider","-m","--model","--max-tokens","--effort"]),_r=r=>{let e=null,t=null,o=null,n=null,s=!1,a=!1,l=[],g=0;for(;g<r.length;){let y=r[g];if(Hr.has(y)){let d=r[g+1];if(d===void 0)return m(`${y} needs a value. ${je}`);switch(y){case"-p":case"--provider":e=d;break;case"-m":case"--model":t=d;break;case"--max-tokens":{let h=Number(d);if(!Number.isSafeInteger(h)||h<=0)return m(`--max-tokens ${JSON.stringify(d)} is not a positive whole number; pass the output token limit, such as --max-tokens 1024`);o=h;break}case"--effort":if(!jr(d))return m(`--effort ${JSON.stringify(d)} is not an effort level; use low, medium, high, xhigh or max`);n=d;break}g+=2;continue}if(y==="--json"){s=!0,g+=1;continue}if(y==="-v"||y==="--verbose"){a=!0,g+=1;continue}y.startsWith("-")||l.push(y),g+=1}let u=l.join(" ");return u.length===0?m(je):F({provider:e,model:t,maxTokens:o,effort:n,json:s,verbose:a,prompt:u})},St=async r=>{let e=_r(r??[]);if(W(e))return m({message:e.error,exitCode:1});let{provider:t,model:o,maxTokens:n,effort:s,json:a,verbose:l,prompt:g}=e.value,u=await $r(l);try{let y=t!==null?Nr(t):await zr(u),d=Or.get(y)??y,h=o??qr(y);await u.info(`Using ${d} (${h})`);let He=await Dr(y),le=new Se({factories:[He]});try{let _e=await le.addModel("default",{provider:y,model:h});return await u.info(`Sending prompt (${g.length} chars)...`),await Wr(_e,{messages:[me("user",g)],maxTokens:n??void 0,effort:s??void 0},a,u)}finally{await le.close()}}catch(y){let d=y instanceof Error?y.message:String(y);return await u.error(d),l&&y instanceof Error&&y.cause!==void 0&&await u.debug(`Cause: ${String(y.cause)}`),m({message:d,exitCode:1})}},Wr=async(r,e,t,o)=>{if(t){let s=await r.generateText(e);if(W(s))return await o.error(s.error.message),m({message:s.error.message,exitCode:1});let a=s.value;await o.info(`Response received (${xe(a).length} chars)`);let l=U({sink:q.stdout()});return l.writeln(JSON.stringify(a,null,2)),await l.close(),F(void 0)}await de().from(ge(r,e)).to(Ur()).run();let n=x.process.stdout.getWriter();return await n.write(new TextEncoder().encode(`
|
|
2
|
+
`)),n.releaseLock(),F(void 0)},Kr=12,Gr=r=>new Promise(e=>setTimeout(e,r)),Ur=(r=Kr)=>{let e=new TextEncoder;return{name:"typewriter",writable:new WritableStream({async write(t){let o=String(t.data),n=x.process.stdout.getWriter();try{for(let s of o)await n.write(e.encode(s)),await Gr(r)}finally{n.releaseLock()}}})}},qr=r=>{switch(r){case"claude-code":return"claude-sonnet-5";case"ollama":return"llama3";case"opencode":return"default";case"kiro":return"default";case"anthropic":return"claude-sonnet-5";case"openai":return"gpt-5.6-terra";case"gemini":return"gemini-3.6-flash";case"vertexai":return"gemini-3.6-flash";default:return"default"}};export{St as main,_r as parseAskArgs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as j}from"./chunk-7J6R2D2K.js";import{p as R,z as b}from"./chunk-5ALJRBMW.js";import"./chunk-SWRVSRYY.js";import"./chunk-FLLYK5FU.js";import{c as p,d as A}from"./chunk-W7KQFMHV.js";import{c as h,d as l,f as o,h as g,o as y,q as C,r as k}from"./chunk-BRC46A3N.js";import"./chunk-TKBGNLNV.js";import"./chunk-XGRZPTAD.js";import"./chunk-XTQFSF6C.js";import{H as v,U as E,r as x,u as S,w as $}from"./chunk-SWP6BJR6.js";import{C as w}from"./chunk-M4U4Y3XQ.js";import{a as f,b as i}from"./chunk-CL55MNGD.js";import"./chunk-HISXAZ4Y.js";var K=async m=>{let e=y({renderer:k.ansi(),sink:C.stdout()}),{root:r}=await E(),d=await A(r),a=$(m,d);if(!a.ok)return e.writeln(o(a.error)),await e.close(),i({exitCode:1});let u=(m??[]).filter(t=>!t.startsWith("--spec=")).join(" "),n=u===""?"No reason given":u,s;try{s=await S(r,a.spec,d)}catch(t){let N=t instanceof Error?t.message:String(t);return e.writeln(o(N)),await e.close(),i({exitCode:1})}if(s.spec!==null){let t=`${r}/${x.specDir(s.spec)}`;try{await w.fs.stat(t)}catch{return e.writeln(o(`Active spec '${s.spec}' directory not found.`)),e.writeln(l(`Run \`${p(`spec ${s.spec} reset`)}\` to return to idle.`)),await e.close(),i({exitCode:1})}}if(s.phase!=="EXECUTING")return e.writeln(o(`Cannot block in phase: ${s.phase}`)),await e.close(),i({exitCode:1});let D=await j(r),c=R(s,n);return c=b(c,"EXECUTING","BLOCKED",D,n),await v(r,c),e.writeln(g("\u26A0")," Spec blocked: ",l(n)),e.writeln("Resolve with: ",h(`${p(`spec ${a.spec} next --answer="resolution"`)}`)),await e.close(),f(void 0)};export{K as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as $}from"./chunk-6BKTY7SA.js";import{a as L,d as U}from"./chunk-HLDPASM6.js";import{h as T}from"./chunk-7J6R2D2K.js";import{N as P,r as x,z as I}from"./chunk-5ALJRBMW.js";import"./chunk-SWRVSRYY.js";import"./chunk-FLLYK5FU.js";import{c as D,d as k}from"./chunk-W7KQFMHV.js";import{d,f as i,g as u,o as f,q as w,r as h}from"./chunk-BRC46A3N.js";import"./chunk-TKBGNLNV.js";import"./chunk-XGRZPTAD.js";import"./chunk-XTQFSF6C.js";import{U as v,r as S,u as g,w as E,x as y,z as C}from"./chunk-SWP6BJR6.js";import{C as m}from"./chunk-M4U4Y3XQ.js";import{a as l,b as n}from"./chunk-CL55MNGD.js";import"./chunk-HISXAZ4Y.js";var H=async A=>{let t=f({renderer:h.ansi(),sink:w.stdout()}),{root:s}=await v(),o=await k(s),c=E(A,o);if(!c.ok)return t.writeln(i(c.error)),await t.close(),n({exitCode:1});let e;try{e=await g(s,c.spec,o)}catch(a){let R=a instanceof Error?a.message:String(a);return t.writeln(i(R)),await t.close(),n({exitCode:1})}if(e.phase==="IDLE"||e.phase==="UNINITIALIZED"||e.phase==="COMPLETED")return t.writeln(i(`Cannot cancel in phase: ${e.phase}`)),await t.close(),n({exitCode:1});if(e.spec!==null){let a=`${s}/${S.specDir(e.spec)}`;try{await m.fs.stat(a)}catch{return t.writeln(i(`Active spec '${e.spec}' directory not found.`)),t.writeln(d(`Run \`${D(`spec ${e.spec} reset`)}\` to return to idle.`)),await t.close(),n({exitCode:1})}}let p=await T(s),r=x(e,"cancelled");r=I(r,e.phase,"COMPLETED",p,"cancelled"),r.spec!==null&&await C(s,r.spec,r);let O=P(r);return await y(s,O),r.spec!==null&&(await L(s,r.spec,"cancelled"),await U(s,r.spec,"cancelled")),await $(s,{ts:new Date().toISOString(),type:"phase-change",spec:e.spec??"unknown",user:p.name,from:e.phase,to:"COMPLETED",reason:"cancelled"}),t.writeln(u("\u2714")," Spec cancelled."),await t.close(),l(void 0)};export{H as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as w,h as y,r as S}from"./chunk-5ALJRBMW.js";import{b as d,r as m,z as h}from"./chunk-SWP6BJR6.js";import{C as p}from"./chunk-M4U4Y3XQ.js";var f=t=>{let e=w(d(),t.name,`spec/${t.name}`,t.description??void 0);return y({...e,discovery:{...e.discovery,answers:[...t.answers]}})},n=class extends Error{names;constructor(e,a){super(e),this.names=a,this.name="SplitRefusedError"}},g=async(t,e)=>await p.fs.exists(`${t}/${m.specDir(e)}`),x=async(t,e)=>{if(await g(t,e.name))throw new n(`Cannot create spec "${e.name}": a spec with that name already exists.`,[e.name]);await p.fs.mkdir(`${t}/${m.specDir(e.name)}`,{recursive:!0}),await h(t,e.name,f(e))},D=async(t,e,a,u)=>{let i=a.map(s=>s.name),l=s=>[...new Set(s)].map(c=>`"${c}"`).join(", "),r=i.filter((s,c)=>i.indexOf(s)!==c);if(r.length>0)throw new n(`Cannot split: child spec names must be unique, and these repeat: ${l(r)}.`,[...new Set(r)]);let o=(await Promise.all(i.map(async s=>await g(t,s)?s:null))).filter(s=>s!==null);if(o.length>0)throw new n(`Cannot split: these specs already exist: ${l(o)}. Choose other names with \`${u} spec ${e.spec??"<name>"} split --into <first> "<description>" --into <second> "<description>"\`.`,o);return await Promise.all(a.map(s=>x(t,s))),S(e,"cancelled",`Split into: ${i.join(", ")}`)};export{n as a,D as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as i,f as c,g as m,h as p}from"./chunk-HNQA5O2S.js";import{a as g,k as d}from"./chunk-YN3SHWBR.js";import{a,b as l}from"./chunk-CL55MNGD.js";var s=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="gemini";modelId;client;config;constructor(o,r){this.client=o,this.config=r,this.modelId=r.model}async generateText(o,r){try{let t=i(this.config,o,this.provider,r),n=await this.client.models.generateContent({model:this.config.model,...t});return a(c(n,this.modelId))}catch(t){return l(y(t))}}async*streamText(o,r){try{let t=i(this.config,o,this.provider,r),n=await this.client.models.generateContentStream({model:this.config.model,...t});yield*m(n)}catch(t){yield{kind:"error",error:y(t)}}}async close(){}getRawClient(){return this.client}},v={provider:"gemini",createModel:async e=>{let o=await import("./node-XYP2DQHR.js"),r=new o.GoogleGenAI({apiKey:e.apiKey,apiVersion:"v1beta"});return new s(r,e)}},y=e=>{if(e instanceof g)return e;let o=e instanceof Error?e:new Error(String(e)),r=p(e);return d("gemini",r,o)};export{s as a,v as b};
|