@kindgi/cli 0.1.1 → 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 +87 -16
- 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 +3 -3
- package/dist/build/defaults.d.ts.map +1 -1
- package/dist/build/defaults.js +16 -9
- 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/python-image.d.ts +2 -0
- package/dist/build/python-image.d.ts.map +1 -1
- package/dist/build/python-image.js +12 -1
- package/dist/build/python-image.js.map +1 -1
- package/dist/build/runners.d.ts +11 -5
- package/dist/build/runners.d.ts.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +75 -43
- 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/key.d.ts.map +1 -1
- package/dist/commands/key.js +143 -11
- package/dist/commands/key.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 +9 -3
- 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 +15 -3
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +78 -4
- 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 +74 -5
- package/dist/templates/minimal/AGENTS.md +4 -3
- package/dist/templates/minimal/package.json.tmpl +1 -1
- package/dist/templates/python/AGENTS.md +5 -4
- package/dist/templates/sample/AGENTS.md +4 -3
- package/dist/templates/sample/package.json.tmpl +1 -1
- package/package.json +13 -12
|
@@ -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
|
|
@@ -26,7 +26,7 @@ sources:
|
|
|
26
26
|
# Getting started with Kindgi in Python
|
|
27
27
|
|
|
28
28
|
> **Running `kindgi`:** a Python pack has no Node project, so the
|
|
29
|
-
> `kindgi` CLI (a Node 22+ program) is the one on `PATH`. Python
|
|
29
|
+
> `kindgi` CLI (a Node 22.12+ program) is the one on `PATH`. Python
|
|
30
30
|
> commands run in the pack's environment: `uv run …`.
|
|
31
31
|
|
|
32
32
|
## What a pack is
|
|
@@ -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
|
|
@@ -182,6 +190,67 @@ for event in client.runs.stream(str(run.id)):
|
|
|
182
190
|
`AsyncKindgi` is the asyncio twin. `kindgi dev` prints the URL and the
|
|
183
191
|
token; `.kindgirc.json` in the pack holds them for the CLI.
|
|
184
192
|
|
|
193
|
+
## Your app and Kindgi's data
|
|
194
|
+
|
|
195
|
+
When the app keeps something a run did (a ticket a flow triaged, an answer
|
|
196
|
+
an agent gave), its own row stores the run's id, in a column such as
|
|
197
|
+
`kindgi_run_id` (`run = client.runs.start(flow=…, input=…, options={"wait": False})`,
|
|
198
|
+
then `run.id`). The app reads the rest through the API, server side, with
|
|
199
|
+
`Kindgi()` from `kindgi.client`:
|
|
200
|
+
|
|
201
|
+
- **Status, output, timing:** `client.runs.get(run_id)`
|
|
202
|
+
(`GET /v1/runs/{runId}`); status and timing only: `client.runs.progress(run_id)`.
|
|
203
|
+
- **The audit, step by step:** `client.runs.journal(run_id).data`
|
|
204
|
+
(`GET /v1/runs/{runId}/journal`).
|
|
205
|
+
- **Where an agent's answer came from:** `client.provenance.get(run_id)`
|
|
206
|
+
(`GET /v1/provenance/{runId}`). A flow run has none of its own: each agent
|
|
207
|
+
step's `step.completed` entry in the flow's journal names its turn's run
|
|
208
|
+
(`entry.payload["output"]["runId"]`).
|
|
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/
|
|
241
|
+
|
|
242
|
+
Show it in the app's own UI. **Never:**
|
|
243
|
+
|
|
244
|
+
- **query Kindgi's database**, even on the app's own Postgres server, and
|
|
245
|
+
never map its tables into the app's ORM (SQLAlchemy, Django models). Its
|
|
246
|
+
schema is private and changes with every release (migrations only go
|
|
247
|
+
forward), row-level security guards every tenant query, and a runtime
|
|
248
|
+
Kindgi hosts gives no database access.
|
|
249
|
+
- **link users to Kindgi's console** or any Kindgi UI for this data.
|
|
250
|
+
|
|
251
|
+
To keep a copy (reporting, search), pull it through the API into the app's
|
|
252
|
+
own tables. Docs: https://docs.kindgi.com/v0.1/guides/runs/show-runs-in-your-app/
|
|
253
|
+
|
|
185
254
|
## Build an image
|
|
186
255
|
|
|
187
256
|
`kindgi build --env=<name>` (an `[tool.kindgi.environments.<name>]`
|
|
@@ -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": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.js"
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
|
@@ -29,22 +30,22 @@
|
|
|
29
30
|
"README.md"
|
|
30
31
|
],
|
|
31
32
|
"engines": {
|
|
32
|
-
"node": ">=22.
|
|
33
|
+
"node": ">=22.12.0"
|
|
33
34
|
},
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public",
|
|
36
37
|
"provenance": true
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@kindgi/client": "0.1.
|
|
40
|
-
"@kindgi/dotenv-file": "0.1.
|
|
41
|
-
"@kindgi/crypto": "0.1.
|
|
42
|
-
"@kindgi/env-schema": "0.1.
|
|
43
|
-
"@kindgi/handler-runtime": "0.1.
|
|
44
|
-
"@kindgi/secrets-dotenv": "0.1.
|
|
45
|
-
"@kindgi/platform": "0.1.
|
|
46
|
-
"@kindgi/sdk": "0.1.
|
|
47
|
-
"@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",
|
|
48
49
|
"esbuild": "^0.24.0",
|
|
49
50
|
"semver": "^7.8.5",
|
|
50
51
|
"smol-toml": "^1.9.0",
|