@kindgi/sdk 0.1.1 → 0.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindgi/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "@kindgi/sdk — the authoring SDK for Kindgi™. Facade over the individual @kindgi/* packages + @kindgi/client. Unifies pack authoring (defineTool / defineCheck / defineAgent / defineFlow) and client callsites (createClient) behind three sub-paths: /define, /client, /types. Re-export facade; zero behavior.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -18,27 +18,33 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
"./define": {
|
|
20
20
|
"types": "./dist/define.d.ts",
|
|
21
|
-
"import": "./dist/define.js"
|
|
21
|
+
"import": "./dist/define.js",
|
|
22
|
+
"default": "./dist/define.js"
|
|
22
23
|
},
|
|
23
24
|
"./client": {
|
|
24
25
|
"types": "./dist/client.d.ts",
|
|
25
|
-
"import": "./dist/client.js"
|
|
26
|
+
"import": "./dist/client.js",
|
|
27
|
+
"default": "./dist/client.js"
|
|
26
28
|
},
|
|
27
29
|
"./types": {
|
|
28
30
|
"types": "./dist/types.d.ts",
|
|
29
|
-
"import": "./dist/types.js"
|
|
31
|
+
"import": "./dist/types.js",
|
|
32
|
+
"default": "./dist/types.js"
|
|
30
33
|
},
|
|
31
34
|
"./webhooks": {
|
|
32
35
|
"types": "./dist/webhooks.d.ts",
|
|
33
|
-
"import": "./dist/webhooks.js"
|
|
36
|
+
"import": "./dist/webhooks.js",
|
|
37
|
+
"default": "./dist/webhooks.js"
|
|
34
38
|
},
|
|
35
39
|
"./build": {
|
|
36
40
|
"types": "./dist/build.d.ts",
|
|
37
|
-
"import": "./dist/build.js"
|
|
41
|
+
"import": "./dist/build.js",
|
|
42
|
+
"default": "./dist/build.js"
|
|
38
43
|
},
|
|
39
44
|
".": {
|
|
40
45
|
"types": "./dist/index.d.ts",
|
|
41
|
-
"import": "./dist/index.js"
|
|
46
|
+
"import": "./dist/index.js",
|
|
47
|
+
"default": "./dist/index.js"
|
|
42
48
|
},
|
|
43
49
|
"./package.json": "./package.json"
|
|
44
50
|
},
|
|
@@ -49,15 +55,15 @@
|
|
|
49
55
|
"README.md"
|
|
50
56
|
],
|
|
51
57
|
"dependencies": {
|
|
52
|
-
"@kindgi/agents": "0.1.
|
|
53
|
-
"@kindgi/client": "0.1.
|
|
54
|
-
"@kindgi/crypto": "0.1.
|
|
55
|
-
"@kindgi/flow": "0.1.
|
|
56
|
-
"@kindgi/guardrails": "0.1.
|
|
57
|
-
"@kindgi/handler-runtime": "0.1.
|
|
58
|
-
"@kindgi/schema": "0.1.
|
|
59
|
-
"@kindgi/tools": "0.1.
|
|
60
|
-
"@kindgi/types": "0.1.
|
|
58
|
+
"@kindgi/agents": "0.1.2",
|
|
59
|
+
"@kindgi/client": "0.1.2",
|
|
60
|
+
"@kindgi/crypto": "0.1.2",
|
|
61
|
+
"@kindgi/flow": "0.1.2",
|
|
62
|
+
"@kindgi/guardrails": "0.1.2",
|
|
63
|
+
"@kindgi/handler-runtime": "0.1.2",
|
|
64
|
+
"@kindgi/schema": "0.1.2",
|
|
65
|
+
"@kindgi/tools": "0.1.2",
|
|
66
|
+
"@kindgi/types": "0.1.2"
|
|
61
67
|
},
|
|
62
68
|
"peerDependencies": {
|
|
63
69
|
"zod": "^4.0.0"
|
|
@@ -75,7 +81,7 @@
|
|
|
75
81
|
"vitest": "^2.1.8"
|
|
76
82
|
},
|
|
77
83
|
"engines": {
|
|
78
|
-
"node": ">=22.
|
|
84
|
+
"node": ">=22.12.0"
|
|
79
85
|
},
|
|
80
86
|
"publishConfig": {
|
|
81
87
|
"access": "public",
|
|
@@ -107,11 +107,17 @@ How the pack tooling reads this file:
|
|
|
107
107
|
`configZod`, `configSchema` or `configJsonSchema`, or a top-level
|
|
108
108
|
`configZod` / `configSchema`), and the declaration's `config` — what
|
|
109
109
|
the check runs with. It does not record `description`, `budget` or
|
|
110
|
-
`judgeCapabilities`.
|
|
110
|
+
`judgeCapabilities`. It checks `config` (none counts as `{}`) against
|
|
111
|
+
the config schema: a config that doesn't fit, or a required field with
|
|
112
|
+
no default left out, is a file error naming where, and `kindgi build`
|
|
113
|
+
refuses the pack.
|
|
111
114
|
- The **pack service** loads the same module to run the check. It uses
|
|
112
115
|
the module's `evaluate` export, or the `default` / `check` export when
|
|
113
116
|
that is a function or has an `evaluate` method — here, the named
|
|
114
|
-
`check` export.
|
|
117
|
+
`check` export. A `defineCheck` check's `evaluate` gets the config its
|
|
118
|
+
schema resolves: the schema's defaults applied (a guardrail that
|
|
119
|
+
declares no config gets them all), and a config that doesn't fit
|
|
120
|
+
refused, naming where.
|
|
115
121
|
|
|
116
122
|
## Validating a declaration in-process
|
|
117
123
|
|
|
@@ -12,7 +12,7 @@ description: >
|
|
|
12
12
|
authoring agents is covered by kindgi-authoring-agents.
|
|
13
13
|
type: core
|
|
14
14
|
library: "@kindgi/sdk"
|
|
15
|
-
version: "0.4.
|
|
15
|
+
version: "0.4.4"
|
|
16
16
|
sdk_version: "0.0.0"
|
|
17
17
|
pack_languages: [node]
|
|
18
18
|
sources:
|
|
@@ -278,6 +278,17 @@ run start via `semver.maxSatisfying`. No implicit `:latest`.
|
|
|
278
278
|
("⚠ The pack imports @prisma/client (in kindgi/tools/…), which
|
|
279
279
|
package.json lists only in devDependencies: …"), and `kindgi build`
|
|
280
280
|
refuses the pack until it moves.
|
|
281
|
+
10. **A tool that needs the app's install scripts in the image.** The
|
|
282
|
+
image installs with scripts off, so the app's `postinstall` /
|
|
283
|
+
`prepare` (`prisma generate`, husky) don't run there; `kindgi build`
|
|
284
|
+
lists them ("✓ The app's own install scripts don't run in the image:
|
|
285
|
+
…"). A tool that uses Prisma's client then fails the build ("@prisma/client
|
|
286
|
+
did not initialize yet"). Add `prisma({ schema: 'prisma/schema.prisma' })`
|
|
287
|
+
(from `@kindgi/sdk/build`; add `config: 'prisma.config.ts'` when the app
|
|
288
|
+
has one) to `image.extensions` in `kindgi.config.ts`. Other generate
|
|
289
|
+
steps: `defineBuildExtension({ name, contextFiles, postInstall: [{ bin, args }] })`.
|
|
290
|
+
Debian packages: `image.systemPackages`. Placeholder env for those steps:
|
|
291
|
+
`image.buildEnv` (never secrets).
|
|
281
292
|
|
|
282
293
|
## References
|
|
283
294
|
|
|
@@ -14,7 +14,7 @@ description: >
|
|
|
14
14
|
primitive.
|
|
15
15
|
type: core
|
|
16
16
|
library: "@kindgi/sdk"
|
|
17
|
-
version: "0.3.
|
|
17
|
+
version: "0.3.5"
|
|
18
18
|
sdk_version: "0.0.0"
|
|
19
19
|
pack_languages: [node]
|
|
20
20
|
---
|
|
@@ -161,6 +161,48 @@ Most of the setup is automatable, but two require your knowledge:
|
|
|
161
161
|
registered — `kindgi providers register --preset=anthropic` with the
|
|
162
162
|
key in `.env`; see `kindgi-authoring-providers`.
|
|
163
163
|
|
|
164
|
+
## Your app and Kindgi's data
|
|
165
|
+
|
|
166
|
+
When the app keeps something a run did (a ticket a flow triaged, an answer
|
|
167
|
+
an agent gave), its own row stores the run's id, in a column such as
|
|
168
|
+
`kindgi_run_id`. The app starts the run and reads the rest through the API,
|
|
169
|
+
server side, with `createClient()` from `@kindgi/sdk/client`:
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { createClient } from '@kindgi/sdk/client';
|
|
173
|
+
|
|
174
|
+
const kindgi = createClient(); // KINDGI_API_URL + KINDGI_API_TOKEN
|
|
175
|
+
const run = await kindgi.runs.start({
|
|
176
|
+
flow: 'my-pack.triage-ticket',
|
|
177
|
+
input: { ticketId },
|
|
178
|
+
options: { wait: false }, // the run id now; run.finished tells you when it ends
|
|
179
|
+
});
|
|
180
|
+
// save run.id as the ticket's kindgi_run_id
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
- **Status, output, timing:** `kindgi.runs.get(runId)`
|
|
185
|
+
(`GET /v1/runs/{runId}`); status and timing only: `kindgi.runs.progress(runId)`.
|
|
186
|
+
- **The audit, step by step:** `kindgi.runs.journal(runId)`
|
|
187
|
+
(`GET /v1/runs/{runId}/journal`).
|
|
188
|
+
- **Where an agent's answer came from:** `kindgi.provenance.get(runId)`
|
|
189
|
+
(`GET /v1/provenance/{runId}`). A flow run has none of its own: each agent
|
|
190
|
+
step's `step.completed` entry in the flow's journal names its turn's run
|
|
191
|
+
(`payload.output.runId`).
|
|
192
|
+
- **When a run finished:** the `run.finished` webhook (the run's id and
|
|
193
|
+
outcome, no output; then `runs.get`), not polling.
|
|
194
|
+
|
|
195
|
+
Show it in the app's own UI. **Never:**
|
|
196
|
+
|
|
197
|
+
- **query Kindgi's database**, even on the app's own Postgres server, and
|
|
198
|
+
never map its tables into the app's ORM. Its schema is private and changes
|
|
199
|
+
with every release (migrations only go forward), row-level security guards
|
|
200
|
+
every tenant query, and a runtime Kindgi hosts gives no database access.
|
|
201
|
+
- **link users to Kindgi's console** or any Kindgi UI for this data.
|
|
202
|
+
|
|
203
|
+
To keep a copy (reporting, search), pull it through the API into the app's
|
|
204
|
+
own tables. Docs: https://docs.kindgi.com/v0.1/guides/runs/show-runs-in-your-app/
|
|
205
|
+
|
|
164
206
|
## References
|
|
165
207
|
|
|
166
208
|
- Full CLI surface: `kindgi --help`.
|
|
@@ -14,7 +14,7 @@ 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.
|
|
17
|
+
version: "0.1.3"
|
|
18
18
|
sdk_version: "0.0.0"
|
|
19
19
|
pack_languages: [python]
|
|
20
20
|
sources:
|
|
@@ -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
|
|
@@ -182,6 +182,37 @@ for event in client.runs.stream(str(run.id)):
|
|
|
182
182
|
`AsyncKindgi` is the asyncio twin. `kindgi dev` prints the URL and the
|
|
183
183
|
token; `.kindgirc.json` in the pack holds them for the CLI.
|
|
184
184
|
|
|
185
|
+
## Your app and Kindgi's data
|
|
186
|
+
|
|
187
|
+
When the app keeps something a run did (a ticket a flow triaged, an answer
|
|
188
|
+
an agent gave), its own row stores the run's id, in a column such as
|
|
189
|
+
`kindgi_run_id` (`run = client.runs.start(flow=…, input=…, options={"wait": False})`,
|
|
190
|
+
then `run.id`). The app reads the rest through the API, server side, with
|
|
191
|
+
`Kindgi()` from `kindgi.client`:
|
|
192
|
+
|
|
193
|
+
- **Status, output, timing:** `client.runs.get(run_id)`
|
|
194
|
+
(`GET /v1/runs/{runId}`); status and timing only: `client.runs.progress(run_id)`.
|
|
195
|
+
- **The audit, step by step:** `client.runs.journal(run_id).data`
|
|
196
|
+
(`GET /v1/runs/{runId}/journal`).
|
|
197
|
+
- **Where an agent's answer came from:** `client.provenance.get(run_id)`
|
|
198
|
+
(`GET /v1/provenance/{runId}`). A flow run has none of its own: each agent
|
|
199
|
+
step's `step.completed` entry in the flow's journal names its turn's run
|
|
200
|
+
(`entry.payload["output"]["runId"]`).
|
|
201
|
+
- **When a run finished:** the `run.finished` webhook (the run's id and
|
|
202
|
+
outcome, no output; then `runs.get`), not polling.
|
|
203
|
+
|
|
204
|
+
Show it in the app's own UI. **Never:**
|
|
205
|
+
|
|
206
|
+
- **query Kindgi's database**, even on the app's own Postgres server, and
|
|
207
|
+
never map its tables into the app's ORM (SQLAlchemy, Django models). Its
|
|
208
|
+
schema is private and changes with every release (migrations only go
|
|
209
|
+
forward), row-level security guards every tenant query, and a runtime
|
|
210
|
+
Kindgi hosts gives no database access.
|
|
211
|
+
- **link users to Kindgi's console** or any Kindgi UI for this data.
|
|
212
|
+
|
|
213
|
+
To keep a copy (reporting, search), pull it through the API into the app's
|
|
214
|
+
own tables. Docs: https://docs.kindgi.com/v0.1/guides/runs/show-runs-in-your-app/
|
|
215
|
+
|
|
185
216
|
## Build an image
|
|
186
217
|
|
|
187
218
|
`kindgi build --env=<name>` (an `[tool.kindgi.environments.<name>]`
|