@kindgi/cli 0.1.4-rc.0 → 0.1.4-rc.2
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 +26 -12
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/agents.d.ts +11 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +318 -38
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/conversations.d.ts.map +1 -1
- package/dist/commands/conversations.js +72 -17
- package/dist/commands/conversations.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +129 -28
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/eval-runs.d.ts.map +1 -1
- package/dist/commands/eval-runs.js +85 -30
- package/dist/commands/eval-runs.js.map +1 -1
- package/dist/commands/flows.d.ts.map +1 -1
- package/dist/commands/flows.js +84 -25
- package/dist/commands/flows.js.map +1 -1
- package/dist/commands/gate-policies.d.ts +3 -0
- package/dist/commands/gate-policies.d.ts.map +1 -0
- package/dist/commands/gate-policies.js +118 -0
- package/dist/commands/gate-policies.js.map +1 -0
- package/dist/commands/helpers.d.ts +8 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +13 -0
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +4 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/judge-classes.d.ts.map +1 -1
- package/dist/commands/judge-classes.js +64 -7
- package/dist/commands/judge-classes.js.map +1 -1
- package/dist/commands/memory.d.ts.map +1 -1
- package/dist/commands/memory.js +70 -12
- package/dist/commands/memory.js.map +1 -1
- package/dist/commands/projects.d.ts +3 -0
- package/dist/commands/projects.d.ts.map +1 -0
- package/dist/commands/projects.js +53 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/provenance.d.ts.map +1 -1
- package/dist/commands/provenance.js +66 -14
- package/dist/commands/provenance.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +44 -3
- package/dist/commands/runs.js.map +1 -1
- package/dist/commands/tools.d.ts.map +1 -1
- package/dist/commands/tools.js +28 -38
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/unwired.d.ts +4 -2
- package/dist/commands/unwired.d.ts.map +1 -1
- package/dist/commands/unwired.js +38 -11
- package/dist/commands/unwired.js.map +1 -1
- package/dist/context.d.ts +3 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/dev/defaults.d.ts +16 -7
- package/dist/dev/defaults.d.ts.map +1 -1
- package/dist/dev/defaults.js +130 -34
- package/dist/dev/defaults.js.map +1 -1
- package/dist/dev/port.d.ts +27 -0
- package/dist/dev/port.d.ts.map +1 -0
- package/dist/dev/port.js +67 -0
- package/dist/dev/port.js.map +1 -0
- package/dist/dev/python-builder.d.ts +10 -1
- package/dist/dev/python-builder.d.ts.map +1 -1
- package/dist/dev/python-builder.js +21 -6
- package/dist/dev/python-builder.js.map +1 -1
- package/dist/dev/runners.d.ts +11 -0
- package/dist/dev/runners.d.ts.map +1 -1
- package/dist/dev/runtime-env.d.ts +6 -0
- package/dist/dev/runtime-env.d.ts.map +1 -1
- package/dist/dev/runtime-env.js +1 -0
- package/dist/dev/runtime-env.js.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/dev/shared-watch.d.ts +25 -0
- package/dist/dev/shared-watch.d.ts.map +1 -0
- package/dist/dev/shared-watch.js +111 -0
- package/dist/dev/shared-watch.js.map +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +14 -3
- package/dist/errors.js.map +1 -1
- package/dist/help.js +1 -1
- package/dist/help.js.map +1 -1
- package/dist/parse.d.ts +3 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js.map +1 -1
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +3 -3
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +1 -1
- package/dist/stop-signal.d.ts +41 -7
- package/dist/stop-signal.d.ts.map +1 -1
- package/dist/stop-signal.js +39 -4
- package/dist/stop-signal.js.map +1 -1
- package/package.json +11 -10
package/dist/stop-signal.d.ts
CHANGED
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SIGINT / SIGTERM → an AbortSignal long-lived commands
|
|
3
|
-
* watch to shut down cleanly: close watchers, stop the
|
|
4
|
-
* down the bundled containers.
|
|
2
|
+
* SIGINT / SIGTERM / SIGHUP → an AbortSignal long-lived commands
|
|
3
|
+
* (`kindgi dev`) watch to shut down cleanly: close watchers, stop the
|
|
4
|
+
* api-server, tear down the bundled containers. SIGHUP is the terminal
|
|
5
|
+
* closing: without a listener it ended `kindgi dev` at once, leaving its
|
|
6
|
+
* runtime container running.
|
|
5
7
|
*
|
|
6
8
|
* The listener stays registered (`on`, never `once`), so a dependency
|
|
7
9
|
* that re-raises a signal when it finds itself the only listener left
|
|
8
|
-
* (`signal-exit` v3 does) can't cut the graceful shutdown short.
|
|
9
|
-
*
|
|
10
|
+
* (`signal-exit` v3 does) can't cut the graceful shutdown short.
|
|
11
|
+
*
|
|
12
|
+
* A second Ctrl+C forces the exit, the usual Ctrl+C-twice contract, but
|
|
13
|
+
* not one that comes with the first. One Ctrl+C can arrive more than once:
|
|
14
|
+
* the terminal signals the whole foreground process group, and a wrapper
|
|
15
|
+
* in it signals its child too (`npx` and `pnpm run` forward SIGINT;
|
|
16
|
+
* `pnpm exec` sends SIGTERM and exits at once). A signal is the same
|
|
17
|
+
* Ctrl+C when it's handled within `REPEAT_SIGNAL_WINDOW_MS` of the first,
|
|
18
|
+
* or before the event loop has turned twice since: a stop step can hold
|
|
19
|
+
* the loop (closing a recursive file watcher takes over a second on
|
|
20
|
+
* macOS), so a signal that came at once can be handled late. A SIGTERM
|
|
21
|
+
* or SIGHUP never forces the exit; it asks for the stop already under
|
|
22
|
+
* way. Forcing it left the runtime container running.
|
|
10
23
|
*/
|
|
24
|
+
type StopSignalName = 'SIGINT' | 'SIGTERM' | 'SIGHUP';
|
|
11
25
|
export interface SignalSource {
|
|
12
|
-
on(event:
|
|
26
|
+
on(event: StopSignalName, listener: () => void): unknown;
|
|
27
|
+
}
|
|
28
|
+
/** Where the stop signal reads the time and the event loop's turns (tests fake it). */
|
|
29
|
+
export interface StopSignalClock {
|
|
30
|
+
now(): number;
|
|
31
|
+
/** Run `fn` on the event loop's next turn. */
|
|
32
|
+
nextTurn(fn: () => void): void;
|
|
33
|
+
}
|
|
34
|
+
/** How long after the first signal another is still the same Ctrl+C. */
|
|
35
|
+
export declare const REPEAT_SIGNAL_WINDOW_MS = 500;
|
|
36
|
+
export declare function createStopSignal(source: SignalSource, forceExit: (code: number) => void, clock?: StopSignalClock): AbortSignal;
|
|
37
|
+
/** Where the command's output goes (`process.stdout`, `process.stderr`). */
|
|
38
|
+
export interface OutputStream {
|
|
39
|
+
on(event: 'error', listener: (error: Error) => void): unknown;
|
|
13
40
|
}
|
|
14
|
-
|
|
41
|
+
/**
|
|
42
|
+
* After a hangup (SIGHUP: the terminal closed), writing to the terminal
|
|
43
|
+
* fails (EIO). Unheard, that error would end the process mid-stop, the
|
|
44
|
+
* runtime container left behind, so from then on the outputs' errors are
|
|
45
|
+
* ignored: nobody is left to read them.
|
|
46
|
+
*/
|
|
47
|
+
export declare function ignoreOutputAfterHangup(source: SignalSource, outputs: readonly OutputStream[]): void;
|
|
48
|
+
export {};
|
|
15
49
|
//# sourceMappingURL=stop-signal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop-signal.d.ts","sourceRoot":"","sources":["../src/stop-signal.ts"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"stop-signal.d.ts","sourceRoot":"","sources":["../src/stop-signal.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,KAAK,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAC1D;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,GAAG,IAAI,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChC;AAED,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAS3C,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EACjC,KAAK,GAAE,eAA6B,GACnC,WAAW,CAuBb;AAED,4EAA4E;AAC5E,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC;CAC/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,SAAS,YAAY,EAAE,GAC/B,IAAI,CAON"}
|
package/dist/stop-signal.js
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
-
|
|
3
|
+
/** How long after the first signal another is still the same Ctrl+C. */
|
|
4
|
+
export const REPEAT_SIGNAL_WINDOW_MS = 500;
|
|
5
|
+
const systemClock = {
|
|
6
|
+
now: () => Date.now(),
|
|
7
|
+
nextTurn: (fn) => {
|
|
8
|
+
setImmediate(fn);
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export function createStopSignal(source, forceExit, clock = systemClock) {
|
|
4
12
|
const controller = new AbortController();
|
|
5
|
-
|
|
13
|
+
let firstAt = 0;
|
|
14
|
+
let settled = false;
|
|
15
|
+
const onSignal = (signal) => {
|
|
6
16
|
if (!controller.signal.aborted) {
|
|
17
|
+
firstAt = clock.now();
|
|
18
|
+
clock.nextTurn(() => clock.nextTurn(() => {
|
|
19
|
+
settled = true;
|
|
20
|
+
}));
|
|
7
21
|
controller.abort();
|
|
8
22
|
return;
|
|
9
23
|
}
|
|
24
|
+
if (signal !== 'SIGINT')
|
|
25
|
+
return;
|
|
26
|
+
if (!settled || clock.now() - firstAt < REPEAT_SIGNAL_WINDOW_MS)
|
|
27
|
+
return;
|
|
10
28
|
forceExit(130);
|
|
11
29
|
};
|
|
12
|
-
source.on('SIGINT', onSignal);
|
|
13
|
-
source.on('SIGTERM', onSignal);
|
|
30
|
+
source.on('SIGINT', () => onSignal('SIGINT'));
|
|
31
|
+
source.on('SIGTERM', () => onSignal('SIGTERM'));
|
|
32
|
+
source.on('SIGHUP', () => onSignal('SIGHUP'));
|
|
14
33
|
return controller.signal;
|
|
15
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* After a hangup (SIGHUP: the terminal closed), writing to the terminal
|
|
37
|
+
* fails (EIO). Unheard, that error would end the process mid-stop, the
|
|
38
|
+
* runtime container left behind, so from then on the outputs' errors are
|
|
39
|
+
* ignored: nobody is left to read them.
|
|
40
|
+
*/
|
|
41
|
+
export function ignoreOutputAfterHangup(source, outputs) {
|
|
42
|
+
let hungUp = false;
|
|
43
|
+
source.on('SIGHUP', () => {
|
|
44
|
+
if (hungUp)
|
|
45
|
+
return;
|
|
46
|
+
hungUp = true;
|
|
47
|
+
for (const output of outputs)
|
|
48
|
+
output.on('error', () => undefined);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
16
51
|
//# sourceMappingURL=stop-signal.js.map
|
package/dist/stop-signal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop-signal.js","sourceRoot":"","sources":["../src/stop-signal.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"stop-signal.js","sourceRoot":"","sources":["../src/stop-signal.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAuCjC,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,WAAW,GAAoB;IACnC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACrB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE;QACf,YAAY,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;CACF,CAAC;AAEF,MAAM,UAAU,gBAAgB,CAC9B,MAAoB,EACpB,SAAiC,EACjC,QAAyB,WAAW;IAEpC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,MAAM,QAAQ,GAAG,CAAC,MAAsB,EAAQ,EAAE;QAChD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC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name": "@kindgi/cli",
|
|
3
|
-
"version": "0.1.4-rc.
|
|
3
|
+
"version": "0.1.4-rc.2",
|
|
4
4
|
"description": "Command-line interface for Kindgi™ — the sovereign AI OS. Create a pack, run it on your machine (`kindgi dev`), build, sign and deploy it, and work with a running Kindgi API from the terminal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -37,15 +37,16 @@
|
|
|
37
37
|
"provenance": true
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@kindgi/client": "0.1.4-rc.
|
|
41
|
-
"@kindgi/dotenv-file": "0.1.4-rc.
|
|
42
|
-
"@kindgi/crypto": "0.1.4-rc.
|
|
43
|
-
"@kindgi/env-schema": "0.1.4-rc.
|
|
44
|
-
"@kindgi/
|
|
45
|
-
"@kindgi/
|
|
46
|
-
"@kindgi/
|
|
47
|
-
"@kindgi/
|
|
48
|
-
"@kindgi/
|
|
40
|
+
"@kindgi/client": "0.1.4-rc.2",
|
|
41
|
+
"@kindgi/dotenv-file": "0.1.4-rc.2",
|
|
42
|
+
"@kindgi/crypto": "0.1.4-rc.2",
|
|
43
|
+
"@kindgi/env-schema": "0.1.4-rc.2",
|
|
44
|
+
"@kindgi/flow": "0.1.4-rc.2",
|
|
45
|
+
"@kindgi/handler-runtime": "0.1.4-rc.2",
|
|
46
|
+
"@kindgi/secrets-dotenv": "0.1.4-rc.2",
|
|
47
|
+
"@kindgi/platform": "0.1.4-rc.2",
|
|
48
|
+
"@kindgi/sdk": "0.1.4-rc.2",
|
|
49
|
+
"@kindgi/types": "0.1.4-rc.2",
|
|
49
50
|
"esbuild": "^0.24.0",
|
|
50
51
|
"semver": "^7.8.5",
|
|
51
52
|
"smol-toml": "^1.9.0",
|