@agentic-kit/harness 0.1.0 → 0.3.0

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 CHANGED
@@ -1,107 +1,93 @@
1
1
  # @agentic-kit/harness
2
2
 
3
- Host-agnostic core of the **Constructive harness** — the layer that turns a
4
- generic coding agent into a Constructive app builder. Code only: **no skills
5
- are bundled in this package**. Skills are pulled at runtime from
6
- [`constructive-skills`](https://github.com/constructive-io/constructive-skills)
7
- (plus optional overlays), so guidance stays fresh without a host release.
3
+ <p align="center" width="100%">
4
+ <img height="250" src="https://raw.githubusercontent.com/constructive-io/constructive/refs/heads/main/assets/outline-logo.svg" />
5
+ </p>
8
6
 
9
- Planning: [constructive-planning#1273](https://github.com/constructive-io/constructive-planning/issues/1273)
10
- (extraction) and [#1274](https://github.com/constructive-io/constructive-planning/issues/1274)
11
- (skills consolidation).
7
+ Give your coding agent a backend. `@agentic-kit/harness` is the host-neutral core of the **Constructive harness** — skills releases, confirm gating, and blueprint logic that turn a generic coding agent into a secure, full-stack app builder.
12
8
 
13
- ## Layering
14
-
15
- ```
16
- @agentic-kit/protocol → agentic-kit → @agentic-kit/agent (LLM/runtime substrate)
17
- ↓
18
- @agentic-kit/harness (this package)
19
- ↓
20
- pi/Electron desktop adapter | terminal CLI | MCP server | exports
9
+ ```bash
10
+ npm install @agentic-kit/harness
21
11
  ```
22
12
 
23
- Hosts inject a `HarnessContext` (cwd, endpoints, credentials, confirm gate);
24
- the core owns everything host-neutral.
25
-
26
- ## What's here today
27
-
28
- - `HarnessContext` / `HarnessCredentials` / `GateRequest` — the injection
29
- contracts identified in the desktop extraction research.
30
- - `harnessDirs()` — on-disk layout via [`appstash`](https://www.npmjs.com/package/appstash)
31
- (`~/.constructive/{config,cache,data,logs}` with XDG/tmp fallbacks):
32
- downloaded skill releases under `data/skills/<version>`, the merged tree
33
- under `cache/skills-materialized`, update-check metadata in `cache/`.
34
- - Release fetching + freshness:
35
- - `fetchSkillsRelease()` — resolves a pin (exact version, semver range, or
36
- dist-tag) against the npm registry, downloads the tarball, verifies its
37
- SRI integrity, and unpacks it to `data/skills/<version>/`. Already
38
- downloaded releases are reused without network (offline fallback;
39
- `latestLocalRelease()` picks the newest local one when the registry is
40
- unreachable).
41
- - `checkForSkillsUpdate()` — registry update check cached in
42
- `cache/skills-update-check.json` (TTL, default 24h); only recommends
43
- releases inside `compatibleSkillsRange`, and flags
44
- `harnessUpgradeRequired` when newer skills need newer tool code. Never
45
- throws — falls back to cache or "no update" offline.
46
- - Ordered-overlay skill resolution:
47
- - `SkillsManifest` — ordered source layers, each with its own version pin
48
- and include/exclude filters, plus `compatibleSkillsRange` so updaters
49
- never adopt a skills release the installed tool code doesn't support.
50
- - `DirectorySkillSource` — loads the agentskills.io layout
51
- (`<skill>/SKILL.md` + references/scripts).
52
- - `resolveSkills()` — last-write-wins merge across layers (hardened base →
53
- team overlays → private known-gaps overlay).
54
- - `materializeSkills()` — writes the merged tree with `{{VAR}}`
55
- substitution (e.g. `HARNESS_TEMPLATES_DIR`).
56
-
57
- - Tool-call gating (`src/gating/`, extracted from `constructive-desktop`):
58
- - `createConfirmGate()` — host-neutral confirm gate for the mutating db
59
- tools: per-run decline memory (a declined call re-issued with equivalent
60
- args is auto-blocked without re-prompting), runnable-project/token
61
- short-circuits, and blueprint/records/policy previews. Hosts inject a
62
- `GateHost` (confirm UI + skip notification); the pi adapter maps pi's
63
- `tool_call` extension event onto `GateToolCallEvent`/`GateResult` 1:1.
64
- - `buildConfirmPrompt()` / `MUTATING_DB_TOOLS` / `ConfirmPreview` — the
65
- per-tool confirmation copy and structured previews hosts render.
66
- - Blueprint domain logic (`src/blueprint/`): `expandBlueprintDefaults()`
67
- (derive Data* nodes, default grants, policy field defaults),
68
- `BlueprintDefinitionSchema` (typebox), field type/default parsing, and the
69
- vendored policy-provisioning config tables.
70
-
71
- ## Roadmap (per #1273)
72
-
73
- - Typed db-tools (`provision_database`, `provision_blueprint`, `run_codegen`,
74
- …) extracted from `constructive-desktop` against `HarnessContext` (needs
75
- the generated modules ORM published or generated in-package).
76
- - pi adapter, terminal CLI, and `.claude`/MCP export surfaces.
13
+ Code only: **no skills are bundled**. Skills are pulled at runtime from [`constructive-skills`](https://github.com/constructive-io/constructive-skills) (plus your overlays), so guidance stays fresh without a host release.
14
+
15
+ ## Features
16
+
17
+ - **Skill releases** — fetch a pinned release (npm version/range/dist-tag, or a git tag/semver/SHA/branch straight from GitHub), verified and cached under `~/.constructive/data/skills/<version>/`; offline falls back to the newest local release.
18
+ - **Ordered overlays** — layer skill sources (hardened base → team overlays → private known-gaps), last write wins by skill name, with include/exclude filters and transitive `requires:` expansion.
19
+ - **Confirm gating** — a host-neutral gate for mutating db tools: per-run decline memory (equivalent-args retries are auto-blocked), short-circuits for runnable projects, and structured previews your UI renders.
20
+ - **Blueprint logic** — `expandBlueprintDefaults()`, the zod `BlueprintZod`/JSON-Schema `BlueprintSchema`, field type/default parsing, and policy-provisioning tables.
21
+ - **Appstash state** — everything lives in the [`appstash`](https://www.npmjs.com/package/appstash) `~/.constructive/{config,cache,data,logs}` layout; project directories are untouched.
22
+
23
+ ## Quick start
77
24
 
78
25
  ```ts
79
26
  import {
80
27
  DirectorySkillSource,
28
+ fetchSkillsFromGit,
81
29
  harnessDirs,
82
30
  materializeSkills,
83
31
  resolveSkills,
84
32
  } from '@agentic-kit/harness';
85
33
 
86
34
  const dirs = harnessDirs();
35
+
36
+ const release = await fetchSkillsFromGit({
37
+ repo: 'constructive-io/constructive-skills',
38
+ pin: '^1.0.0',
39
+ skillsRoot: dirs.skillsRoot,
40
+ });
41
+
87
42
  const skills = await resolveSkills(
88
43
  {
89
- sources: [
90
- { name: 'constructive-skills', pin: '1.2.0' },
91
- { name: 'known-gaps', pin: 'abc1234' },
92
- ],
93
- compatibleSkillsRange: '^1.2.0',
44
+ sources: [{ name: 'constructive-skills' }, { name: 'my-overlay' }],
45
+ compatibleSkillsRange: '^1.0.0',
94
46
  },
95
47
  [
96
- new DirectorySkillSource('constructive-skills', dirs.skillsVersionDir('1.2.0')),
97
- new DirectorySkillSource('known-gaps', '/path/to/private/overlay'),
48
+ new DirectorySkillSource('constructive-skills', release.skillsDir),
49
+ new DirectorySkillSource('my-overlay', '/path/to/private/overlay'),
98
50
  ]
99
51
  );
52
+
100
53
  materializeSkills(dirs.materializedDir, skills, {
101
54
  templateVars: { HARNESS_TEMPLATES_DIR: '/path/to/templates' },
102
55
  });
103
56
  ```
104
57
 
58
+ ## API surface
59
+
60
+ - **Contracts** — `HarnessContext` / `HarnessCredentials` / `GateRequest`: hosts inject cwd, endpoints, credentials, and a confirm gate; the core owns everything host-neutral.
61
+ - **Dirs** — `harnessDirs()`: downloaded releases under `data/skills/<version>`, merged tree under `cache/skills-materialized`, update-check metadata in `cache/`.
62
+ - **Fetching** — `fetchSkillsRelease()` (npm), `fetchSkillsFromGit()` (GitHub tags/SHAs/branches via codeload tarballs), `latestLocalRelease()` (offline).
63
+ - **Freshness** — `checkForSkillsUpdate()` / `checkForSkillsUpdateFromGit()`: TTL-cached update checks that never throw, respect `compatibleSkillsRange`, and flag `harnessUpgradeRequired` when newer skills need newer tool code.
64
+ - **Resolution** — `SkillsManifest`, `DirectorySkillSource` (agentskills.io layout: `<skill>/SKILL.md` + references/scripts), `resolveSkills()`, `materializeSkills()` with `{{VAR}}` substitution.
65
+ - **Gating** — `createConfirmGate()`, `buildConfirmPrompt()`, `MUTATING_DB_TOOLS`, `ConfirmPreview`; adapters map host events onto `GateToolCallEvent`/`GateResult` 1:1.
66
+ - **Blueprints** — `expandBlueprintDefaults()`, `BlueprintZod`/`BlueprintSchema`, field types/defaults, policy provisioning.
67
+
68
+ ## Hosts
69
+
70
+ The same harness powers multiple hosts:
71
+
72
+ ```
73
+ @agentic-kit/protocol → agentic-kit → @agentic-kit/agent (LLM/runtime substrate)
74
+ ↓
75
+ @agentic-kit/harness (this package)
76
+ ↓
77
+ Constructive Desktop (Electron) | @agentic-kit/cli (`agent`) | your host
78
+ ```
79
+
80
+ ## Roadmap
81
+
82
+ - Typed db-tools (`provision_database`, `provision_blueprint`, `run_codegen`, …) extracted from Constructive Desktop against `HarnessContext`.
83
+ - Shared host adapter package and `.claude`/MCP export surfaces.
84
+
85
+ ## Related
86
+
87
+ - [`@agentic-kit/cli`](https://www.npmjs.com/package/@agentic-kit/cli) — `agent`, a local, secure-by-default coding agent built on this harness.
88
+ - [`agentic-kit`](https://www.npmjs.com/package/agentic-kit) — the umbrella package (chat + agent + harness).
89
+ - Planning: [constructive-planning#1273](https://github.com/constructive-io/constructive-planning/issues/1273), [#1274](https://github.com/constructive-io/constructive-planning/issues/1274), [#1277](https://github.com/constructive-io/constructive-planning/issues/1277).
90
+
105
91
  ---
106
92
 
107
93
  ## Education and Tutorials
@@ -1,138 +1,181 @@
1
- import { type Static, Type } from 'typebox';
2
- declare const FieldBlueprint: Type.TObject<{
3
- name: Type.TString;
4
- type: Type.TString;
5
- is_required: Type.TOptional<Type.TBoolean>;
6
- default: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
7
- }>;
8
- declare const PolicyBlueprint: Type.TObject<{
9
- $type: Type.TString;
10
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
11
- privileges: Type.TOptional<Type.TArray<Type.TString>>;
12
- policy_role: Type.TOptional<Type.TString>;
13
- permissive: Type.TOptional<Type.TBoolean>;
14
- }>;
15
- declare const NodeBlueprint: Type.TUnion<[Type.TString, Type.TObject<{
16
- $type: Type.TString;
17
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
18
- }>]>;
19
- declare const RelationBlueprint: Type.TUnion<[Type.TObject<{
20
- $type: Type.TLiteral<"RelationBelongsTo">;
21
- source_table: Type.TString;
22
- target_table: Type.TString;
23
- field_name: Type.TString;
24
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
25
- is_required: Type.TOptional<Type.TBoolean>;
26
- }>, Type.TObject<{
27
- $type: Type.TLiteral<"RelationManyToMany">;
28
- source_table: Type.TString;
29
- target_table: Type.TString;
30
- junction_table_name: Type.TString;
31
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
32
- }>]>;
33
- declare const TableBlueprint: Type.TObject<{
34
- table_name: Type.TString;
35
- nodes: Type.TOptional<Type.TArray<Type.TUnion<[Type.TString, Type.TObject<{
36
- $type: Type.TString;
37
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
38
- }>]>>>;
39
- fields: Type.TOptional<Type.TArray<Type.TObject<{
40
- name: Type.TString;
41
- type: Type.TString;
42
- is_required: Type.TOptional<Type.TBoolean>;
43
- default: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
44
- }>>>;
45
- policies: Type.TArray<Type.TObject<{
46
- $type: Type.TString;
47
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
48
- privileges: Type.TOptional<Type.TArray<Type.TString>>;
49
- policy_role: Type.TOptional<Type.TString>;
50
- permissive: Type.TOptional<Type.TBoolean>;
1
+ import { z } from 'zod';
2
+ declare const FieldBlueprintSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ type: z.ZodString;
5
+ is_required: z.ZodOptional<z.ZodBoolean>;
6
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
7
+ }, z.core.$strip>;
8
+ declare const PolicyBlueprintSchema: z.ZodObject<{
9
+ $type: z.ZodString;
10
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
11
+ privileges: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ policy_role: z.ZodOptional<z.ZodString>;
13
+ permissive: z.ZodOptional<z.ZodBoolean>;
14
+ }, z.core.$strip>;
15
+ declare const NodeBlueprintSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
16
+ $type: z.ZodString;
17
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
+ }, z.core.$strip>]>;
19
+ declare const RelationBlueprintSchema: z.ZodUnion<readonly [z.ZodObject<{
20
+ $type: z.ZodLiteral<"RelationBelongsTo">;
21
+ source_table: z.ZodString;
22
+ target_table: z.ZodString;
23
+ field_name: z.ZodString;
24
+ delete_action: z.ZodOptional<z.ZodEnum<{
25
+ c: "c";
26
+ r: "r";
27
+ n: "n";
28
+ a: "a";
29
+ d: "d";
51
30
  }>>;
52
- }>;
53
- export declare const BlueprintDefinitionSchema: Type.TObject<{
54
- tables: Type.TArray<Type.TObject<{
55
- table_name: Type.TString;
56
- nodes: Type.TOptional<Type.TArray<Type.TUnion<[Type.TString, Type.TObject<{
57
- $type: Type.TString;
58
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
59
- }>]>>>;
60
- fields: Type.TOptional<Type.TArray<Type.TObject<{
61
- name: Type.TString;
62
- type: Type.TString;
63
- is_required: Type.TOptional<Type.TBoolean>;
64
- default: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
65
- }>>>;
66
- policies: Type.TArray<Type.TObject<{
67
- $type: Type.TString;
68
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
69
- privileges: Type.TOptional<Type.TArray<Type.TString>>;
70
- policy_role: Type.TOptional<Type.TString>;
71
- permissive: Type.TOptional<Type.TBoolean>;
72
- }>>;
31
+ is_required: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strip>, z.ZodObject<{
33
+ $type: z.ZodLiteral<"RelationManyToMany">;
34
+ source_table: z.ZodString;
35
+ target_table: z.ZodString;
36
+ junction_table_name: z.ZodString;
37
+ delete_action: z.ZodOptional<z.ZodEnum<{
38
+ c: "c";
39
+ r: "r";
40
+ n: "n";
41
+ a: "a";
42
+ d: "d";
73
43
  }>>;
74
- relations: Type.TOptional<Type.TArray<Type.TUnion<[Type.TObject<{
75
- $type: Type.TLiteral<"RelationBelongsTo">;
76
- source_table: Type.TString;
77
- target_table: Type.TString;
78
- field_name: Type.TString;
79
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
80
- is_required: Type.TOptional<Type.TBoolean>;
81
- }>, Type.TObject<{
82
- $type: Type.TLiteral<"RelationManyToMany">;
83
- source_table: Type.TString;
84
- target_table: Type.TString;
85
- junction_table_name: Type.TString;
86
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
87
- }>]>>>;
88
- }>;
89
- export declare const BlueprintSchema: Type.TObject<{
90
- name: Type.TString;
91
- description: Type.TString;
92
- definition: Type.TObject<{
93
- tables: Type.TArray<Type.TObject<{
94
- table_name: Type.TString;
95
- nodes: Type.TOptional<Type.TArray<Type.TUnion<[Type.TString, Type.TObject<{
96
- $type: Type.TString;
97
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
98
- }>]>>>;
99
- fields: Type.TOptional<Type.TArray<Type.TObject<{
100
- name: Type.TString;
101
- type: Type.TString;
102
- is_required: Type.TOptional<Type.TBoolean>;
103
- default: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
104
- }>>>;
105
- policies: Type.TArray<Type.TObject<{
106
- $type: Type.TString;
107
- data: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
108
- privileges: Type.TOptional<Type.TArray<Type.TString>>;
109
- policy_role: Type.TOptional<Type.TString>;
110
- permissive: Type.TOptional<Type.TBoolean>;
111
- }>>;
44
+ }, z.core.$strip>]>;
45
+ declare const TableBlueprintSchema: z.ZodObject<{
46
+ table_name: z.ZodString;
47
+ nodes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
48
+ $type: z.ZodString;
49
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ }, z.core.$strip>]>>>;
51
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
52
+ name: z.ZodString;
53
+ type: z.ZodString;
54
+ is_required: z.ZodOptional<z.ZodBoolean>;
55
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
56
+ }, z.core.$strip>>>;
57
+ policies: z.ZodArray<z.ZodObject<{
58
+ $type: z.ZodString;
59
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
60
+ privileges: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
+ policy_role: z.ZodOptional<z.ZodString>;
62
+ permissive: z.ZodOptional<z.ZodBoolean>;
63
+ }, z.core.$strip>>;
64
+ }, z.core.$strip>;
65
+ export declare const BlueprintDefinitionZod: z.ZodObject<{
66
+ tables: z.ZodArray<z.ZodObject<{
67
+ table_name: z.ZodString;
68
+ nodes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
69
+ $type: z.ZodString;
70
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
71
+ }, z.core.$strip>]>>>;
72
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ name: z.ZodString;
74
+ type: z.ZodString;
75
+ is_required: z.ZodOptional<z.ZodBoolean>;
76
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
77
+ }, z.core.$strip>>>;
78
+ policies: z.ZodArray<z.ZodObject<{
79
+ $type: z.ZodString;
80
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
81
+ privileges: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
+ policy_role: z.ZodOptional<z.ZodString>;
83
+ permissive: z.ZodOptional<z.ZodBoolean>;
84
+ }, z.core.$strip>>;
85
+ }, z.core.$strip>>;
86
+ relations: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
87
+ $type: z.ZodLiteral<"RelationBelongsTo">;
88
+ source_table: z.ZodString;
89
+ target_table: z.ZodString;
90
+ field_name: z.ZodString;
91
+ delete_action: z.ZodOptional<z.ZodEnum<{
92
+ c: "c";
93
+ r: "r";
94
+ n: "n";
95
+ a: "a";
96
+ d: "d";
97
+ }>>;
98
+ is_required: z.ZodOptional<z.ZodBoolean>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ $type: z.ZodLiteral<"RelationManyToMany">;
101
+ source_table: z.ZodString;
102
+ target_table: z.ZodString;
103
+ junction_table_name: z.ZodString;
104
+ delete_action: z.ZodOptional<z.ZodEnum<{
105
+ c: "c";
106
+ r: "r";
107
+ n: "n";
108
+ a: "a";
109
+ d: "d";
112
110
  }>>;
113
- relations: Type.TOptional<Type.TArray<Type.TUnion<[Type.TObject<{
114
- $type: Type.TLiteral<"RelationBelongsTo">;
115
- source_table: Type.TString;
116
- target_table: Type.TString;
117
- field_name: Type.TString;
118
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
119
- is_required: Type.TOptional<Type.TBoolean>;
120
- }>, Type.TObject<{
121
- $type: Type.TLiteral<"RelationManyToMany">;
122
- source_table: Type.TString;
123
- target_table: Type.TString;
124
- junction_table_name: Type.TString;
125
- delete_action: Type.TOptional<Type.TUnion<[Type.TLiteral<"c">, Type.TLiteral<"r">, Type.TLiteral<"n">, Type.TLiteral<"a">, Type.TLiteral<"d">]>>;
126
- }>]>>>;
127
- }>;
128
- categories: Type.TOptional<Type.TArray<Type.TString>>;
129
- tags: Type.TOptional<Type.TArray<Type.TString>>;
130
- }>;
131
- export type Blueprint = Static<typeof BlueprintSchema>;
132
- export type BlueprintDefinition = Static<typeof BlueprintDefinitionSchema>;
133
- export type TableBlueprint = Static<typeof TableBlueprint>;
134
- export type FieldBlueprint = Static<typeof FieldBlueprint>;
135
- export type PolicyBlueprint = Static<typeof PolicyBlueprint>;
136
- export type RelationBlueprint = Static<typeof RelationBlueprint>;
137
- export type NodeBlueprint = Static<typeof NodeBlueprint>;
111
+ }, z.core.$strip>]>>>;
112
+ }, z.core.$strip>;
113
+ export declare const BlueprintZod: z.ZodObject<{
114
+ name: z.ZodString;
115
+ description: z.ZodString;
116
+ definition: z.ZodObject<{
117
+ tables: z.ZodArray<z.ZodObject<{
118
+ table_name: z.ZodString;
119
+ nodes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
120
+ $type: z.ZodString;
121
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
122
+ }, z.core.$strip>]>>>;
123
+ fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
+ name: z.ZodString;
125
+ type: z.ZodString;
126
+ is_required: z.ZodOptional<z.ZodBoolean>;
127
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
128
+ }, z.core.$strip>>>;
129
+ policies: z.ZodArray<z.ZodObject<{
130
+ $type: z.ZodString;
131
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
132
+ privileges: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ policy_role: z.ZodOptional<z.ZodString>;
134
+ permissive: z.ZodOptional<z.ZodBoolean>;
135
+ }, z.core.$strip>>;
136
+ }, z.core.$strip>>;
137
+ relations: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
138
+ $type: z.ZodLiteral<"RelationBelongsTo">;
139
+ source_table: z.ZodString;
140
+ target_table: z.ZodString;
141
+ field_name: z.ZodString;
142
+ delete_action: z.ZodOptional<z.ZodEnum<{
143
+ c: "c";
144
+ r: "r";
145
+ n: "n";
146
+ a: "a";
147
+ d: "d";
148
+ }>>;
149
+ is_required: z.ZodOptional<z.ZodBoolean>;
150
+ }, z.core.$strip>, z.ZodObject<{
151
+ $type: z.ZodLiteral<"RelationManyToMany">;
152
+ source_table: z.ZodString;
153
+ target_table: z.ZodString;
154
+ junction_table_name: z.ZodString;
155
+ delete_action: z.ZodOptional<z.ZodEnum<{
156
+ c: "c";
157
+ r: "r";
158
+ n: "n";
159
+ a: "a";
160
+ d: "d";
161
+ }>>;
162
+ }, z.core.$strip>]>>>;
163
+ }, z.core.$strip>;
164
+ categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ }, z.core.$strip>;
167
+ /**
168
+ * JSON Schema objects for hosts that hand tool parameter schemas to an agent
169
+ * runtime (e.g. pi's `ToolDefinition.parameters`). Same shapes the previous
170
+ * typebox exports produced.
171
+ */
172
+ export declare const BlueprintDefinitionSchema: Record<string, unknown>;
173
+ export declare const BlueprintSchema: Record<string, unknown>;
174
+ export type Blueprint = z.infer<typeof BlueprintZod>;
175
+ export type BlueprintDefinition = z.infer<typeof BlueprintDefinitionZod>;
176
+ export type TableBlueprint = z.infer<typeof TableBlueprintSchema>;
177
+ export type FieldBlueprint = z.infer<typeof FieldBlueprintSchema>;
178
+ export type PolicyBlueprint = z.infer<typeof PolicyBlueprintSchema>;
179
+ export type RelationBlueprint = z.infer<typeof RelationBlueprintSchema>;
180
+ export type NodeBlueprint = z.infer<typeof NodeBlueprintSchema>;
138
181
  export {};