@kindgi/specs 0.1.3 → 0.1.4-rc.1

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/specs",
3
- "version": "0.1.3",
3
+ "version": "0.1.4-rc.1",
4
4
  "description": "Canonical JSON Schemas (Draft 2020-12) for every Kindgi artifact kind — flow, agent, tool, capability, guardrail, policy, event, run event, memory, provenance, pack, compliance evidence, audit bundle, eval suite, discoverable entity. The wire contracts every SDK, runtime, and external tool validates against. Each schema is importable by name as `@kindgi/specs/<name>.schema.json`.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,9 +37,17 @@
37
37
  "description": "Prose describing what the agent does. Shown in catalog + provenance metadata."
38
38
  },
39
39
  "instructions": {
40
- "type": "string",
41
- "minLength": 1,
42
- "description": "System-prompt rendered at the top of every turn. LiquidJS template — {{ variable }} substitution, {% if %} / {% for %} control flow, {{ value | filter }} filters. Every referenced variable must be a declared PromptParameter or a framework auto-var (today, now, agent.*, conversation.*). Rendered with strictVariables — unresolved refs are hard errors."
40
+ "oneOf": [{ "type": "string", "minLength": 1 }, { "$ref": "#/$defs/PromptRef" }],
41
+ "description": "System-prompt rendered at the top of every turn. LiquidJS template — {{ variable }} substitution, {% if %} / {% for %} control flow, {{ value | filter }} filters. Every referenced variable must be a declared PromptParameter or a framework auto-var (today, now, agent.*, conversation.*, settings). Rendered with strictVariables — unresolved refs are hard errors. Or a prompt block by range ({ prompt, version }): its template and parameters are used instead, at the version pinned when the agent version is published."
42
+ },
43
+ "settings": {
44
+ "type": "array",
45
+ "items": { "$ref": "#/$defs/BlockRef" },
46
+ "description": "Settings blocks the agent reads, by range: tools read them as ToolContext.settings['<id>'], templates as settings[\"<id>\"]. Pinned when the agent version is published."
47
+ },
48
+ "modelSettings": {
49
+ "$ref": "#/$defs/BlockRef",
50
+ "description": "A model-settings block by range: its temperature and maxOutputTokens go into the turn's model calls. Pinned when the agent version is published."
43
51
  },
44
52
  "parameters": {
45
53
  "type": "array",
@@ -91,6 +99,24 @@
91
99
  "toolErrors": { "$ref": "#/$defs/ToolErrorsSpec" }
92
100
  },
93
101
  "$defs": {
102
+ "PromptRef": {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["prompt", "version"],
106
+ "properties": {
107
+ "prompt": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)+$" },
108
+ "version": { "type": "string", "minLength": 1, "description": "A semver range." }
109
+ }
110
+ },
111
+ "BlockRef": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["id", "version"],
115
+ "properties": {
116
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*(?:\\.[a-z0-9][a-z0-9-]*)+$" },
117
+ "version": { "type": "string", "minLength": 1, "description": "A semver range." }
118
+ }
119
+ },
94
120
  "ToolErrorsSpec": {
95
121
  "type": "object",
96
122
  "additionalProperties": false,
@@ -217,7 +217,19 @@
217
217
  "id": { "type": "string", "minLength": 1 },
218
218
  "version": { "type": "string", "minLength": 1 },
219
219
  "name": { "type": "string" },
220
- "instructions": { "type": "string" },
220
+ "instructions": {
221
+ "oneOf": [
222
+ { "type": "string" },
223
+ {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["prompt", "version"],
227
+ "properties": { "prompt": { "type": "string" }, "version": { "type": "string" } }
228
+ }
229
+ ]
230
+ },
231
+ "settings": { "type": "array" },
232
+ "modelSettings": { "type": "object" },
221
233
  "capabilities": { "type": "array" },
222
234
  "tools": {
223
235
  "type": "array",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://kindgi.com/schemas/v1/pack-protocol.schema.json",
4
- "$comment": "schema-version: 2.3.0",
4
+ "$comment": "schema-version: 2.4.0",
5
5
  "title": "Pack protocol",
6
6
  "description": "Pack protocol v2 — the messages a runtime exchanges with a pack service to run pack code (tool handlers and guardrail checks). One request, one response. Transport (HTTP): `POST /v1/invoke` takes a request and answers 200 with a response; `GET /v1/info` (token) answers `info`; `GET /healthz` (no token) answers 200 while the process is up; `GET /readyz` (no token) answers 200 once every module the index names has loaded and the service isn't draining. Headers: `kindgi-pack-token` (required on `/v1/invoke` and `/v1/info`; `Authorization` is deliberately not used, since platforms like Cloud Run put their own identity token there), `kindgi-timeout-ms` (relative deadline; default 120000), `kindgi-run-id`, `kindgi-request-id`, `kindgi-protocol`; the answer to an invoke carries `kindgi-duration-ms` and `kindgi-artifact-version`. Every outcome of running pack code is a response message with status 200 — a validation failure, a throw, an unknown tool, `deadline-exceeded`, `cancelled` (the caller closed the connection). Non-2xx statuses are transport-level only: 401 (bad token), 404, 405, 413 (body over 10 MiB), 415 (not `application/json`), 503 with `Retry-After` (not ready, draining, or at the concurrency cap — the call provably did not run), 500 (the service itself failed). Process contract: a pack service reads `--index`, `--module-root` and `--host` arguments, `KINDGI_PACK_SERVICE_TOKEN`, `PORT` (`0` picks a free port) and `KINDGI_PACK_SERVICE_MAX_CONCURRENCY`; it removes `KINDGI_PACK_SERVICE_TOKEN` from its process environment before it loads pack code, which never sees it; it loads every module before listening and exits 1 with a `{\"kind\":\"boot-failed\",\"problems\":[…]}` JSON line on stderr when one fails; once listening it writes `{\"kind\":\"listening\",\"port\":N,…}` on stderr; SIGTERM drains in-flight calls (up to 8 s; `/readyz` and new invokes answer 503 meanwhile) and exits 0.",
7
7
  "oneOf": [
@@ -49,7 +49,15 @@
49
49
  "description": "Resolved environment values for the call (open)."
50
50
  },
51
51
  "secrets": { "type": "object", "description": "Resolved secrets for the call (open)." },
52
- "config": { "type": "object", "description": "Resolved configuration for the call (open)." }
52
+ "config": {
53
+ "type": "object",
54
+ "description": "Resolved configuration for the call (open)."
55
+ },
56
+ "settings": {
57
+ "type": "object",
58
+ "additionalProperties": { "type": "object" },
59
+ "description": "The settings blocks the calling agent version pins: each block's values, by block id (protocol 2.4.0). Absent when it pins none, and from an older runtime."
60
+ }
53
61
  }
54
62
  },
55
63
  "toolInvoke": {