@interf/compiler 0.9.4 → 0.13.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 (222) hide show
  1. package/README.md +96 -91
  2. package/TRADEMARKS.md +2 -13
  3. package/agent-skills/interf-actions/SKILL.md +97 -32
  4. package/agent-skills/interf-actions/references/cli.md +124 -71
  5. package/builtin-methods/interf-default/README.md +3 -4
  6. package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
  7. package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
  8. package/builtin-methods/interf-default/improve/SKILL.md +1 -1
  9. package/builtin-methods/interf-default/method.json +10 -4
  10. package/builtin-methods/interf-default/method.schema.json +0 -9
  11. package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
  12. package/dist/cli/commands/compile.d.ts +9 -31
  13. package/dist/cli/commands/compile.js +75 -388
  14. package/dist/cli/commands/doctor.js +1 -1
  15. package/dist/cli/commands/login.d.ts +7 -0
  16. package/dist/cli/commands/login.js +39 -0
  17. package/dist/cli/commands/logout.d.ts +2 -0
  18. package/dist/cli/commands/logout.js +16 -0
  19. package/dist/cli/commands/method.d.ts +2 -0
  20. package/dist/cli/commands/method.js +113 -0
  21. package/dist/cli/commands/prep.d.ts +2 -0
  22. package/dist/cli/commands/prep.js +134 -0
  23. package/dist/cli/commands/reset.d.ts +8 -1
  24. package/dist/cli/commands/reset.js +47 -15
  25. package/dist/cli/commands/runs.d.ts +2 -0
  26. package/dist/cli/commands/runs.js +120 -0
  27. package/dist/cli/commands/status.d.ts +6 -1
  28. package/dist/cli/commands/status.js +61 -220
  29. package/dist/cli/commands/test.d.ts +6 -15
  30. package/dist/cli/commands/test.js +63 -342
  31. package/dist/cli/commands/web.d.ts +0 -9
  32. package/dist/cli/commands/web.js +140 -367
  33. package/dist/cli/commands/wizard.d.ts +9 -0
  34. package/dist/cli/commands/wizard.js +442 -0
  35. package/dist/cli/index.d.ts +7 -6
  36. package/dist/cli/index.js +13 -10
  37. package/dist/compiler-ui/404.html +1 -1
  38. package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
  39. package/dist/compiler-ui/__next._full.txt +3 -3
  40. package/dist/compiler-ui/__next._head.txt +1 -1
  41. package/dist/compiler-ui/__next._index.txt +2 -2
  42. package/dist/compiler-ui/__next._tree.txt +2 -2
  43. package/dist/compiler-ui/_next/static/chunks/045gole2ojo3g.css +3 -0
  44. package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +89 -0
  45. package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
  46. package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
  47. package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
  48. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
  49. package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
  50. package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
  51. package/dist/compiler-ui/_not-found.html +1 -1
  52. package/dist/compiler-ui/_not-found.txt +2 -2
  53. package/dist/compiler-ui/index.html +1 -1
  54. package/dist/compiler-ui/index.txt +3 -3
  55. package/dist/index.d.ts +0 -23
  56. package/dist/index.js +0 -16
  57. package/dist/packages/agents/lib/shells.d.ts +1 -1
  58. package/dist/packages/agents/lib/shells.js +113 -54
  59. package/dist/packages/agents/lib/user-config.d.ts +4 -2
  60. package/dist/packages/agents/lib/user-config.js +15 -7
  61. package/dist/packages/compiler/compiled-paths.d.ts +9 -2
  62. package/dist/packages/compiler/compiled-paths.js +30 -15
  63. package/dist/packages/compiler/compiled-pipeline.js +23 -3
  64. package/dist/packages/compiler/compiled-stage-plan.js +4 -0
  65. package/dist/packages/compiler/compiled-target.d.ts +1 -1
  66. package/dist/packages/compiler/compiled-target.js +1 -1
  67. package/dist/packages/compiler/index.d.ts +1 -0
  68. package/dist/packages/compiler/index.js +1 -0
  69. package/dist/packages/compiler/lib/schema.d.ts +27 -32
  70. package/dist/packages/compiler/lib/schema.js +2 -13
  71. package/dist/packages/compiler/method-runs.d.ts +2 -3
  72. package/dist/packages/compiler/method-runs.js +2 -3
  73. package/dist/packages/compiler/reset.js +3 -1
  74. package/dist/packages/compiler/runtime-contracts.js +0 -3
  75. package/dist/packages/compiler/runtime-prompt.js +1 -1
  76. package/dist/packages/compiler/source-files.d.ts +46 -0
  77. package/dist/packages/compiler/source-files.js +149 -0
  78. package/dist/packages/compiler/state-artifacts.d.ts +3 -2
  79. package/dist/packages/compiler/state-artifacts.js +4 -3
  80. package/dist/packages/compiler/state-io.d.ts +3 -2
  81. package/dist/packages/compiler/state-io.js +11 -5
  82. package/dist/packages/compiler/state-paths.d.ts +2 -1
  83. package/dist/packages/compiler/state-paths.js +6 -3
  84. package/dist/packages/compiler/state-view.d.ts +3 -2
  85. package/dist/packages/compiler/state-view.js +18 -28
  86. package/dist/packages/compiler/state.d.ts +4 -4
  87. package/dist/packages/compiler/state.js +3 -3
  88. package/dist/packages/contracts/index.d.ts +1 -1
  89. package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
  90. package/dist/packages/contracts/lib/preparation-paths.js +177 -0
  91. package/dist/packages/contracts/lib/schema.d.ts +85 -6
  92. package/dist/packages/contracts/lib/schema.js +46 -2
  93. package/dist/packages/execution/lib/schema.d.ts +50 -57
  94. package/dist/packages/execution/lib/schema.js +1 -2
  95. package/dist/packages/local-service/action-definitions.d.ts +246 -0
  96. package/dist/packages/local-service/action-definitions.js +1147 -0
  97. package/dist/packages/local-service/action-planner.d.ts +9 -0
  98. package/dist/packages/local-service/action-planner.js +135 -0
  99. package/dist/packages/local-service/action-values.d.ts +1 -23
  100. package/dist/packages/local-service/action-values.js +1 -31
  101. package/dist/packages/local-service/client.d.ts +76 -46
  102. package/dist/packages/local-service/client.js +184 -149
  103. package/dist/packages/local-service/connection-config.d.ts +38 -0
  104. package/dist/packages/local-service/connection-config.js +75 -0
  105. package/dist/packages/local-service/index.d.ts +14 -7
  106. package/dist/packages/local-service/index.js +8 -4
  107. package/dist/packages/local-service/instance-paths.d.ts +100 -0
  108. package/dist/packages/local-service/instance-paths.js +165 -0
  109. package/dist/packages/local-service/lib/schema.d.ts +689 -2575
  110. package/dist/packages/local-service/lib/schema.js +260 -101
  111. package/dist/packages/local-service/native-run-handlers.d.ts +23 -0
  112. package/dist/{cli/commands/compile-controller.js → packages/local-service/native-run-handlers.js} +204 -20
  113. package/dist/packages/local-service/preparation-store.d.ts +92 -0
  114. package/dist/packages/local-service/preparation-store.js +171 -0
  115. package/dist/{cli/commands/check-draft.d.ts → packages/local-service/readiness-check-draft.d.ts} +2 -2
  116. package/dist/packages/local-service/routes.d.ts +33 -11
  117. package/dist/packages/local-service/routes.js +44 -15
  118. package/dist/packages/local-service/run-observability.js +25 -27
  119. package/dist/packages/local-service/runtime-caches.d.ts +76 -0
  120. package/dist/packages/local-service/runtime-caches.js +191 -0
  121. package/dist/packages/local-service/runtime-event-applier.d.ts +12 -0
  122. package/dist/packages/local-service/runtime-event-applier.js +177 -0
  123. package/dist/packages/local-service/runtime-persistence.d.ts +47 -0
  124. package/dist/packages/local-service/runtime-persistence.js +137 -0
  125. package/dist/packages/local-service/runtime-proposal-helpers.d.ts +35 -0
  126. package/dist/packages/local-service/runtime-proposal-helpers.js +251 -0
  127. package/dist/packages/local-service/runtime-resource-builders.d.ts +52 -0
  128. package/dist/packages/local-service/runtime-resource-builders.js +149 -0
  129. package/dist/packages/local-service/runtime.d.ts +201 -44
  130. package/dist/packages/local-service/runtime.js +1062 -1106
  131. package/dist/packages/local-service/server.d.ts +15 -0
  132. package/dist/packages/local-service/server.js +651 -233
  133. package/dist/packages/local-service/service-registry.d.ts +47 -0
  134. package/dist/packages/local-service/service-registry.js +137 -0
  135. package/dist/packages/method-authoring/method-authoring.d.ts +1 -1
  136. package/dist/packages/method-authoring/method-authoring.js +2 -2
  137. package/dist/packages/method-authoring/method-improvement.js +1 -1
  138. package/dist/packages/method-package/builtin-compiled-method.d.ts +4 -5
  139. package/dist/packages/method-package/builtin-compiled-method.js +8 -14
  140. package/dist/packages/method-package/context-interface.d.ts +4 -40
  141. package/dist/packages/method-package/context-interface.js +1 -23
  142. package/dist/packages/method-package/interf-method-package.d.ts +4 -4
  143. package/dist/packages/method-package/interf-method-package.js +21 -33
  144. package/dist/packages/method-package/local-methods.d.ts +10 -6
  145. package/dist/packages/method-package/local-methods.js +57 -39
  146. package/dist/packages/method-package/method-definitions.d.ts +8 -34
  147. package/dist/packages/method-package/method-definitions.js +49 -37
  148. package/dist/packages/method-package/method-helpers.d.ts +1 -13
  149. package/dist/packages/method-package/method-helpers.js +8 -42
  150. package/dist/packages/method-package/method-review-paths.d.ts +1 -1
  151. package/dist/packages/method-package/method-review-paths.js +5 -5
  152. package/dist/packages/method-package/method-stage-runner.js +2 -2
  153. package/dist/packages/method-package/user-methods.d.ts +17 -0
  154. package/dist/packages/method-package/user-methods.js +77 -0
  155. package/dist/packages/project-model/index.d.ts +1 -1
  156. package/dist/packages/project-model/index.js +1 -1
  157. package/dist/packages/project-model/interf-detect.d.ts +8 -3
  158. package/dist/packages/project-model/interf-detect.js +34 -34
  159. package/dist/packages/project-model/interf-scaffold.d.ts +3 -3
  160. package/dist/packages/project-model/interf-scaffold.js +23 -32
  161. package/dist/packages/project-model/lib/schema.js +38 -1
  162. package/dist/packages/project-model/preparation-entries.d.ts +11 -0
  163. package/dist/packages/project-model/preparation-entries.js +49 -0
  164. package/dist/packages/project-model/source-config.d.ts +11 -10
  165. package/dist/packages/project-model/source-config.js +83 -44
  166. package/dist/packages/project-model/source-folders.d.ts +5 -5
  167. package/dist/packages/project-model/source-folders.js +14 -14
  168. package/dist/packages/shared/filesystem.d.ts +7 -0
  169. package/dist/packages/shared/filesystem.js +97 -10
  170. package/dist/packages/testing/lib/schema.d.ts +12 -13
  171. package/dist/packages/testing/lib/schema.js +4 -5
  172. package/dist/packages/testing/readiness-check-run.d.ts +7 -7
  173. package/dist/packages/testing/readiness-check-run.js +46 -51
  174. package/dist/packages/testing/test-execution.js +6 -6
  175. package/dist/packages/testing/test-paths.js +4 -3
  176. package/dist/packages/testing/test-sandbox.d.ts +0 -1
  177. package/dist/packages/testing/test-sandbox.js +14 -30
  178. package/dist/packages/testing/test-targets.d.ts +1 -1
  179. package/dist/packages/testing/test-targets.js +6 -6
  180. package/dist/packages/testing/test.d.ts +1 -1
  181. package/dist/packages/testing/test.js +1 -1
  182. package/package.json +6 -26
  183. package/LICENSE +0 -183
  184. package/dist/cli/commands/compile-controller.d.ts +0 -17
  185. package/dist/cli/commands/compiled-flow.d.ts +0 -25
  186. package/dist/cli/commands/compiled-flow.js +0 -112
  187. package/dist/cli/commands/control-path.d.ts +0 -11
  188. package/dist/cli/commands/control-path.js +0 -72
  189. package/dist/cli/commands/create-method-wizard.d.ts +0 -76
  190. package/dist/cli/commands/create-method-wizard.js +0 -465
  191. package/dist/cli/commands/create.d.ts +0 -8
  192. package/dist/cli/commands/create.js +0 -189
  193. package/dist/cli/commands/default.d.ts +0 -2
  194. package/dist/cli/commands/default.js +0 -39
  195. package/dist/cli/commands/executor-flow.d.ts +0 -29
  196. package/dist/cli/commands/executor-flow.js +0 -163
  197. package/dist/cli/commands/init.d.ts +0 -11
  198. package/dist/cli/commands/init.js +0 -784
  199. package/dist/cli/commands/list.d.ts +0 -2
  200. package/dist/cli/commands/list.js +0 -30
  201. package/dist/cli/commands/preparation-selection.d.ts +0 -6
  202. package/dist/cli/commands/preparation-selection.js +0 -11
  203. package/dist/cli/commands/source-config-wizard.d.ts +0 -52
  204. package/dist/cli/commands/source-config-wizard.js +0 -680
  205. package/dist/cli/commands/test-flow.d.ts +0 -58
  206. package/dist/cli/commands/test-flow.js +0 -231
  207. package/dist/cli/commands/verify.d.ts +0 -2
  208. package/dist/cli/commands/verify.js +0 -94
  209. package/dist/compiler-ui/_next/static/chunks/0d~8t0zm6545p.js +0 -118
  210. package/dist/compiler-ui/_next/static/chunks/0xnel.ax9a.2c.css +0 -3
  211. package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
  212. package/dist/packages/compiler/raw-snapshot.js +0 -101
  213. package/dist/packages/method-package/index.d.ts +0 -11
  214. package/dist/packages/method-package/index.js +0 -11
  215. package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
  216. package/dist/packages/method-package/method-stage-policy.js +0 -31
  217. package/dist/packages/project-model/project-paths.d.ts +0 -12
  218. package/dist/packages/project-model/project-paths.js +0 -33
  219. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_buildManifest.js +0 -0
  220. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_clientMiddlewareManifest.js +0 -0
  221. /package/dist/compiler-ui/_next/static/{j7pdoqWrl4YJrJUVnksbl → C6vVfy3aeYuIO3d2AoNvC}/_ssgManifest.js +0 -0
  222. /package/dist/{cli/commands/check-draft.js → packages/local-service/readiness-check-draft.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import type { MethodExecutor } from "../agents/lib/executors.js";
2
+ import type { LocalServiceActionPlanningContext } from "./runtime.js";
3
+ import { type ActionProposalCreateRequest, type ActionProposalPlan } from "./lib/schema.js";
4
+ export declare function buildActionPlannerPrompt(request: ActionProposalCreateRequest, context: LocalServiceActionPlanningContext, outputPath: string): string;
5
+ export declare function planActionProposalWithExecutor(options: {
6
+ request: ActionProposalCreateRequest;
7
+ context: LocalServiceActionPlanningContext;
8
+ executor: MethodExecutor;
9
+ }): Promise<ActionProposalPlan>;
@@ -0,0 +1,135 @@
1
+ import { existsSync, mkdirSync, readFileSync, } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { methodIdForSourcePreparationConfig, } from "../methods/method-resolution.js";
4
+ import { PACKAGE_ROOT } from "../method-package/lib/package-root.js";
5
+ import { asPreparationDataDir, preparationServiceActionPlansRoot, } from "../contracts/lib/preparation-paths.js";
6
+ import { ActionProposalPlanSchema, } from "./lib/schema.js";
7
+ function extractJsonObject(text) {
8
+ try {
9
+ return JSON.parse(text);
10
+ }
11
+ catch {
12
+ const match = text.match(/\{[\s\S]*\}/);
13
+ if (!match)
14
+ throw new Error("Planner did not write a JSON object.");
15
+ return JSON.parse(match[0]);
16
+ }
17
+ }
18
+ function readActionSkill() {
19
+ const skillDir = join(PACKAGE_ROOT, "agent-skills", "interf-actions");
20
+ const skillPath = join(skillDir, "SKILL.md");
21
+ const cliReferencePath = join(skillDir, "references", "cli.md");
22
+ try {
23
+ const skill = readFileSync(skillPath, "utf8");
24
+ const cliReference = readFileSync(cliReferencePath, "utf8");
25
+ return [
26
+ skill,
27
+ "## Bundled reference: references/cli.md",
28
+ cliReference,
29
+ ].join("\n\n");
30
+ }
31
+ catch {
32
+ return [
33
+ "# Interf Actions",
34
+ "Use `interf --help`, `interf list`, `interf status`, and command-specific help as the source of truth.",
35
+ "In Interf proposal mode, do not run CLI commands. Write the requested JSON proposal only.",
36
+ ].join("\n\n");
37
+ }
38
+ }
39
+ export function buildActionPlannerPrompt(request, context, outputPath) {
40
+ const actionSkill = readActionSkill();
41
+ const preparations = context.preparations.map((preparation) => ({
42
+ name: preparation.name,
43
+ path: preparation.path,
44
+ about: preparation.about ?? null,
45
+ method: methodIdForSourcePreparationConfig(preparation),
46
+ checks: preparation.checks?.length ?? 0,
47
+ }));
48
+ const recentProposals = context.recentProposals.map((proposal) => ({
49
+ status: proposal.status,
50
+ action_type: proposal.action_type,
51
+ title: proposal.title,
52
+ preparation: proposal.preparation ?? null,
53
+ request: proposal.request,
54
+ command_preview: proposal.command_preview ?? null,
55
+ }));
56
+ const sourceFolders = context.sourceFolders.map((folder) => ({
57
+ path: folder.value,
58
+ label: folder.label,
59
+ hint: folder.hint,
60
+ }));
61
+ return `You are the local Interf action planner.
62
+
63
+ User request:
64
+ ${request.message}
65
+
66
+ Selected Preparation hint: ${request.preparation ?? "(none)"}
67
+
68
+ Structured request values:
69
+ ${JSON.stringify(request.values ?? {}, null, 2)}
70
+
71
+ Available Preparations:
72
+ ${JSON.stringify(preparations, null, 2)}
73
+
74
+ Visible Source Folders:
75
+ ${JSON.stringify(sourceFolders, null, 2)}
76
+
77
+ Action health:
78
+ ${JSON.stringify(context.preparationHealth, null, 2)}
79
+
80
+ Recent proposals, newest first. A short follow-up like "target source only" may be correcting the latest pending proposal:
81
+ ${JSON.stringify(recentProposals, null, 2)}
82
+
83
+ Interf action skill source:
84
+ ${actionSkill}
85
+
86
+ Use the Interf action skill source as the authority for CLI semantics and Interf proposal mode. Preserve user intent over defaults.
87
+ Use Action health to avoid proposing work that cannot run yet. If can_check_readiness is false, prefer the recommended next actions; do not propose a generic readiness check unless the user explicitly asks for a source-files-only baseline.
88
+ If the user is asking a question or making casual conversation, return "clarification" with a helpful assistant_message. Do not invent a CLI command for non-action chat.
89
+ If a field does not apply, omit it instead of writing null or an empty string.
90
+ Do not run any CLI command. Do not edit files except the output JSON file.
91
+
92
+ Write only this JSON object to:
93
+ ${outputPath}
94
+
95
+ JSON schema:
96
+ {
97
+ "action_type": "preparation-setup" | "preparation-change" | "compile" | "test" | "readiness-check-draft" | "method-authoring" | "method-change" | "method-improvement" | "clarification",
98
+ "preparation": "Preparation id if applicable",
99
+ "method": "Method id if applicable",
100
+ "values": {},
101
+ "title": "short approval card title",
102
+ "summary": "one sentence describing what will run",
103
+ "assistant_message": "concise explanation for the user",
104
+ "command_preview": "interf command the user is approving"
105
+ }
106
+ `;
107
+ }
108
+ export async function planActionProposalWithExecutor(options) {
109
+ const planRoot = join(preparationServiceActionPlansRoot(asPreparationDataDir(options.context.sourcePath)), Date.now().toString(36));
110
+ mkdirSync(planRoot, { recursive: true });
111
+ const outputPath = join(planRoot, "proposal.json");
112
+ const prompt = buildActionPlannerPrompt(options.request, options.context, outputPath);
113
+ const exitCode = await options.executor.execute(options.context.sourcePath, prompt, {
114
+ eventLogPath: join(planRoot, "planner.events.ndjson"),
115
+ statusLogPath: join(planRoot, "planner.status.log"),
116
+ completionCheck: () => existsSync(outputPath),
117
+ });
118
+ if (exitCode !== 0 && !existsSync(outputPath)) {
119
+ return ActionProposalPlanSchema.parse({
120
+ action_type: "clarification",
121
+ preparation: options.request.preparation,
122
+ assistant_message: `${options.executor.displayName} could not create a safe Interf proposal.`,
123
+ });
124
+ }
125
+ try {
126
+ return ActionProposalPlanSchema.parse(extractJsonObject(readFileSync(outputPath, "utf8")));
127
+ }
128
+ catch {
129
+ return ActionProposalPlanSchema.parse({
130
+ action_type: "clarification",
131
+ preparation: options.request.preparation,
132
+ assistant_message: "I can help with this Interf Workspace. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Method and I will prepare an approval proposal.",
133
+ });
134
+ }
135
+ }
@@ -1,23 +1 @@
1
- import { z } from "zod";
2
- export declare const ActionValueIdPattern: RegExp;
3
- export declare const ActionValueIdSchema: z.ZodString;
4
- export declare const OptionalActionValueIdSchema: z.ZodString;
5
- export declare const PreparationSetupActionValuesSchema: z.ZodObject<{
6
- name: z.ZodString;
7
- path: z.ZodString;
8
- about: z.ZodString;
9
- method: z.ZodOptional<z.ZodString>;
10
- readiness_notes: z.ZodOptional<z.ZodString>;
11
- prepare_after_setup: z.ZodOptional<z.ZodBoolean>;
12
- }, z.core.$strict>;
13
- export declare const MethodAuthoringActionValuesSchema: z.ZodObject<{
14
- method_id: z.ZodString;
15
- label: z.ZodString;
16
- hint: z.ZodString;
17
- task_prompt: z.ZodString;
18
- portable_output: z.ZodOptional<z.ZodString>;
19
- readiness_notes: z.ZodOptional<z.ZodString>;
20
- }, z.core.$strict>;
21
- export type PreparationSetupActionValues = z.infer<typeof PreparationSetupActionValuesSchema>;
22
- export type MethodAuthoringActionValues = z.infer<typeof MethodAuthoringActionValuesSchema>;
23
- export declare function methodAuthoringTaskPrompt(values: MethodAuthoringActionValues): string;
1
+ export { ActionValueIdPattern, ActionValueIdSchema, MethodAuthoringActionValuesSchema, OptionalActionValueIdSchema, PreparationSetupActionValuesSchema, SourceReadinessCheckActionValueSchema, methodAuthoringRequestFromActionValues, methodAuthoringTaskPrompt, preparationSetupRequestFromActionValues, type MethodAuthoringActionValues, type PreparationSetupActionValues, type SourceReadinessCheckActionValue, } from "./action-definitions.js";
@@ -1,31 +1 @@
1
- import { z } from "zod";
2
- export const ActionValueIdPattern = /^[a-z0-9][a-z0-9-]{0,79}$/;
3
- export const ActionValueIdSchema = z.string().trim().regex(ActionValueIdPattern, "Use lowercase letters, numbers, and dashes.");
4
- export const OptionalActionValueIdSchema = z.string().trim().refine((value) => value === "" || ActionValueIdPattern.test(value), "Use lowercase letters, numbers, and dashes.");
5
- export const PreparationSetupActionValuesSchema = z.object({
6
- name: ActionValueIdSchema,
7
- path: z.string().trim().min(1, "Source Folder is required."),
8
- about: z.string().trim().min(1, "Agent work is required."),
9
- method: OptionalActionValueIdSchema.optional(),
10
- readiness_notes: z.string().trim().optional(),
11
- prepare_after_setup: z.boolean().optional(),
12
- }).strict();
13
- export const MethodAuthoringActionValuesSchema = z.object({
14
- method_id: ActionValueIdSchema,
15
- label: z.string().trim().min(1, "Label is required."),
16
- hint: z.string().trim().min(1, "Summary is required."),
17
- task_prompt: z.string().trim().min(1, "Agent work is required."),
18
- portable_output: z.string().trim().optional(),
19
- readiness_notes: z.string().trim().optional(),
20
- }).strict();
21
- function optionalLine(label, value) {
22
- const trimmed = value?.trim();
23
- return trimmed ? `${label}: ${trimmed}` : null;
24
- }
25
- export function methodAuthoringTaskPrompt(values) {
26
- return [
27
- `Agent work: ${values.task_prompt}`,
28
- optionalLine("Portable-context output", values.portable_output),
29
- optionalLine("Readiness checks", values.readiness_notes),
30
- ].filter((line) => Boolean(line)).join("\n");
31
- }
1
+ export { ActionValueIdPattern, ActionValueIdSchema, MethodAuthoringActionValuesSchema, OptionalActionValueIdSchema, PreparationSetupActionValuesSchema, SourceReadinessCheckActionValueSchema, methodAuthoringRequestFromActionValues, methodAuthoringTaskPrompt, preparationSetupRequestFromActionValues, } from "./action-definitions.js";
@@ -1,7 +1,12 @@
1
- import { type CompileRunCreateRequest, type CompileRunListResponse, type CompileRunResource, type LocalJobEventAppendRequest, type LocalJobRunCreateRequest, type LocalJobRunListResponse, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ReadinessListResponse, type TestRunCreateRequest, type TestRunListResponse, type TestRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
1
+ import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type TestRunCreateRequest, type TestRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
2
+ export interface FindOrStartLocalServiceOptions {
3
+ url?: string;
4
+ authToken?: string;
5
+ }
2
6
  export interface LocalServiceConnection {
3
7
  serviceUrl: string;
4
8
  health: LocalServiceHealth;
9
+ authToken: string | null;
5
10
  }
6
11
  export interface LocalServiceJobSubmission<T> {
7
12
  serviceUrl: string;
@@ -13,107 +18,132 @@ export interface LocalServiceJobSubmitted {
13
18
  serviceUrl: string;
14
19
  job: LocalJobRunResource;
15
20
  }
16
- export interface LocalServiceRunSnapshot {
17
- jobs: LocalJobRunResource[];
18
- compileRuns: CompileRunResource[];
19
- testRuns: TestRunResource[];
20
- }
21
21
  export declare function configuredLocalServiceUrl(): string;
22
- export declare function findLocalService(options: {
23
- projectPath: string;
22
+ /**
23
+ * Resolve the bearer token for the active connection. In 0.13 there is
24
+ * exactly one source of truth: `~/.interf/connection.json` (or the
25
+ * `INTERF_SERVICE_TOKEN` env override).
26
+ */
27
+ export declare function resolveLocalServiceAuthToken(): string | null;
28
+ /**
29
+ * Resolve a connection. In 0.13 this is the only path to the engine — read
30
+ * `~/.interf/connection.json` (written by `interf web`) or honor the
31
+ * `INTERF_SERVICE_URL` / `INTERF_SERVICE_TOKEN` env overrides.
32
+ */
33
+ export declare function findLocalService(options?: {
24
34
  timeoutMs?: number;
25
35
  }): Promise<LocalServiceConnection | null>;
26
36
  export declare function submitCompileRunToLocalService(options: {
27
- projectPath: string;
37
+ preparationId: string;
28
38
  request: CompileRunCreateRequest;
39
+ idempotencyKey?: string;
29
40
  }): Promise<{
30
41
  serviceUrl: string;
31
42
  resource: CompileRunResource;
32
43
  } | null>;
33
44
  export declare function submitTestRunToLocalService(options: {
34
- projectPath: string;
45
+ preparationId: string;
35
46
  request: TestRunCreateRequest;
36
47
  }): Promise<{
37
48
  serviceUrl: string;
38
49
  resource: TestRunResource;
39
50
  } | null>;
51
+ export declare function submitResetToLocalService(options: {
52
+ preparationId: string;
53
+ request: ResetRequest;
54
+ }): Promise<{
55
+ serviceUrl: string;
56
+ result: ResetResult;
57
+ } | null>;
58
+ export declare function createActionProposalInLocalService(options: {
59
+ request: ActionProposalCreateRequest;
60
+ }): Promise<{
61
+ serviceUrl: string;
62
+ resource: ActionProposalResource;
63
+ } | null>;
64
+ export declare function decideActionProposalInLocalService(options: {
65
+ proposalId: string;
66
+ request: ActionProposalApprovalRequest;
67
+ serviceUrl?: string;
68
+ authToken?: string | null;
69
+ }): Promise<{
70
+ serviceUrl: string;
71
+ resource: ActionProposalResource;
72
+ } | null>;
73
+ export declare function approveActionProposalInLocalService(options: {
74
+ request: ActionProposalCreateRequest;
75
+ }): Promise<{
76
+ serviceUrl: string;
77
+ resource: ActionProposalResource;
78
+ } | null>;
40
79
  export declare function getLocalCompileRun(options: {
41
80
  serviceUrl: string;
42
81
  runId: string;
82
+ authToken?: string | null;
43
83
  }): Promise<CompileRunResource>;
44
- export declare function listLocalCompileRuns(options: {
45
- serviceUrl: string;
46
- timeoutMs?: number;
47
- }): Promise<CompileRunListResponse>;
48
- export declare function listLocalReadiness(options: {
84
+ export interface LocalCompileRunCancelResult {
85
+ cancelled: boolean;
86
+ reason?: string;
87
+ }
88
+ /**
89
+ * Ask the local service to cancel a running compile run by id. Resolves
90
+ * with the typed cancel result on success and throws when the service
91
+ * returns 404 (unknown run id) or any non-2xx status.
92
+ */
93
+ export declare function cancelLocalCompileRun(options: {
49
94
  serviceUrl: string;
95
+ runId: string;
50
96
  timeoutMs?: number;
51
- }): Promise<ReadinessListResponse>;
97
+ authToken?: string | null;
98
+ }): Promise<LocalCompileRunCancelResult>;
52
99
  export declare function waitForLocalCompileRun(options: {
53
100
  serviceUrl: string;
54
101
  runId: string;
55
102
  pollMs?: number;
103
+ authToken?: string | null;
56
104
  onUpdate?: (resource: CompileRunResource) => void;
57
105
  }): Promise<CompileRunResource>;
58
106
  export declare function getLocalTestRun(options: {
59
107
  serviceUrl: string;
60
108
  runId: string;
109
+ authToken?: string | null;
61
110
  }): Promise<TestRunResource>;
62
- export declare function listLocalTestRuns(options: {
63
- serviceUrl: string;
64
- timeoutMs?: number;
65
- }): Promise<TestRunListResponse>;
66
111
  export declare function waitForLocalTestRun(options: {
67
112
  serviceUrl: string;
68
113
  runId: string;
69
114
  pollMs?: number;
115
+ authToken?: string | null;
70
116
  onUpdate?: (resource: TestRunResource) => void;
71
117
  }): Promise<TestRunResource>;
72
118
  export declare function getLocalJobRun(options: {
73
119
  serviceUrl: string;
74
120
  runId: string;
121
+ authToken?: string | null;
75
122
  }): Promise<LocalJobRunResource>;
76
- export declare function listLocalJobRuns(options: {
77
- serviceUrl: string;
78
- timeoutMs?: number;
79
- }): Promise<LocalJobRunListResponse>;
80
- export declare function readLocalServiceRunSnapshot(options: {
81
- serviceUrl: string;
82
- timeoutMs?: number;
83
- }): Promise<LocalServiceRunSnapshot>;
84
123
  export declare function waitForLocalJobRun(options: {
85
124
  serviceUrl: string;
86
125
  runId: string;
87
126
  pollMs?: number;
88
127
  timeoutMs?: number;
128
+ authToken?: string | null;
89
129
  onUpdate?: (job: LocalJobRunResource) => void;
90
130
  }): Promise<LocalJobRunResource>;
91
131
  export declare function submitReadinessCheckDraftToLocalService(options: {
92
- projectPath: string;
132
+ preparationId: string;
93
133
  request: ReadinessCheckDraftCreateRequest;
94
134
  onSubmitted?: (submission: LocalServiceJobSubmitted) => void;
95
135
  onUpdate?: (job: LocalJobRunResource) => void;
96
136
  }): Promise<LocalServiceJobSubmission<ReadinessCheckDraftResult> | null>;
97
137
  export declare function submitMethodAuthoringRunToLocalService(options: {
98
- projectPath: string;
138
+ preparationId: string;
99
139
  request: MethodAuthoringCreateRequest;
100
140
  onSubmitted?: (submission: LocalServiceJobSubmitted) => void;
101
141
  onUpdate?: (job: LocalJobRunResource) => void;
102
142
  }): Promise<LocalServiceJobSubmission<MethodAuthoringResult> | null>;
103
- export interface LocalJobTracker {
143
+ /**
144
+ * Fetch the engine instance health/status.
145
+ */
146
+ export declare function getLocalServiceHealth(options: {
104
147
  serviceUrl: string;
105
- runId: string;
106
- resource: LocalJobRunResource;
107
- emit(event: LocalJobEventAppendRequest): void;
108
- complete(message?: string): Promise<void>;
109
- fail(message: string): Promise<void>;
110
- }
111
- export declare function appendLocalJobRunEvent(options: {
112
- projectPath: string;
113
- runId: string;
114
- event: LocalJobEventAppendRequest;
115
- }): Promise<LocalJobRunResource | null>;
116
- export declare function startLocalJobRun(options: {
117
- projectPath: string;
118
- request: LocalJobRunCreateRequest;
119
- }): Promise<LocalJobTracker | null>;
148
+ timeoutMs?: number;
149
+ }): Promise<LocalServiceHealth>;