@kindgi/cli 0.1.2 → 0.1.3
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 +71 -9
- package/dist/build/containerfile.d.ts +1 -1
- package/dist/build/containerfile.d.ts.map +1 -1
- package/dist/build/containerfile.js +16 -2
- package/dist/build/containerfile.js.map +1 -1
- package/dist/build/defaults.d.ts.map +1 -1
- package/dist/build/defaults.js +10 -0
- package/dist/build/defaults.js.map +1 -1
- package/dist/build/host-install.d.ts +8 -0
- package/dist/build/host-install.d.ts.map +1 -1
- package/dist/build/host-install.js.map +1 -1
- package/dist/build/runners.d.ts +5 -0
- package/dist/build/runners.d.ts.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +34 -3
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +219 -40
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/env.js +1 -1
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/providers.d.ts.map +1 -1
- package/dist/commands/providers.js +10 -1
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/runs.d.ts.map +1 -1
- package/dist/commands/runs.js +27 -7
- package/dist/commands/runs.js.map +1 -1
- package/dist/deploy/post.d.ts.map +1 -1
- package/dist/deploy/post.js +4 -0
- package/dist/deploy/post.js.map +1 -1
- package/dist/deploy/response.d.ts.map +1 -1
- package/dist/deploy/response.js +30 -7
- package/dist/deploy/response.js.map +1 -1
- package/dist/deploy/runners.d.ts +8 -0
- package/dist/deploy/runners.d.ts.map +1 -1
- package/dist/dev/bundler.d.ts +21 -0
- package/dist/dev/bundler.d.ts.map +1 -1
- package/dist/dev/bundler.js +46 -18
- package/dist/dev/bundler.js.map +1 -1
- package/dist/dev/defaults.d.ts +11 -0
- package/dist/dev/defaults.d.ts.map +1 -1
- package/dist/dev/defaults.js +19 -6
- package/dist/dev/defaults.js.map +1 -1
- package/dist/dev/project-database.d.ts +68 -0
- package/dist/dev/project-database.d.ts.map +1 -0
- package/dist/dev/project-database.js +142 -0
- package/dist/dev/project-database.js.map +1 -0
- package/dist/dev/project.d.ts +59 -0
- package/dist/dev/project.d.ts.map +1 -0
- package/dist/dev/project.js +182 -0
- package/dist/dev/project.js.map +1 -0
- package/dist/dev/providers.d.ts +96 -0
- package/dist/dev/providers.d.ts.map +1 -0
- package/dist/dev/providers.js +406 -0
- package/dist/dev/providers.js.map +1 -0
- package/dist/dev/runners.d.ts +17 -0
- package/dist/dev/runners.d.ts.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/env/pack-env-plan.d.ts +7 -1
- package/dist/env/pack-env-plan.d.ts.map +1 -1
- package/dist/env/pack-env-plan.js +9 -3
- package/dist/env/pack-env-plan.js.map +1 -1
- package/dist/providers/preset-loader.d.ts +5 -0
- package/dist/providers/preset-loader.d.ts.map +1 -1
- package/dist/providers/preset-loader.js +9 -1
- package/dist/providers/preset-loader.js.map +1 -1
- package/dist/providers/presets/gemini.json +2 -1
- package/dist/runs/follow.d.ts +25 -0
- package/dist/runs/follow.d.ts.map +1 -0
- package/dist/runs/follow.js +48 -0
- package/dist/runs/follow.js.map +1 -0
- 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 +41 -6
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +3 -2
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +38 -6
- 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 +5 -1
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +44 -6
- package/dist/templates/minimal/AGENTS.md +4 -3
- package/dist/templates/python/AGENTS.md +5 -4
- package/dist/templates/sample/AGENTS.md +4 -3
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-loader.d.ts","sourceRoot":"","sources":["../../src/providers/preset-loader.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAClD,sEAAsE;IACtE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,KAAK,cAAc,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAIxD,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAC/D,QAAQ,CAAC,QAAQ,EAAE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CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAuCJ"}
|
|
@@ -84,7 +84,15 @@ export function presetRegistration(preset, choices) {
|
|
|
84
84
|
message: `preset "${preset.name}" has no model ${unknown.join(', ')} — it has ${all.map((m) => m.name).join(', ')}`,
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const chosen = choices.models === undefined ? all : all.filter((m) => choices.models?.includes(m.name));
|
|
88
|
+
const cap = choices.maxOutputTokens;
|
|
89
|
+
if (cap !== undefined && (!Number.isInteger(cap) || cap < 1)) {
|
|
90
|
+
return {
|
|
91
|
+
kind: 'err',
|
|
92
|
+
message: `--max-output-tokens must be a whole number of at least 1, got ${cap}`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const models = cap === undefined ? chosen : chosen.map((m) => ({ ...m, maxOutputTokens: cap }));
|
|
88
96
|
const missing = (preset.adapterConfig ?? []).filter((s) => choices.settings[s.key] === undefined);
|
|
89
97
|
if (missing.length > 0) {
|
|
90
98
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-loader.js","sourceRoot":"","sources":["../../src/providers/preset-loader.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAEjC;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA0BzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,UAAU,0BAA0B;IACxC,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC;AAOD,MAAM,UAAU,GAAa;IAC3B,OAAO,EAAE,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M,CAAC,SAAS;YAC5B,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;YACvF,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;SAChF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
{
|
|
18
18
|
"name": "gemini-2.5-pro",
|
|
19
19
|
"contextWindow": 1048576,
|
|
20
|
-
"maxOutputTokens":
|
|
20
|
+
"maxOutputTokens": 65536,
|
|
21
21
|
"features": ["tool-use"],
|
|
22
22
|
"cost": {
|
|
23
23
|
"promptUsdPer1kTokens": 0.00125,
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
"name": "gemini-2.5-flash",
|
|
34
34
|
"contextWindow": 1048576,
|
|
35
|
+
"maxOutputTokens": 65536,
|
|
35
36
|
"features": ["tool-use"],
|
|
36
37
|
"cost": { "promptUsdPer1kTokens": 0.0003, "completionUsdPer1kTokens": 0.0025 }
|
|
37
38
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kindgi runs start` waits for a run by following it, not by holding the
|
|
3
|
+
* start request open. The run starts in the background (`wait: false`), so
|
|
4
|
+
* its id is known at once, and the CLI reads it (`runs.get`) until it
|
|
5
|
+
* leaves `pending`/`running`: it finished, or it waits on an approval,
|
|
6
|
+
* where a waiting start used to answer. A long run no longer times out the
|
|
7
|
+
* start request with no id to follow it by: whatever stops the wait (the
|
|
8
|
+
* reads failing, Ctrl+C) says which run goes on, and how to look at it.
|
|
9
|
+
*/
|
|
10
|
+
import type { Run } from '@kindgi/client';
|
|
11
|
+
export interface FollowRunOptions {
|
|
12
|
+
/** Read the run by id (the client's `runs.get`). */
|
|
13
|
+
readonly get: (id: string) => Promise<Run>;
|
|
14
|
+
/** The pause before each read; tests pass `() => 0`. */
|
|
15
|
+
readonly pauseMs?: (read: number) => number;
|
|
16
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/** The command that shows a run, for the hints. */
|
|
19
|
+
export declare function runsGetHint(id: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* The run as it is when it stops being in progress. The fields only the
|
|
22
|
+
* start answer carries (the public run token) are kept.
|
|
23
|
+
*/
|
|
24
|
+
export declare function followRun(started: Run, options: FollowRunOptions): Promise<Run>;
|
|
25
|
+
//# sourceMappingURL=follow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follow.d.ts","sourceRoot":"","sources":["../../src/runs/follow.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAW1C,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,mDAAmD;AACnD,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBrF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Copyright (C) 2026 Kindgi Inc.
|
|
3
|
+
/** Statuses `runs start` waits through. */
|
|
4
|
+
const IN_PROGRESS = new Set(['pending', 'running']);
|
|
5
|
+
/** Pauses between reads: quick at first, then every 2 s. */
|
|
6
|
+
const PAUSES_MS = [250, 500, 1_000, 2_000];
|
|
7
|
+
/** Reads that fail in a row before the CLI stops following. */
|
|
8
|
+
const MAX_FAILED_READS = 5;
|
|
9
|
+
/** The command that shows a run, for the hints. */
|
|
10
|
+
export function runsGetHint(id) {
|
|
11
|
+
return `kindgi runs get ${id}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The run as it is when it stops being in progress. The fields only the
|
|
15
|
+
* start answer carries (the public run token) are kept.
|
|
16
|
+
*/
|
|
17
|
+
export async function followRun(started, options) {
|
|
18
|
+
if (!IN_PROGRESS.has(started.status))
|
|
19
|
+
return started;
|
|
20
|
+
const pauseMs = options.pauseMs ?? ((read) => PAUSES_MS[Math.min(read, PAUSES_MS.length - 1)] ?? 2_000);
|
|
21
|
+
const sleep = options.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
22
|
+
let failed = 0;
|
|
23
|
+
for (let read = 0;; read += 1) {
|
|
24
|
+
await sleep(pauseMs(read));
|
|
25
|
+
let current;
|
|
26
|
+
try {
|
|
27
|
+
current = await options.get(started.id);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
failed += 1;
|
|
31
|
+
if (failed >= MAX_FAILED_READS) {
|
|
32
|
+
throw new Error(`could not follow run ${started.id}: ${err.message}. The run goes on: ${runsGetHint(started.id)}`);
|
|
33
|
+
}
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
failed = 0;
|
|
37
|
+
if (!IN_PROGRESS.has(current.status))
|
|
38
|
+
return { ...startOnly(started), ...current };
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** The start answer's own fields, which a read of the run doesn't carry. */
|
|
42
|
+
function startOnly(started) {
|
|
43
|
+
const fields = started;
|
|
44
|
+
return Object.fromEntries(['publicAccessToken', 'publicAccessTokenExpiresAt']
|
|
45
|
+
.filter((key) => fields[key] !== undefined)
|
|
46
|
+
.map((key) => [key, fields[key]]));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=follow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follow.js","sourceRoot":"","sources":["../../src/runs/follow.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAcjC,2CAA2C;AAC3C,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzE,4DAA4D;AAC5D,MAAM,SAAS,GAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE9D,+DAA+D;AAC/D,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAU3B,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,mBAAmB,EAAE,EAAE,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAY,EAAE,OAAyB;IACrE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAC;IACrD,MAAM,OAAO,GACX,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC;IAClG,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,IAAI,MAAM,GAAG,CA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
|
25
|
-
version: "0.9.
|
|
26
|
-
sdk_version: "0.1.
|
|
25
|
+
version: "0.9.3"
|
|
26
|
+
sdk_version: "0.1.3"
|
|
27
27
|
pack_languages: [node, python]
|
|
28
28
|
sources:
|
|
29
29
|
- packages/adapters/model-anthropic/src/provider.ts
|
|
@@ -126,12 +126,46 @@ credential on argv.
|
|
|
126
126
|
kindgi providers register --preset=anthropic # Opus 5.5, Sonnet 5.5, Haiku 4.5
|
|
127
127
|
kindgi providers register --preset=anthropic --models=claude-haiku-4-5 # just one
|
|
128
128
|
```
|
|
129
|
-
The preset carries the models, context windows and current
|
|
130
|
-
(`kindgi providers presets` lists the presets and when their prices
|
|
131
|
-
checked). In a pack it refuses until the key is in the pack's env files —
|
|
129
|
+
The preset carries the models, context windows, output limits and current
|
|
130
|
+
prices (`kindgi providers presets` lists the presets and when their prices
|
|
131
|
+
were checked); `--max-output-tokens=<n>` sets another output limit. In a pack it refuses until the key is in the pack's env files —
|
|
132
132
|
step 1. That's all for Anthropic; go to step 4. The rest of this path is
|
|
133
133
|
the same registration by hand, for a spec of your own.
|
|
134
134
|
|
|
135
|
+
**Or declare it in the pack's config**, and `kindgi dev` registers it on
|
|
136
|
+
every boot: in every git worktree (each has its own dev database), after
|
|
137
|
+
`--reset`, and on a teammate's machine. Prefer this for any provider the pack
|
|
138
|
+
needs under `kindgi dev`:
|
|
139
|
+
```ts
|
|
140
|
+
// in kindgi.config.ts
|
|
141
|
+
providers: [
|
|
142
|
+
{ preset: 'anthropic', models: ['claude-haiku-4-5'] }, // key ANTHROPIC_API_KEY, from the env files
|
|
143
|
+
{ preset: 'gemini', project: 'acme-gcp', models: ['gemini-2.5-flash'] },
|
|
144
|
+
{ spec: { /* the provider.json body below */ } },
|
|
145
|
+
],
|
|
146
|
+
```
|
|
147
|
+
```toml
|
|
148
|
+
# in pyproject.toml: one table per provider, same keys
|
|
149
|
+
[[tool.kindgi.providers]]
|
|
150
|
+
preset = "anthropic"
|
|
151
|
+
models = ["claude-haiku-4-5"]
|
|
152
|
+
```
|
|
153
|
+
- A preset entry takes `models`, `project`, `secret` (the key's name, in place
|
|
154
|
+
of the preset's) and `maxOutputTokens`, spelled the same in `pyproject.toml`;
|
|
155
|
+
a `spec` entry is a `--spec` body. A
|
|
156
|
+
key is always a secret's name (`secret_ref`); a credential in
|
|
157
|
+
`adapter_config` is refused.
|
|
158
|
+
- Each boot prints `Providers from kindgi.config.ts:` with one line each:
|
|
159
|
+
`registered`, `unchanged`, `registered again (changed in kindgi.config.ts)`,
|
|
160
|
+
`unregistered (no longer in kindgi.config.ts)`, or ⚠ `not registered: <KEY>
|
|
161
|
+
is not in .env, .env.local` (set the key, then restart: the config isn't
|
|
162
|
+
watched).
|
|
163
|
+
- A provider with that id that `kindgi dev` didn't register is left as it is;
|
|
164
|
+
if its region or models differ, a ⚠ line names the
|
|
165
|
+
`kindgi providers unregister` that lets the config's version apply.
|
|
166
|
+
- A runtime `kindgi dev` doesn't run (staging, production) still gets its
|
|
167
|
+
providers with `kindgi providers register`.
|
|
168
|
+
|
|
135
169
|
**Step 2 (by hand) — write `provider.json`** at the pack root. One connection,
|
|
136
170
|
three models — matches how the Anthropic SDK actually works (the API
|
|
137
171
|
key is per-vendor; the model is per-call):
|
|
@@ -438,7 +472,7 @@ outside Google Cloud: put a service-account key (its JSON) in a secret
|
|
|
438
472
|
"name": "gemini-2.5-pro",
|
|
439
473
|
"contextWindow": 1048576,
|
|
440
474
|
"features": ["tool-use"],
|
|
441
|
-
"maxOutputTokens":
|
|
475
|
+
"maxOutputTokens": 65536,
|
|
442
476
|
"cost": {
|
|
443
477
|
"promptUsdPer1kTokens": 0.00125,
|
|
444
478
|
"completionUsdPer1kTokens": 0.01,
|
|
@@ -453,6 +487,7 @@ outside Google Cloud: put a service-account key (its JSON) in a secret
|
|
|
453
487
|
"name": "gemini-2.5-flash",
|
|
454
488
|
"contextWindow": 1048576,
|
|
455
489
|
"features": ["tool-use"],
|
|
490
|
+
"maxOutputTokens": 65536,
|
|
456
491
|
"cost": { "promptUsdPer1kTokens": 0.0003, "completionUsdPer1kTokens": 0.0025 }
|
|
457
492
|
}
|
|
458
493
|
]
|
|
@@ -13,7 +13,7 @@ description: >
|
|
|
13
13
|
type: core
|
|
14
14
|
library: "@kindgi/sdk"
|
|
15
15
|
version: "0.4.4"
|
|
16
|
-
sdk_version: "0.1.
|
|
16
|
+
sdk_version: "0.1.3"
|
|
17
17
|
pack_languages: [node]
|
|
18
18
|
sources:
|
|
19
19
|
- packages/tools/src/types.ts
|
|
@@ -88,7 +88,8 @@ const defined = defineTool({
|
|
|
88
88
|
effects: [],
|
|
89
89
|
mutating: false,
|
|
90
90
|
handler: async (input, ctx) => {
|
|
91
|
-
// ctx.tenantId, ctx.abortSignal, ctx.secrets (what needsSpec declares) available
|
|
91
|
+
// ctx.tenantId, ctx.abortSignal, ctx.secrets (what needsSpec declares) available;
|
|
92
|
+
// in a run, ctx.projectId and ctx.orgId (set from the run, never from the input)
|
|
92
93
|
// Return type MUST match Output schema (validated at invoke time)
|
|
93
94
|
return { found: true, canonicalCite: '...' };
|
|
94
95
|
},
|
|
@@ -14,8 +14,8 @@ description: >
|
|
|
14
14
|
primitive.
|
|
15
15
|
type: core
|
|
16
16
|
library: "@kindgi/sdk"
|
|
17
|
-
version: "0.3.
|
|
18
|
-
sdk_version: "0.1.
|
|
17
|
+
version: "0.3.7"
|
|
18
|
+
sdk_version: "0.1.3"
|
|
19
19
|
pack_languages: [node]
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -158,8 +158,11 @@ Most of the setup is automatable, but two require your knowledge:
|
|
|
158
158
|
- **Real LLM provider credentials** — the built-in dev-echo provider
|
|
159
159
|
returns canned responses (great for the loop test, useless for real
|
|
160
160
|
agents). It is a fallback, so it steps aside once a real provider is
|
|
161
|
-
registered
|
|
162
|
-
key in `.env
|
|
161
|
+
registered. Declare it in `kindgi.config.ts`
|
|
162
|
+
(`providers: [{ preset: 'anthropic' }]`, the key in `.env`) and `kindgi dev`
|
|
163
|
+
registers it on every boot, in every worktree and after `--reset`; or once,
|
|
164
|
+
by hand: `kindgi providers register --preset=anthropic`. See
|
|
165
|
+
`kindgi-authoring-providers`.
|
|
163
166
|
|
|
164
167
|
## Your app and Kindgi's data
|
|
165
168
|
|
|
@@ -189,8 +192,37 @@ const run = await kindgi.runs.start({
|
|
|
189
192
|
(`GET /v1/provenance/{runId}`). A flow run has none of its own: each agent
|
|
190
193
|
step's `step.completed` entry in the flow's journal names its turn's run
|
|
191
194
|
(`payload.output.runId`).
|
|
192
|
-
- **
|
|
193
|
-
|
|
195
|
+
- **What it cost:** `kindgi.cost.usage.query({ rootRunId: runId })`
|
|
196
|
+
(`GET /v1/cost/records?rootRunId={runId}`): `.items`, one record per model
|
|
197
|
+
call, with its `model`, `usage` (`promptTokens`, `completionTokens`) and
|
|
198
|
+
`costUsd` (a number, US dollars), a flow's agent steps included. For one
|
|
199
|
+
customer's spend, see below.
|
|
200
|
+
- **When a run finished:** the `run.finished` webhook (the run's id, its
|
|
201
|
+
outcome and its cost in `data.run.usage`; no output, so then `runs.get`),
|
|
202
|
+
not polling.
|
|
203
|
+
|
|
204
|
+
**One customer's spend:** give each customer an org, and start their runs in a
|
|
205
|
+
project of that org. Then one call sums their month:
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
import type { Timestamp } from '@kindgi/sdk/types';
|
|
209
|
+
|
|
210
|
+
// Once per customer. Project slugs are unique across the tenant: put the customer in them.
|
|
211
|
+
const org = await kindgi.orgs.create({ slug: 'acme-customer-one', name: 'Customer one' });
|
|
212
|
+
const project = await kindgi.projects.create({ orgId: org.id, slug: 'acme-customer-one-app', name: 'App' });
|
|
213
|
+
// save org.id and project.id on the customer's row; start their runs with projectId: project.id
|
|
214
|
+
|
|
215
|
+
const now = new Date();
|
|
216
|
+
const month = await kindgi.cost.usage.summary({
|
|
217
|
+
scope: { kind: 'org', orgId: org.id },
|
|
218
|
+
from: new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString() as Timestamp,
|
|
219
|
+
to: now.toISOString() as Timestamp, // exclusive
|
|
220
|
+
groupBy: ['month'],
|
|
221
|
+
});
|
|
222
|
+
// month.totalUsd; month.groups[i].key ({ month: '2026-10' }), .totalUsd, .tokens
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Docs: https://docs.kindgi.com/v0.1/guides/observability/cost-per-run/
|
|
194
226
|
|
|
195
227
|
Show it in the app's own UI. **Never:**
|
|
196
228
|
|
|
@@ -15,7 +15,7 @@ description: >
|
|
|
15
15
|
type: core
|
|
16
16
|
library: "kindgi (Python)"
|
|
17
17
|
version: "0.1.1"
|
|
18
|
-
sdk_version: "0.1.
|
|
18
|
+
sdk_version: "0.1.3"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
21
21
|
- sdks/python/src/kindgi/pack/define.py
|
|
@@ -103,6 +103,10 @@ def verify_citation(citation: Citation, ctx: ToolContext) -> Verdict:
|
|
|
103
103
|
- `ctx.run_id` — the run (an agent turn or a flow step) the call belongs to.
|
|
104
104
|
- `ctx.request_id` — this call, e.g. the model's tool-call id; useful
|
|
105
105
|
for logs and idempotency keys.
|
|
106
|
+
- `ctx.project_id`, `ctx.org_id` — the run's project, and that project's
|
|
107
|
+
org (`None` when it has none). The runtime sets them from the run, never
|
|
108
|
+
from the input: to check an org or project id the input names, compare
|
|
109
|
+
it with these instead of trusting it.
|
|
106
110
|
- `ctx.cancellation` — fires when the call's deadline passes or the
|
|
107
111
|
caller disconnects. An `async def` handler is also cancelled at its
|
|
108
112
|
next `await`. A `def` handler keeps running in its thread: check
|
|
@@ -14,8 +14,8 @@ description: >
|
|
|
14
14
|
kindgi-python-authoring-agents; models by kindgi-authoring-providers.
|
|
15
15
|
type: core
|
|
16
16
|
library: "kindgi (Python)"
|
|
17
|
-
version: "0.1.
|
|
18
|
-
sdk_version: "0.1.
|
|
17
|
+
version: "0.1.5"
|
|
18
|
+
sdk_version: "0.1.3"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
21
21
|
- sdks/python/README.md
|
|
@@ -129,8 +129,16 @@ kindgi secrets set ANTHROPIC_API_KEY --env=local --scope=tenant # no-echo prom
|
|
|
129
129
|
kindgi providers register --preset=anthropic
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
It takes over at the next turn.
|
|
133
|
-
`kindgi
|
|
132
|
+
It takes over at the next turn. That registration is in this project's dev
|
|
133
|
+
database only. To have `kindgi dev` register it on every boot, in every
|
|
134
|
+
worktree and after `--reset`, declare it in `pyproject.toml` instead:
|
|
135
|
+
|
|
136
|
+
```toml
|
|
137
|
+
[[tool.kindgi.providers]]
|
|
138
|
+
preset = "anthropic" # its key, ANTHROPIC_API_KEY, from the env files
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Details and other providers: `kindgi-authoring-providers`.
|
|
134
142
|
|
|
135
143
|
`uv run python -m kindgi.pack index --pack-dir .` prints what Kindgi
|
|
136
144
|
sees (the index); `kindgi dev` reports a broken file with its path and
|
|
@@ -198,8 +206,38 @@ then `run.id`). The app reads the rest through the API, server side, with
|
|
|
198
206
|
(`GET /v1/provenance/{runId}`). A flow run has none of its own: each agent
|
|
199
207
|
step's `step.completed` entry in the flow's journal names its turn's run
|
|
200
208
|
(`entry.payload["output"]["runId"]`).
|
|
201
|
-
- **
|
|
202
|
-
|
|
209
|
+
- **What it cost:** `client.cost.records.list(root_run_id=run_id).data`
|
|
210
|
+
(`GET /v1/cost/records?rootRunId={runId}`): one record per model call,
|
|
211
|
+
with its `model`, `usage` (`prompt_tokens`, `completion_tokens`) and
|
|
212
|
+
`cost_usd` (a float, US dollars), a flow's agent steps included. For one
|
|
213
|
+
customer's spend, see below.
|
|
214
|
+
- **When a run finished:** the `run.finished` webhook (the run's id, its
|
|
215
|
+
outcome and its cost in `data.run.usage`; no output, so then `runs.get`),
|
|
216
|
+
not polling.
|
|
217
|
+
|
|
218
|
+
**One customer's spend:** give each customer an org, and start their runs in a
|
|
219
|
+
project of that org. Then one call sums their month:
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from datetime import datetime, timezone
|
|
223
|
+
|
|
224
|
+
# Once per customer. Project slugs are unique across the tenant: put the customer in them.
|
|
225
|
+
org = client.orgs.create(slug="acme-customer-one", name="Customer one")
|
|
226
|
+
project = client.projects.create(org_id=str(org.id), slug="acme-customer-one-app", name="App")
|
|
227
|
+
# save org.id and project.id on the customer's row; start their runs with project_id=project.id
|
|
228
|
+
|
|
229
|
+
now = datetime.now(timezone.utc)
|
|
230
|
+
month = client.cost.aggregate(
|
|
231
|
+
group_by="month",
|
|
232
|
+
scope_kind="org",
|
|
233
|
+
scope_id=str(org.id),
|
|
234
|
+
from_=now.replace(day=1, hour=0, minute=0, second=0, microsecond=0).isoformat(),
|
|
235
|
+
to=now.isoformat(), # exclusive
|
|
236
|
+
)
|
|
237
|
+
# month.total_usd; month.groups[i].key ({"month": "2026-10"}), .total_usd, .tokens
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Docs: https://docs.kindgi.com/v0.1/guides/observability/cost-per-run/
|
|
203
241
|
|
|
204
242
|
Show it in the app's own UI. **Never:**
|
|
205
243
|
|
|
@@ -8,9 +8,10 @@ the full CLI.
|
|
|
8
8
|
|
|
9
9
|
Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
10
10
|
`dev-echo`, a fallback that calls the first tool and replies
|
|
11
|
-
"Tool responded: …" while no other provider fits. For Claude
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"Tool responded: …" while no other provider fits. For Claude,
|
|
12
|
+
put the key in `.env` and declare `{ preset: 'anthropic' }` in
|
|
13
|
+
`kindgi.config.ts`'s `providers`: `kindgi dev` then registers it on every
|
|
14
|
+
boot, in every worktree. Other providers and per-agent model choice:
|
|
14
15
|
`.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
15
16
|
|
|
16
17
|
## For Claude Code sessions
|
|
@@ -12,10 +12,11 @@ starts with `_`. The config is `[tool.kindgi]` in `pyproject.toml`.
|
|
|
12
12
|
- `uv run python -m kindgi.pack index --pack-dir .` shows what Kindgi sees.
|
|
13
13
|
- Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
14
14
|
`dev-echo`, a fallback that calls the first tool and replies
|
|
15
|
-
"Tool responded: …" while no other provider fits. For Claude
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
"Tool responded: …" while no other provider fits. For Claude,
|
|
16
|
+
put the key in `.env` and add a `[[tool.kindgi.providers]]` table with
|
|
17
|
+
`preset = "anthropic"` to `pyproject.toml`: `kindgi dev` then registers it
|
|
18
|
+
on every boot, in every worktree. Other providers and per-agent model
|
|
19
|
+
choice: `.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
19
20
|
|
|
20
21
|
## Skills
|
|
21
22
|
|
|
@@ -8,9 +8,10 @@ the full CLI.
|
|
|
8
8
|
|
|
9
9
|
Agents answer through a model provider. `kindgi dev` gives a new pack
|
|
10
10
|
`dev-echo`, a fallback that calls the first tool and replies
|
|
11
|
-
"Tool responded: …" while no other provider fits. For Claude
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"Tool responded: …" while no other provider fits. For Claude,
|
|
12
|
+
put the key in `.env` and declare `{ preset: 'anthropic' }` in
|
|
13
|
+
`kindgi.config.ts`'s `providers`: `kindgi dev` then registers it on every
|
|
14
|
+
boot, in every worktree. Other providers and per-agent model choice:
|
|
14
15
|
`.claude/skills/kindgi-authoring-providers/SKILL.md`.
|
|
15
16
|
|
|
16
17
|
## For Claude Code sessions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindgi/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
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,15 @@
|
|
|
37
37
|
"provenance": true
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@kindgi/client": "0.1.
|
|
41
|
-
"@kindgi/dotenv-file": "0.1.
|
|
42
|
-
"@kindgi/crypto": "0.1.
|
|
43
|
-
"@kindgi/env-schema": "0.1.
|
|
44
|
-
"@kindgi/handler-runtime": "0.1.
|
|
45
|
-
"@kindgi/secrets-dotenv": "0.1.
|
|
46
|
-
"@kindgi/platform": "0.1.
|
|
47
|
-
"@kindgi/sdk": "0.1.
|
|
48
|
-
"@kindgi/types": "0.1.
|
|
40
|
+
"@kindgi/client": "0.1.3",
|
|
41
|
+
"@kindgi/dotenv-file": "0.1.3",
|
|
42
|
+
"@kindgi/crypto": "0.1.3",
|
|
43
|
+
"@kindgi/env-schema": "0.1.3",
|
|
44
|
+
"@kindgi/handler-runtime": "0.1.3",
|
|
45
|
+
"@kindgi/secrets-dotenv": "0.1.3",
|
|
46
|
+
"@kindgi/platform": "0.1.3",
|
|
47
|
+
"@kindgi/sdk": "0.1.3",
|
|
48
|
+
"@kindgi/types": "0.1.3",
|
|
49
49
|
"esbuild": "^0.24.0",
|
|
50
50
|
"semver": "^7.8.5",
|
|
51
51
|
"smol-toml": "^1.9.0",
|