@intentic/sandbox-contract 1.422.0 → 1.423.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.
Files changed (190) hide show
  1. package/dist/chores/chores.d.ts.map +1 -1
  2. package/dist/chores/chores.js +1 -48
  3. package/dist/chores/chores.js.map +1 -1
  4. package/dist/chores/index.d.ts +1 -1
  5. package/dist/chores/index.d.ts.map +1 -1
  6. package/dist/chores/index.js +1 -1
  7. package/dist/chores/index.js.map +1 -1
  8. package/dist/chores/prompt.d.ts +0 -1
  9. package/dist/chores/prompt.d.ts.map +1 -1
  10. package/dist/chores/prompt.js +0 -2
  11. package/dist/chores/prompt.js.map +1 -1
  12. package/dist/contracts/capabilities.contract.d.ts +0 -28
  13. package/dist/contracts/capabilities.contract.d.ts.map +1 -1
  14. package/dist/contracts/issues.contract.d.ts +6 -0
  15. package/dist/contracts/issues.contract.d.ts.map +1 -1
  16. package/dist/contracts/offload.contract.d.ts +14 -14
  17. package/dist/contracts/panels.contract.d.ts +0 -7
  18. package/dist/contracts/panels.contract.d.ts.map +1 -1
  19. package/dist/contracts/runner.contract.d.ts +246 -246
  20. package/dist/contracts/secrets.contract.d.ts +2 -17
  21. package/dist/contracts/secrets.contract.d.ts.map +1 -1
  22. package/dist/contracts/secrets.contract.js +2 -2
  23. package/dist/contracts/secrets.contract.js.map +1 -1
  24. package/dist/contracts/settings.contract.d.ts +0 -135
  25. package/dist/contracts/settings.contract.d.ts.map +1 -1
  26. package/dist/contracts/system.contract.d.ts +18 -18
  27. package/dist/contracts/workspace.contract.d.ts +0 -60
  28. package/dist/contracts/workspace.contract.d.ts.map +1 -1
  29. package/dist/contracts/workspace.contract.js +1 -11
  30. package/dist/contracts/workspace.contract.js.map +1 -1
  31. package/dist/ids/project-id.d.ts +3 -0
  32. package/dist/ids/project-id.d.ts.map +1 -0
  33. package/dist/ids/project-id.js +25 -0
  34. package/dist/ids/project-id.js.map +1 -0
  35. package/dist/ids/tunnel-ids.d.ts +0 -1
  36. package/dist/ids/tunnel-ids.d.ts.map +1 -1
  37. package/dist/ids/tunnel-ids.js +0 -1
  38. package/dist/ids/tunnel-ids.js.map +1 -1
  39. package/dist/index.d.ts +0 -4
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +0 -4
  42. package/dist/index.js.map +1 -1
  43. package/dist/models/model-roles.d.ts +1 -1
  44. package/dist/models/model-roles.d.ts.map +1 -1
  45. package/dist/models/model-roles.js +1 -1
  46. package/dist/models/model-roles.js.map +1 -1
  47. package/dist/protocol/doors/sandbox-pass.d.ts +22 -0
  48. package/dist/protocol/doors/sandbox-pass.d.ts.map +1 -0
  49. package/dist/protocol/doors/sandbox-pass.js +72 -0
  50. package/dist/protocol/doors/sandbox-pass.js.map +1 -0
  51. package/dist/protocol/raw/raw-json-routes.d.ts +92 -9
  52. package/dist/protocol/raw/raw-json-routes.d.ts.map +1 -1
  53. package/dist/protocol/raw/raw-json-routes.js +6 -2
  54. package/dist/protocol/raw/raw-json-routes.js.map +1 -1
  55. package/dist/protocol/raw/raw-routes.d.ts +16 -7
  56. package/dist/protocol/raw/raw-routes.d.ts.map +1 -1
  57. package/dist/protocol/raw/raw-routes.js +4 -2
  58. package/dist/protocol/raw/raw-routes.js.map +1 -1
  59. package/dist/schemas/capabilities.d.ts +0 -14
  60. package/dist/schemas/capabilities.d.ts.map +1 -1
  61. package/dist/schemas/capabilities.js +0 -4
  62. package/dist/schemas/capabilities.js.map +1 -1
  63. package/dist/schemas/certificate-request.d.ts +0 -2
  64. package/dist/schemas/certificate-request.d.ts.map +1 -1
  65. package/dist/schemas/issues.d.ts +133 -0
  66. package/dist/schemas/issues.d.ts.map +1 -1
  67. package/dist/schemas/issues.js +34 -0
  68. package/dist/schemas/issues.js.map +1 -1
  69. package/dist/schemas/maintenance.d.ts.map +1 -1
  70. package/dist/schemas/maintenance.js +16 -10
  71. package/dist/schemas/maintenance.js.map +1 -1
  72. package/dist/schemas/metrics.d.ts.map +1 -1
  73. package/dist/schemas/metrics.js.map +1 -1
  74. package/dist/schemas/panels.d.ts +0 -14
  75. package/dist/schemas/panels.d.ts.map +1 -1
  76. package/dist/schemas/panels.js +0 -6
  77. package/dist/schemas/panels.js.map +1 -1
  78. package/dist/schemas/personas.d.ts.map +1 -1
  79. package/dist/schemas/personas.js +0 -6
  80. package/dist/schemas/personas.js.map +1 -1
  81. package/dist/schemas/providers/usage.d.ts +0 -12
  82. package/dist/schemas/providers/usage.d.ts.map +1 -1
  83. package/dist/schemas/providers/usage.js +0 -5
  84. package/dist/schemas/providers/usage.js.map +1 -1
  85. package/dist/schemas/secrets.d.ts +1 -22
  86. package/dist/schemas/secrets.d.ts.map +1 -1
  87. package/dist/schemas/secrets.js +3 -13
  88. package/dist/schemas/secrets.js.map +1 -1
  89. package/dist/schemas/settings-experiments.d.ts +0 -4
  90. package/dist/schemas/settings-experiments.d.ts.map +1 -1
  91. package/dist/schemas/settings-experiments.js +0 -12
  92. package/dist/schemas/settings-experiments.js.map +1 -1
  93. package/dist/schemas/settings-history.d.ts +1 -1
  94. package/dist/schemas/settings-history.d.ts.map +1 -1
  95. package/dist/schemas/settings-history.js +1 -0
  96. package/dist/schemas/settings-history.js.map +1 -1
  97. package/dist/schemas/settings-savings.d.ts +0 -144
  98. package/dist/schemas/settings-savings.d.ts.map +1 -1
  99. package/dist/schemas/settings-savings.js +1 -3
  100. package/dist/schemas/settings-savings.js.map +1 -1
  101. package/dist/schemas/settings.d.ts +0 -4
  102. package/dist/schemas/settings.d.ts.map +1 -1
  103. package/dist/schemas/settings.js +2 -3
  104. package/dist/schemas/settings.js.map +1 -1
  105. package/dist/schemas/short-codes.d.ts +0 -10
  106. package/dist/schemas/short-codes.d.ts.map +1 -1
  107. package/dist/schemas/short-codes.js +1 -9
  108. package/dist/schemas/short-codes.js.map +1 -1
  109. package/dist/schemas/workspace/workspace-search.d.ts +0 -12
  110. package/dist/schemas/workspace/workspace-search.d.ts.map +1 -1
  111. package/dist/schemas/workspace/workspace-search.js +5 -12
  112. package/dist/schemas/workspace/workspace-search.js.map +1 -1
  113. package/dist/state/definition.d.ts +0 -24
  114. package/dist/state/definition.d.ts.map +1 -1
  115. package/dist/state/update-probation.d.ts +1 -1
  116. package/dist/state/update-probation.d.ts.map +1 -1
  117. package/dist/state/update-probation.js +1 -1
  118. package/dist/state/update-probation.js.map +1 -1
  119. package/dist/state/workspace-state.d.ts +6 -1
  120. package/dist/state/workspace-state.d.ts.map +1 -1
  121. package/dist/state/workspace-state.js +7 -1
  122. package/dist/state/workspace-state.js.map +1 -1
  123. package/package.json +27 -5
  124. package/src/chores/chores.test.ts +1 -2
  125. package/src/chores/chores.ts +2 -62
  126. package/src/chores/index.ts +1 -1
  127. package/src/chores/prompt.ts +1 -6
  128. package/src/chores/verdict.test.ts +3 -44
  129. package/src/contracts/secrets.contract.ts +4 -5
  130. package/src/contracts/workspace.contract.ts +2 -14
  131. package/src/events/system-events.ts +2 -2
  132. package/src/ids/project-id.test.ts +26 -0
  133. package/src/ids/project-id.ts +34 -0
  134. package/src/ids/tunnel-ids.test.ts +2 -23
  135. package/src/ids/tunnel-ids.ts +0 -4
  136. package/src/index.ts +0 -6
  137. package/src/models/model-roles.ts +3 -1
  138. package/src/policy/persona-capability.ts +1 -1
  139. package/src/protocol/doors/sandbox-pass.test.ts +51 -0
  140. package/src/protocol/doors/sandbox-pass.ts +119 -0
  141. package/src/protocol/headers.ts +2 -2
  142. package/src/protocol/member-reach.test.ts +0 -1
  143. package/src/protocol/raw/raw-json-routes.ts +14 -2
  144. package/src/protocol/raw/raw-routes.ts +9 -5
  145. package/src/protocol/routes.test.ts +0 -4
  146. package/src/schemas/capabilities.ts +0 -6
  147. package/src/schemas/issues.ts +54 -0
  148. package/src/schemas/maintenance.ts +20 -12
  149. package/src/schemas/metrics.ts +2 -0
  150. package/src/schemas/panels.ts +0 -8
  151. package/src/schemas/personas.ts +2 -6
  152. package/src/schemas/providers/usage.ts +5 -14
  153. package/src/schemas/secrets.ts +8 -20
  154. package/src/schemas/settings-experiments.ts +0 -17
  155. package/src/schemas/settings-history.ts +3 -0
  156. package/src/schemas/settings-savings.ts +2 -9
  157. package/src/schemas/settings.test.ts +16 -9
  158. package/src/schemas/settings.ts +4 -4
  159. package/src/schemas/short-codes.ts +2 -14
  160. package/src/schemas/version-seam.test.ts +2 -2
  161. package/src/schemas/workspace/workspace-search.ts +12 -25
  162. package/src/state/update-probation.ts +4 -3
  163. package/src/state/workspace-state.test.ts +2 -2
  164. package/src/state/workspace-state.ts +10 -1
  165. package/src/text/path-refs.test.ts +1 -1
  166. package/dist/contracts/intentic.contract.d.ts +0 -30
  167. package/dist/contracts/intentic.contract.d.ts.map +0 -1
  168. package/dist/contracts/intentic.contract.js +0 -34
  169. package/dist/contracts/intentic.contract.js.map +0 -1
  170. package/dist/contracts/inventory.contract.d.ts +0 -138
  171. package/dist/contracts/inventory.contract.d.ts.map +0 -1
  172. package/dist/contracts/inventory.contract.js +0 -31
  173. package/dist/contracts/inventory.contract.js.map +0 -1
  174. package/dist/schemas/codebase-health.d.ts +0 -56
  175. package/dist/schemas/codebase-health.d.ts.map +0 -1
  176. package/dist/schemas/codebase-health.js +0 -43
  177. package/dist/schemas/codebase-health.js.map +0 -1
  178. package/dist/schemas/intentic.d.ts +0 -5
  179. package/dist/schemas/intentic.d.ts.map +0 -1
  180. package/dist/schemas/intentic.js +0 -3
  181. package/dist/schemas/intentic.js.map +0 -1
  182. package/dist/schemas/inventory.d.ts +0 -175
  183. package/dist/schemas/inventory.d.ts.map +0 -1
  184. package/dist/schemas/inventory.js +0 -62
  185. package/dist/schemas/inventory.js.map +0 -1
  186. package/src/contracts/intentic.contract.ts +0 -45
  187. package/src/contracts/inventory.contract.ts +0 -35
  188. package/src/schemas/codebase-health.ts +0 -60
  189. package/src/schemas/intentic.ts +0 -2
  190. package/src/schemas/inventory.ts +0 -83
@@ -1,35 +0,0 @@
1
- import { procedure } from "../protocol/route-meta.js";
2
- import { AddInventoryInputSchema, InventoryListSchema, InventoryNameParamSchema } from "../schemas/inventory.js";
3
-
4
- // The i.have.* / i.want.service entries in deploy.config.ts's managed region. add/remove rewrite the region and
5
- // commit it (mirroring an agent edit) and return the full updated list so the UI re-renders from one response.
6
- // Deploy-target hosts self-register out-of-band via the daemon's plain /enroll route (connect-host script).
7
- export const inventoryContract = {
8
- list: procedure
9
- .route({
10
- method: "GET",
11
- path: "/inventory",
12
- summary: "Machines and services you have declared",
13
- description: "What the deployment configuration says this setup owns and what it wants provisioned.",
14
- })
15
- .output(InventoryListSchema),
16
- add: procedure
17
- .route({
18
- method: "POST",
19
- path: "/inventory",
20
- summary: "Declare a machine or service",
21
- description:
22
- "Writes the entry into the configuration file and commits it, exactly as an agent editing that file by hand would. Answers with the whole updated list, so a screen redraws from one response.",
23
- })
24
- .input(AddInventoryInputSchema)
25
- .output(InventoryListSchema),
26
- remove: procedure
27
- .route({
28
- method: "DELETE",
29
- path: "/inventory/{name}",
30
- summary: "Undeclare a machine or service",
31
- description: "Takes the entry back out of the configuration and commits that too. Answers with the whole updated list.",
32
- })
33
- .input(InventoryNameParamSchema)
34
- .output(InventoryListSchema),
35
- };
@@ -1,60 +0,0 @@
1
- // codebase health: one repository's structure and risk, in numbers
2
- import { z } from "zod";
3
- import { WorkspaceSearchFreshnessSchema } from "./workspace/workspace-search.js";
4
- // Repo-level companion to the management panel and git-history graph: the resident engine's `hotspots` (churn ×
5
- // complexity) and `map` (PageRank over imports) verbs, as figures a panel can plot. Every field is a recountable count;
6
- // no composite maintainability grade, since those aren't comparable across projects or checkable. HEALTH_LIMIT is how
7
- // many hotspot files and key modules a report carries by default: a leaderboard, not an inventory, since past a
8
- // screenful the reader should be reading the files instead.
9
- export const HEALTH_LIMIT = 20;
10
- export const WorkspaceHealthQuerySchema = z.object({
11
- // "root" (the /work repo) or a nested repo's root-relative dir, the same {repo} ids the git routes take.
12
- repo: z.string().min(1).describe("Which repository, using the same ids the git routes take."),
13
- // Churn window (2d, 12h, 1w, 3m). Absent = all of history, which is what a hotspot ranking wants by default.
14
- since: z
15
- .string()
16
- .max(16)
17
- .optional()
18
- .describe("How far back to count changes, written as a span such as 2d, 12h, 1w or 3m. Leave it out for all of history."),
19
- limit: z.coerce
20
- .number()
21
- .int()
22
- .positive()
23
- .max(200)
24
- .optional()
25
- .describe("How many files and modules to rank. A leaderboard rather than an inventory: past a screenful the ranking stops being the point."),
26
- });
27
- // A file both churning and tangled; `score` is the ranking product, carried explicitly so the panel plots what it ranks
28
- // by rather than recomputing it.
29
- export const WorkspaceHotspotSchema = z.object({
30
- path: z.string(),
31
- commits: z.number(),
32
- adds: z.number(),
33
- dels: z.number(),
34
- complexity: z.number(),
35
- score: z.number(),
36
- // Epoch ms of the latest commit touching the file, within the window.
37
- latestMs: z.number(),
38
- });
39
- export type WorkspaceHotspot = z.infer<typeof WorkspaceHotspotSchema>;
40
- // A file of the import graph's ranked skeleton, order IS the rank, so no rank number rides along.
41
- export const WorkspaceKeyModuleSchema = z.object({ path: z.string(), exports: z.number() });
42
- export type WorkspaceKeyModule = z.infer<typeof WorkspaceKeyModuleSchema>;
43
- export const WorkspaceHealthSchema = z.object({
44
- repo: z.string().describe("Which repository this describes."),
45
- totals: z
46
- .object({
47
- files: z.number().describe("Files counted."),
48
- symbols: z.number().describe("Named things they export."),
49
- complexity: z.number().describe("Branch points across all of them added up."),
50
- hotspots: z.number().describe("How many files qualify as hotspots at all. The list below is capped; this is not."),
51
- })
52
- .describe(
53
- "Counts anybody could recount in the files themselves. Deliberately no single maintainability grade: those cannot be checked and are not comparable between projects.",
54
- ),
55
- hotspots: z.array(WorkspaceHotspotSchema).describe("Files that change often and are complicated at the same time, worst first."),
56
- modules: z.array(WorkspaceKeyModuleSchema).describe("The parts of the codebase the rest of it leans on most."),
57
- // Same index-freshness signal the search route reports: a panel drawn off a half-built index says so.
58
- freshness: WorkspaceSearchFreshnessSchema.describe("Whether the index these numbers were read from is up to date."),
59
- });
60
- export type WorkspaceHealth = z.infer<typeof WorkspaceHealthSchema>;
@@ -1,2 +0,0 @@
1
- import { z } from "zod";
2
- export const IntenticRunSchema = z.object({ args: z.array(z.string()) });
@@ -1,83 +0,0 @@
1
- // inventory: the i.have.* / i.want.service entries in deploy.config.ts's managed region
2
- import { z } from "zod";
3
- // The daemon renders/parses these; the browser edits them through the inventory routes.
4
-
5
- // Where the inventory lives, workspace-root-relative: the space the daemon's workspaceChanged paths arrive in.
6
- export const INVENTORY_PATH = "intent/deploy.config.ts";
7
-
8
- export const InventoryProviderSchema = z.enum(["host", "cloudflare", "github", "gitlab", "stripe"]);
9
- export type InventoryProvider = z.infer<typeof InventoryProviderSchema>;
10
- export const ServiceKindSchema = z.enum(["signoz", "outline", "paperless", "openproject", "invoiceninja", "infisical"]);
11
- export type ServiceKind = z.infer<typeof ServiceKindSchema>;
12
- // Non-secret option values; secret options (sshKey, apiToken, apiKey) are emitted as env() references, never sent over
13
- // the wire.
14
- export const InventoryValuesSchema = z.record(z.string(), z.union([z.string(), z.number()]));
15
- // `const <name>` binding in deploy.config.ts, so it must be a valid identifier.
16
- export const INVENTORY_NAME_MAX = 60;
17
- export const INVENTORY_NAME_RE = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
18
- const inventoryName = z.string().min(1).max(INVENTORY_NAME_MAX).regex(INVENTORY_NAME_RE);
19
-
20
- // Repairs a name into the identifier the rule above demands, so a form can offer one rather than refuse what it
21
- // pre-filled: app directories are `web-app`, and `const web-app` is not a binding. Empty means nothing was salvageable.
22
- export const inventoryIdentifier = (raw: string): string => {
23
- const cleaned = raw
24
- .trim()
25
- .replace(/[^a-zA-Z0-9_]+/gu, "_")
26
- .replace(/_{2,}/g, "_")
27
- .replace(/_+$/, "")
28
- .slice(0, INVENTORY_NAME_MAX);
29
- if (cleaned === "" || cleaned === "_") {
30
- return "";
31
- }
32
- // A leading digit is the one repair that has to add rather than remove.
33
- return /^[0-9]/.test(cleaned) ? `_${cleaned}`.slice(0, INVENTORY_NAME_MAX) : cleaned;
34
- };
35
- export const BackendEntrySchema = z.object({
36
- kind: z.literal("backend").describe("Something you already have: a machine, an account with a hosting provider."),
37
- provider: InventoryProviderSchema.describe("Which provider it is with."),
38
- name: z.string().describe("What to call it, which is also how everything else refers to it."),
39
- values: InventoryValuesSchema.describe("Its settings. Anything secret is stored separately and referred to here, never written in."),
40
- });
41
- export const ServiceEntrySchema = z.object({
42
- kind: z.literal("service").describe("Something you want provisioned."),
43
- service: ServiceKindSchema.describe("Which service."),
44
- name: z.string().describe("What to call it."),
45
- values: InventoryValuesSchema.describe("Its settings."),
46
- on: z.string().describe("Which of your machines to put it on."),
47
- expose: z.string().describe("How it should be reachable."),
48
- });
49
- // i.want.app: single production environment on `main`; `values.domain` is where it's exposed. Multi-env/teams wiring is
50
- // hand-authored outside the managed region.
51
- export const AppEntrySchema = z.object({
52
- kind: z.literal("app").describe("An app of your own, built from source and deployed."),
53
- name: z.string().describe("What to call it."),
54
- values: InventoryValuesSchema.describe("Its settings, including the address it should answer on."),
55
- on: z.string().describe("Which of your machines to put it on."),
56
- expose: z.string().describe("How it should be reachable."),
57
- });
58
- export const InventoryEntrySchema = z.discriminatedUnion("kind", [BackendEntrySchema, ServiceEntrySchema, AppEntrySchema]);
59
- export type InventoryEntry = z.infer<typeof InventoryEntrySchema>;
60
- export const AddInventoryInputSchema = z.discriminatedUnion("kind", [
61
- BackendEntrySchema.extend({ name: inventoryName }),
62
- ServiceEntrySchema.extend({ name: inventoryName }),
63
- AppEntrySchema.extend({ name: inventoryName }),
64
- ]);
65
- export type AddInventoryInput = z.infer<typeof AddInventoryInputSchema>;
66
- export const InventoryNameParamSchema = z.object({ name: z.string().describe("Which entry, by name.") });
67
- export const InventoryListSchema = z.object({
68
- entries: z.array(InventoryEntrySchema).describe("Everything declared: what you have, and what you want provisioned."),
69
- });
70
- // A deploy-target host self-registering via POST /enroll (connect-token auth); the SSH key (+ optional Cloudflare
71
- // token) is written to desired-state/.env, and upserted into inventory.
72
- export const EnrollHostInputSchema = z.object({
73
- name: inventoryName,
74
- user: z.string().min(1),
75
- address: z.string().min(1),
76
- port: z.coerce.number().default(22),
77
- via: z.enum(["direct", "cloudflared"]).default("cloudflared"),
78
- sshKey: z.string().min(1),
79
- cfToken: z.string().optional(),
80
- // Resolved alongside cfToken; avoids re-discovery and lets Add-service offer `<subdomain>.<zone>`.
81
- cfZone: z.string().optional(),
82
- });
83
- export type EnrollHostInput = z.infer<typeof EnrollHostInputSchema>;