@interf/compiler 0.18.0 → 0.21.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 (129) hide show
  1. package/README.md +87 -73
  2. package/dist/cli/commands/mcp.d.ts +0 -34
  3. package/dist/cli/commands/mcp.js +246 -45
  4. package/dist/cli/commands/method.js +261 -15
  5. package/dist/cli/commands/prep.js +61 -16
  6. package/dist/cli/commands/runs.js +103 -9
  7. package/dist/cli/commands/status.js +4 -2
  8. package/dist/cli/commands/test.d.ts +10 -0
  9. package/dist/cli/commands/{verify.js → test.js} +16 -18
  10. package/dist/cli/commands/web.js +82 -8
  11. package/dist/cli/commands/wizard.js +36 -37
  12. package/dist/cli/index.d.ts +2 -2
  13. package/dist/cli/index.js +3 -3
  14. package/dist/compiler-ui/404.html +1 -1
  15. package/dist/compiler-ui/__next.__PAGE__.txt +5 -5
  16. package/dist/compiler-ui/__next._full.txt +13 -12
  17. package/dist/compiler-ui/__next._head.txt +3 -3
  18. package/dist/compiler-ui/__next._index.txt +5 -4
  19. package/dist/compiler-ui/__next._tree.txt +4 -3
  20. package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +1 -0
  21. package/dist/compiler-ui/_next/static/chunks/{0n51hrfoufc7g.js → 02f_.8.ebn556.js} +1 -1
  22. package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +1 -0
  23. package/dist/compiler-ui/_next/static/chunks/{08m7vf5asqlsm.js → 04d0ly-7xb~-j.js} +10 -10
  24. package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +1 -0
  25. package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +2 -0
  26. package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +116 -0
  27. package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +31 -0
  28. package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +1 -0
  29. package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +1 -0
  30. package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +1 -0
  31. package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +1 -0
  32. package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +1 -0
  33. package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +5 -0
  34. package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +1 -0
  35. package/dist/compiler-ui/_next/static/chunks/{turbopack-0.uq1k8c0j4s..js → turbopack-02-3e_c-yz~5g.js} +1 -1
  36. package/dist/compiler-ui/_next/static/chunks/{turbopack-10e~t1yzi4svj.js → turbopack-0apv8vb-nczuy.js} +1 -1
  37. package/dist/compiler-ui/_not-found/__next._full.txt +10 -9
  38. package/dist/compiler-ui/_not-found/__next._head.txt +3 -3
  39. package/dist/compiler-ui/_not-found/__next._index.txt +5 -4
  40. package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +2 -2
  41. package/dist/compiler-ui/_not-found/__next._not-found.txt +3 -3
  42. package/dist/compiler-ui/_not-found/__next._tree.txt +3 -2
  43. package/dist/compiler-ui/_not-found.html +1 -1
  44. package/dist/compiler-ui/_not-found.txt +10 -9
  45. package/dist/compiler-ui/index.html +1 -1
  46. package/dist/compiler-ui/index.txt +13 -12
  47. package/dist/packages/contracts/lib/schema.d.ts +4 -0
  48. package/dist/packages/contracts/lib/schema.js +2 -1
  49. package/dist/packages/engine/action-definitions.d.ts +174 -13
  50. package/dist/packages/engine/action-definitions.js +125 -122
  51. package/dist/packages/engine/action-planner.js +4 -11
  52. package/dist/packages/engine/agents/lib/shells.d.ts +3 -1
  53. package/dist/packages/engine/agents/lib/shells.js +8 -4
  54. package/dist/packages/engine/agents/role-executors.js +1 -1
  55. package/dist/packages/engine/compile/compiled-paths.js +6 -6
  56. package/dist/packages/engine/connection-config.js +1 -1
  57. package/dist/packages/engine/execution/lib/schema.d.ts +10 -0
  58. package/dist/packages/engine/instance-paths.d.ts +15 -9
  59. package/dist/packages/engine/instance-paths.js +15 -9
  60. package/dist/packages/engine/lib/schema.d.ts +686 -30
  61. package/dist/packages/engine/lib/schema.js +48 -21
  62. package/dist/packages/engine/native-run-handlers.js +10 -8
  63. package/dist/packages/engine/preparation-store.d.ts +9 -13
  64. package/dist/packages/engine/preparation-store.js +12 -0
  65. package/dist/packages/engine/requested-artifacts.d.ts +5 -0
  66. package/dist/packages/engine/requested-artifacts.js +36 -0
  67. package/dist/packages/engine/routes.d.ts +1 -1
  68. package/dist/packages/engine/routes.js +1 -1
  69. package/dist/packages/engine/run-observability.js +3 -2
  70. package/dist/packages/engine/runtime-proposal-helpers.d.ts +2 -2
  71. package/dist/packages/engine/runtime-proposal-helpers.js +5 -7
  72. package/dist/packages/engine/runtime-resource-builders.d.ts +5 -0
  73. package/dist/packages/engine/runtime-resource-builders.js +13 -2
  74. package/dist/packages/engine/runtime.d.ts +3 -1
  75. package/dist/packages/engine/runtime.js +146 -21
  76. package/dist/packages/engine/server.js +104 -52
  77. package/dist/packages/engine/verify/verify-execution.js +1 -1
  78. package/dist/packages/engine/wire-schemas.d.ts +5 -1
  79. package/dist/packages/engine/wire-schemas.js +1 -1
  80. package/dist/packages/methods/authoring/method-authoring.d.ts +3 -1
  81. package/dist/packages/methods/authoring/method-authoring.js +5 -36
  82. package/dist/packages/methods/package/builtin-compiled-method.js +1 -1
  83. package/dist/packages/methods/package/local-methods.d.ts +1 -0
  84. package/dist/packages/methods/package/local-methods.js +19 -4
  85. package/dist/packages/methods/package/method-definitions.js +1 -1
  86. package/dist/packages/project/interf-detect.js +6 -6
  87. package/dist/packages/project/lib/schema.d.ts +193 -0
  88. package/dist/packages/project/lib/schema.js +46 -1
  89. package/dist/packages/project/source-config.js +4 -0
  90. package/dist/packages/project/source-folders.js +1 -1
  91. package/package.json +7 -8
  92. package/public-repo/CONTRIBUTING.md +47 -0
  93. package/public-repo/LICENSE.md +1 -0
  94. package/public-repo/README.md +325 -0
  95. package/public-repo/SECURITY.md +67 -0
  96. package/public-repo/TRADEMARKS.md +8 -0
  97. package/{builtin-methods → public-repo/methods}/interf-default/README.md +4 -0
  98. package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/shape/SKILL.md +4 -8
  99. package/{builtin-methods → public-repo/methods}/interf-default/method.json +1 -1
  100. package/public-repo/methods/interf-default/use/query/SKILL.md +23 -0
  101. package/public-repo/plugins/README.md +9 -0
  102. package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
  103. package/public-repo/plugins/interf/.mcp.json +12 -0
  104. package/public-repo/plugins/interf/README.md +29 -0
  105. package/public-repo/plugins/interf/skills/interf/SKILL.md +477 -0
  106. package/public-repo/skills/interf/SKILL.md +477 -0
  107. package/agent-skills/interf-actions/SKILL.md +0 -185
  108. package/agent-skills/interf-actions/references/cli.md +0 -243
  109. package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
  110. package/dist/cli/commands/verify.d.ts +0 -10
  111. package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
  112. package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
  113. package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +0 -1
  114. package/dist/compiler-ui/_next/static/chunks/0_c_tvh-cukjz.css +0 -3
  115. package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +0 -1
  116. package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
  117. package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
  118. package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +0 -114
  119. package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
  120. package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
  121. package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
  122. package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
  123. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_buildManifest.js +0 -0
  124. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_clientMiddlewareManifest.js +0 -0
  125. /package/dist/compiler-ui/_next/static/{6qyE1u9m_oBUkvAhhoCmO → tYHMLL9oKds1yDoNYgkPV}/_ssgManifest.js +0 -0
  126. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/structure/SKILL.md +0 -0
  127. /package/{builtin-methods → public-repo/methods}/interf-default/compile/stages/summarize/SKILL.md +0 -0
  128. /package/{builtin-methods → public-repo/methods}/interf-default/improve/SKILL.md +0 -0
  129. /package/{builtin-methods → public-repo/methods}/interf-default/method.schema.json +0 -0
@@ -302,6 +302,7 @@ export declare const PreparationCompileRunListResponseSchema: z.ZodObject<{
302
302
  "portable-context": "portable-context";
303
303
  "preparation-config": "preparation-config";
304
304
  "compile-run": "compile-run";
305
+ "artifact-checks": "artifact-checks";
305
306
  "readiness-checks": "readiness-checks";
306
307
  "checks-current": "checks-current";
307
308
  }>;
@@ -349,6 +350,7 @@ export declare const PreparationCompileRunListResponseSchema: z.ZodObject<{
349
350
  "portable-context": "portable-context";
350
351
  "preparation-config": "preparation-config";
351
352
  "compile-run": "compile-run";
353
+ "artifact-checks": "artifact-checks";
352
354
  "readiness-checks": "readiness-checks";
353
355
  "checks-current": "checks-current";
354
356
  }>;
@@ -424,6 +426,7 @@ export declare const PreparationCompileRunListResponseSchema: z.ZodObject<{
424
426
  "portable-context": "portable-context";
425
427
  "preparation-config": "preparation-config";
426
428
  "compile-run": "compile-run";
429
+ "artifact-checks": "artifact-checks";
427
430
  "readiness-checks": "readiness-checks";
428
431
  "checks-current": "checks-current";
429
432
  }>;
@@ -471,6 +474,7 @@ export declare const PreparationCompileRunListResponseSchema: z.ZodObject<{
471
474
  "portable-context": "portable-context";
472
475
  "preparation-config": "preparation-config";
473
476
  "compile-run": "compile-run";
477
+ "artifact-checks": "artifact-checks";
474
478
  "readiness-checks": "readiness-checks";
475
479
  "checks-current": "checks-current";
476
480
  }>;
@@ -531,7 +535,7 @@ export type PreparationCompileRunListResponse = z.infer<typeof PreparationCompil
531
535
  * can render an actionable error rather than a stack trace.
532
536
  *
533
537
  * `issues` is typed as `unknown[]` so the class works across both
534
- * `zod` dependency trees in the monorepo (root + `apps/compiler-ui`).
538
+ * `zod` dependency trees in the monorepo (root + `src/apps/compiler-ui`).
535
539
  * Callers cast or render structurally as needed.
536
540
  */
537
541
  export declare class WireShapeError extends Error {
@@ -36,7 +36,7 @@ export const PreparationCompileRunListResponseSchema = z.object({
36
36
  * can render an actionable error rather than a stack trace.
37
37
  *
38
38
  * `issues` is typed as `unknown[]` so the class works across both
39
- * `zod` dependency trees in the monorepo (root + `apps/compiler-ui`).
39
+ * `zod` dependency trees in the monorepo (root + `src/apps/compiler-ui`).
40
40
  * Callers cast or render structurally as needed.
41
41
  */
42
42
  export class WireShapeError extends Error {
@@ -1,7 +1,7 @@
1
1
  import { type MethodAuthoringArtifactRequirement } from "../../engine/agents/lib/shells.js";
2
2
  import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
3
3
  import { validateMethodPackage } from "../package/local-methods.js";
4
- import type { SourceReadinessCheck } from "../../project/lib/schema.js";
4
+ import type { RequestedArtifact, SourceProfile, SourceReadinessCheck } from "../../project/lib/schema.js";
5
5
  /**
6
6
  * Walk method.json after a successful authoring run and fill in
7
7
  * `role: "general"` for any stage missing a role field. Custom role
@@ -27,6 +27,8 @@ export declare function runMethodAuthoringDraft(options: {
27
27
  hint: string;
28
28
  taskPrompt: string;
29
29
  checks?: SourceReadinessCheck[];
30
+ requestedArtifacts?: RequestedArtifact[];
31
+ sourceProfile?: SourceProfile | null;
30
32
  artifactRequirements?: MethodAuthoringArtifactRequirement[];
31
33
  executor: MethodExecutor;
32
34
  onStatus?: (line: string) => void;
@@ -78,7 +78,7 @@ function buildMethodAuthoringPrompt() {
78
78
  "Do not preserve the placeholder `prepare` stage unless the final Method genuinely needs a stage with that exact role.",
79
79
  "Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
80
80
  "Use only the CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases.",
81
- "Keep Artifact checks and the producing stage docs aligned: every checked output requirement must be described in the stage doc that writes that Artifact.",
81
+ "Keep Artifact checks aligned with produced outputs. Use stage docs to describe the output contract, but do not turn source-specific user wording into brittle stage-doc wording requirements.",
82
82
  "For every stage in `method.json`, create `method/compile/stages/<skill_dir>/SKILL.md` and make the folder name exactly match that stage's kebab-case `skill_dir`.",
83
83
  "Every Artifact path in `method.schema.json` must be unique and non-overlapping.",
84
84
  "Make the package materially specific to this Preparation task, output shape, and proof requirement. A no-op scaffold is not acceptable.",
@@ -116,39 +116,7 @@ function checkMatchesRequirement(actual, required) {
116
116
  function producingStagesForArtifact(definition, artifactId) {
117
117
  return (definition.stages ?? []).filter((stage) => Array.isArray(stage.writes) && stage.writes.includes(artifactId));
118
118
  }
119
- function readProducingStageDocs(methodPath, stages) {
120
- return stages
121
- .map((stage) => join(methodPath, "compile", "stages", stage.skill_dir ?? stage.id, "SKILL.md"))
122
- .filter((filePath) => existsSync(filePath))
123
- .map((filePath) => readFileSync(filePath, "utf8"))
124
- .join("\n");
125
- }
126
- function validateMustContainStageDocs(methodPath, definition) {
127
- const artifacts = definition.method_schema.artifacts ?? [];
128
- const errors = [];
129
- for (const artifact of artifacts) {
130
- const producingStages = producingStagesForArtifact(definition, artifact.id);
131
- if (producingStages.length === 0)
132
- continue;
133
- const producingStageDocs = readProducingStageDocs(methodPath, producingStages);
134
- for (const check of artifact.checks ?? []) {
135
- if (check.kind !== "must_contain")
136
- continue;
137
- const phrases = check.params?.phrases;
138
- if (!Array.isArray(phrases))
139
- continue;
140
- for (const phrase of phrases) {
141
- if (typeof phrase !== "string")
142
- continue;
143
- if (!producingStageDocs.includes(phrase)) {
144
- errors.push(`Artifact \`${artifact.id}\` check \`${check.id}\` requires phrase not present in producing stage docs.`);
145
- }
146
- }
147
- }
148
- }
149
- return errors;
150
- }
151
- function validateArtifactRequirements(methodPath, definition, requirements) {
119
+ function validateArtifactRequirements(definition, requirements) {
152
120
  const artifacts = definition.method_schema.artifacts ?? [];
153
121
  const errors = [];
154
122
  for (const requirement of requirements) {
@@ -197,8 +165,7 @@ function validateAuthoredMethodPackage(methodPath, artifactRequirements = []) {
197
165
  if (placeholderPurpose) {
198
166
  errors.push("Authored Method still contains the neutral scaffold purpose.");
199
167
  }
200
- errors.push(...validateArtifactRequirements(methodPath, definition, artifactRequirements));
201
- errors.push(...validateMustContainStageDocs(methodPath, definition));
168
+ errors.push(...validateArtifactRequirements(definition, artifactRequirements));
202
169
  return {
203
170
  ok: validation.ok && errors.length === 0,
204
171
  summary: errors.length === 0
@@ -223,6 +190,8 @@ export async function runMethodAuthoringDraft(options) {
223
190
  sourceFolderPath: options.sourceFolderPath,
224
191
  taskPrompt: options.taskPrompt,
225
192
  checks: options.checks ?? [],
193
+ requestedArtifacts: options.requestedArtifacts ?? [],
194
+ sourceProfile: options.sourceProfile ?? null,
226
195
  artifactRequirements: options.artifactRequirements ?? [],
227
196
  });
228
197
  const session = await runMethodEditSession({
@@ -28,7 +28,7 @@ const BuiltinMethodPackageSchema = z.object({
28
28
  stages: z.array(BuiltinMethodStageSchema).min(1),
29
29
  });
30
30
  let builtinCompiledContractCache = null;
31
- const BUILTIN_DEFAULT_METHOD_ROOT = join(PACKAGE_ROOT, "builtin-methods", "interf-default");
31
+ const BUILTIN_DEFAULT_METHOD_ROOT = join(PACKAGE_ROOT, "public-repo", "methods", "interf-default");
32
32
  function assertBuiltinArtifactId(value) {
33
33
  if (!BUILTIN_ARTIFACT_ID_SET.has(value)) {
34
34
  throw new Error(`Built-in Interf Method schema declares unsupported Artifact id "${value}".`);
@@ -43,6 +43,7 @@ export declare function mergeStagePolicyNotesForStages(stages: readonly {
43
43
  export declare function builtinMethodPackagePath(methodId: string): string;
44
44
  export declare function methodDefinitionPath(prepDataDir: string, id: string): string;
45
45
  export declare function loadMethodDefinitionFromDir(dirPath: string): LocalMethodDefinition | null;
46
+ export declare function isNeutralScaffoldMethodDefinition(definition: Pick<LocalMethodDefinition, "purpose" | "stages" | "method_schema">): boolean;
46
47
  export declare function listLocalMethodDefinitions(prepDataDir: string): LocalMethodDefinition[];
47
48
  export declare function loadLocalMethodDefinition(prepDataDir: string, id: string): LocalMethodDefinition | null;
48
49
  export declare function resolveMethodPackageSourcePath(prepDataDir: string, methodId: string): string | null;
@@ -66,7 +66,7 @@ function methodRootPath(prepDataDir) {
66
66
  return preparationMethodsRoot(asPreparationDataDir(prepDataDir));
67
67
  }
68
68
  export function builtinMethodPackagePath(methodId) {
69
- return join(PACKAGE_ROOT, "builtin-methods", methodId);
69
+ return join(PACKAGE_ROOT, "public-repo", "methods", methodId);
70
70
  }
71
71
  export function methodDefinitionPath(prepDataDir, id) {
72
72
  return join(methodRootPath(prepDataDir), id);
@@ -139,6 +139,16 @@ export function loadMethodDefinitionFromDir(dirPath) {
139
139
  methodSchemaPath: contextInterfaceFilePath(dirPath),
140
140
  };
141
141
  }
142
+ export function isNeutralScaffoldMethodDefinition(definition) {
143
+ const hasScaffoldPurpose = definition.purpose?.label === "From-scratch Method draft" ||
144
+ Boolean(definition.purpose?.task_hint?.includes("Replace this neutral scaffold"));
145
+ const hasScaffoldStage = Boolean(definition.stages?.some((stage) => stage.id === "prepare" &&
146
+ stage.contract_type === "method-draft-stage" &&
147
+ stage.writes.includes("draft-context")));
148
+ const hasScaffoldArtifact = listContextInterfaceArtifacts(definition.method_schema).some((artifact) => artifact.id === "draft-context" &&
149
+ artifact.description.includes("neutral authoring scaffold"));
150
+ return hasScaffoldPurpose || hasScaffoldStage || hasScaffoldArtifact;
151
+ }
142
152
  export function listLocalMethodDefinitions(prepDataDir) {
143
153
  const definitions = new Map();
144
154
  const root = methodRootPath(prepDataDir);
@@ -152,18 +162,23 @@ export function listLocalMethodDefinitions(prepDataDir) {
152
162
  continue;
153
163
  }
154
164
  const definition = loadMethodDefinitionFromDir(entryPath);
155
- if (definition)
165
+ if (definition && !isNeutralScaffoldMethodDefinition(definition)) {
156
166
  definitions.set(definition.id, definition);
167
+ }
157
168
  }
158
169
  }
159
170
  return [...definitions.values()].sort((a, b) => a.label.localeCompare(b.label));
160
171
  }
161
172
  export function loadLocalMethodDefinition(prepDataDir, id) {
162
- return loadMethodDefinitionFromDir(methodDefinitionPath(prepDataDir, id));
173
+ const definition = loadMethodDefinitionFromDir(methodDefinitionPath(prepDataDir, id));
174
+ if (!definition || isNeutralScaffoldMethodDefinition(definition))
175
+ return null;
176
+ return definition;
163
177
  }
164
178
  export function resolveMethodPackageSourcePath(prepDataDir, methodId) {
165
179
  const localPath = methodDefinitionPath(prepDataDir, methodId);
166
- if (loadMethodDefinitionFromDir(localPath))
180
+ const local = loadMethodDefinitionFromDir(localPath);
181
+ if (local && !isNeutralScaffoldMethodDefinition(local))
167
182
  return localPath;
168
183
  const builtinPath = builtinMethodPackagePath(methodId);
169
184
  if (loadMethodDefinitionFromDir(builtinPath))
@@ -61,7 +61,7 @@ function getBuiltinDefaultMethod() {
61
61
  return builtinDefaultMethodCache;
62
62
  const local = loadMethodDefinitionFromDir(builtinMethodPackagePath(DEFAULT_METHOD_ID));
63
63
  if (!local) {
64
- throw new Error(`Missing built-in Interf Method package at builtin-methods/${DEFAULT_METHOD_ID}.`);
64
+ throw new Error(`Missing built-in Interf Method package at public-repo/methods/${DEFAULT_METHOD_ID}.`);
65
65
  }
66
66
  const resolved = standaloneMethodDefinitionFromLocalPackage(local);
67
67
  builtinDefaultMethodCache = {
@@ -80,7 +80,7 @@ export function listPortableContextsForSourceFolder(prepDataDir) {
80
80
  return [];
81
81
  }
82
82
  catch (error) {
83
- warnInterf(`Warning: failed to inspect Interf Workspace at ${prepDataDir}: ${error instanceof Error ? error.message : String(error)}`);
83
+ warnInterf(`Warning: failed to inspect Interf preparation data folder at ${prepDataDir}: ${error instanceof Error ? error.message : String(error)}`);
84
84
  return [];
85
85
  }
86
86
  return readdirSync(prepDataDir)
@@ -100,7 +100,7 @@ export function assertCompiledContainer(prepDataDir) {
100
100
  if (existsSync(prepDataDir)) {
101
101
  const stat = statSync(prepDataDir);
102
102
  if (!stat.isDirectory()) {
103
- throw new Error(`Interf Workspace exists and is not a directory: ${prepDataDir}`);
103
+ throw new Error(`Interf preparation data folder exists and is not a directory: ${prepDataDir}`);
104
104
  }
105
105
  const unexpectedRootEntries = readdirSync(prepDataDir).filter((entry) => {
106
106
  if (entry.startsWith("."))
@@ -121,7 +121,7 @@ export function assertCompiledContainer(prepDataDir) {
121
121
  return !statSync(entryPath).isDirectory();
122
122
  }
123
123
  catch (error) {
124
- warnInterf(`Warning: failed to inspect Interf Workspace path at ${entryPath}: ${error instanceof Error ? error.message : String(error)}`);
124
+ warnInterf(`Warning: failed to inspect Interf preparation data path at ${entryPath}: ${error instanceof Error ? error.message : String(error)}`);
125
125
  return true;
126
126
  }
127
127
  }
@@ -134,7 +134,7 @@ export function assertCompiledContainer(prepDataDir) {
134
134
  }
135
135
  });
136
136
  if (unexpectedRootEntries.length > 0) {
137
- throw new Error(`Interf Workspace contains unexpected entries: ${prepDataDir}`);
137
+ throw new Error(`Interf preparation data folder contains unexpected entries: ${prepDataDir}`);
138
138
  }
139
139
  }
140
140
  if (!existsSync(prepDataDir)) {
@@ -142,7 +142,7 @@ export function assertCompiledContainer(prepDataDir) {
142
142
  }
143
143
  const stat = statSync(prepDataDir);
144
144
  if (!stat.isDirectory()) {
145
- throw new Error(`Interf Workspace exists and is not a directory: ${prepDataDir}`);
145
+ throw new Error(`Interf preparation data folder exists and is not a directory: ${prepDataDir}`);
146
146
  }
147
147
  const unexpectedEntries = readdirSync(prepDataDir).filter((entry) => {
148
148
  if (entry.startsWith("."))
@@ -172,7 +172,7 @@ export function assertCompiledContainer(prepDataDir) {
172
172
  return false;
173
173
  });
174
174
  if (unexpectedEntries.length > 0) {
175
- throw new Error(`Interf Workspace contains invalid Preparation entries: ${prepDataDir}`);
175
+ throw new Error(`Interf preparation data folder contains invalid Preparation entries: ${prepDataDir}`);
176
176
  }
177
177
  return prepDataDir;
178
178
  }
@@ -14,6 +14,95 @@ export declare const SourceReadinessCheckSchema: z.ZodObject<{
14
14
  }, z.core.$strip>>;
15
15
  strictness: z.ZodOptional<z.ZodString>;
16
16
  }, z.core.$strict>;
17
+ export declare const RequestedArtifactCheckSchema: z.ZodObject<{
18
+ label: z.ZodString;
19
+ }, z.core.$loose>;
20
+ export declare const RequestedArtifactOutputSchema: z.ZodObject<{
21
+ path: z.ZodOptional<z.ZodString>;
22
+ shape: z.ZodOptional<z.ZodObject<{
23
+ kind: z.ZodLiteral<"path">;
24
+ path: z.ZodString;
25
+ artifact_kind: z.ZodEnum<{
26
+ file: "file";
27
+ directory: "directory";
28
+ }>;
29
+ }, z.core.$strict>>;
30
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
31
+ id: z.ZodString;
32
+ kind: z.ZodEnum<{
33
+ file_exists: "file_exists";
34
+ min_file_count: "min_file_count";
35
+ min_file_count_matches_source: "min_file_count_matches_source";
36
+ frontmatter_valid: "frontmatter_valid";
37
+ frontmatter_required_keys: "frontmatter_required_keys";
38
+ wikilinks_valid: "wikilinks_valid";
39
+ must_not_contain: "must_not_contain";
40
+ must_contain: "must_contain";
41
+ qa_match: "qa_match";
42
+ }>;
43
+ description: z.ZodOptional<z.ZodString>;
44
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
45
+ required: z.ZodDefault<z.ZodBoolean>;
46
+ }, z.core.$strict>>>;
47
+ stage_hint: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ export declare const RequestedArtifactSchema: z.ZodPreprocess<z.ZodObject<{
50
+ id: z.ZodOptional<z.ZodString>;
51
+ title: z.ZodString;
52
+ purpose: z.ZodOptional<z.ZodString>;
53
+ description: z.ZodOptional<z.ZodString>;
54
+ checks: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
55
+ label: z.ZodString;
56
+ }, z.core.$loose>]>>>;
57
+ output: z.ZodOptional<z.ZodObject<{
58
+ path: z.ZodOptional<z.ZodString>;
59
+ shape: z.ZodOptional<z.ZodObject<{
60
+ kind: z.ZodLiteral<"path">;
61
+ path: z.ZodString;
62
+ artifact_kind: z.ZodEnum<{
63
+ file: "file";
64
+ directory: "directory";
65
+ }>;
66
+ }, z.core.$strict>>;
67
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ kind: z.ZodEnum<{
70
+ file_exists: "file_exists";
71
+ min_file_count: "min_file_count";
72
+ min_file_count_matches_source: "min_file_count_matches_source";
73
+ frontmatter_valid: "frontmatter_valid";
74
+ frontmatter_required_keys: "frontmatter_required_keys";
75
+ wikilinks_valid: "wikilinks_valid";
76
+ must_not_contain: "must_not_contain";
77
+ must_contain: "must_contain";
78
+ qa_match: "qa_match";
79
+ }>;
80
+ description: z.ZodOptional<z.ZodString>;
81
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
82
+ required: z.ZodDefault<z.ZodBoolean>;
83
+ }, z.core.$strict>>>;
84
+ stage_hint: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strict>>;
86
+ }, z.core.$strict>>;
87
+ export declare const SourceProfileItemSchema: z.ZodObject<{
88
+ name: z.ZodOptional<z.ZodString>;
89
+ path: z.ZodOptional<z.ZodString>;
90
+ kind: z.ZodOptional<z.ZodString>;
91
+ page_count: z.ZodOptional<z.ZodNumber>;
92
+ note: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$loose>;
94
+ export declare const SourceProfileSchema: z.ZodObject<{
95
+ summary: z.ZodOptional<z.ZodString>;
96
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
97
+ name: z.ZodOptional<z.ZodString>;
98
+ path: z.ZodOptional<z.ZodString>;
99
+ kind: z.ZodOptional<z.ZodString>;
100
+ page_count: z.ZodOptional<z.ZodNumber>;
101
+ note: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$loose>>>;
103
+ observations: z.ZodDefault<z.ZodArray<z.ZodString>>;
104
+ limitations: z.ZodDefault<z.ZodArray<z.ZodString>>;
105
+ }, z.core.$loose>;
17
106
  export declare const SourcePreparationConfigSchema: z.ZodObject<{
18
107
  id: z.ZodOptional<z.ZodString>;
19
108
  name: z.ZodString;
@@ -35,6 +124,56 @@ export declare const SourcePreparationConfigSchema: z.ZodObject<{
35
124
  }, z.core.$strip>>;
36
125
  strictness: z.ZodOptional<z.ZodString>;
37
126
  }, z.core.$strict>>>;
127
+ requested_artifacts: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
128
+ id: z.ZodOptional<z.ZodString>;
129
+ title: z.ZodString;
130
+ purpose: z.ZodOptional<z.ZodString>;
131
+ description: z.ZodOptional<z.ZodString>;
132
+ checks: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
133
+ label: z.ZodString;
134
+ }, z.core.$loose>]>>>;
135
+ output: z.ZodOptional<z.ZodObject<{
136
+ path: z.ZodOptional<z.ZodString>;
137
+ shape: z.ZodOptional<z.ZodObject<{
138
+ kind: z.ZodLiteral<"path">;
139
+ path: z.ZodString;
140
+ artifact_kind: z.ZodEnum<{
141
+ file: "file";
142
+ directory: "directory";
143
+ }>;
144
+ }, z.core.$strict>>;
145
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
146
+ id: z.ZodString;
147
+ kind: z.ZodEnum<{
148
+ file_exists: "file_exists";
149
+ min_file_count: "min_file_count";
150
+ min_file_count_matches_source: "min_file_count_matches_source";
151
+ frontmatter_valid: "frontmatter_valid";
152
+ frontmatter_required_keys: "frontmatter_required_keys";
153
+ wikilinks_valid: "wikilinks_valid";
154
+ must_not_contain: "must_not_contain";
155
+ must_contain: "must_contain";
156
+ qa_match: "qa_match";
157
+ }>;
158
+ description: z.ZodOptional<z.ZodString>;
159
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
160
+ required: z.ZodDefault<z.ZodBoolean>;
161
+ }, z.core.$strict>>>;
162
+ stage_hint: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strict>>;
164
+ }, z.core.$strict>>>>;
165
+ source_profile: z.ZodOptional<z.ZodObject<{
166
+ summary: z.ZodOptional<z.ZodString>;
167
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
168
+ name: z.ZodOptional<z.ZodString>;
169
+ path: z.ZodOptional<z.ZodString>;
170
+ kind: z.ZodOptional<z.ZodString>;
171
+ page_count: z.ZodOptional<z.ZodNumber>;
172
+ note: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$loose>>>;
174
+ observations: z.ZodDefault<z.ZodArray<z.ZodString>>;
175
+ limitations: z.ZodDefault<z.ZodArray<z.ZodString>>;
176
+ }, z.core.$loose>>;
38
177
  }, z.core.$strict>;
39
178
  export declare const SourceFolderBindingSchema: z.ZodObject<{
40
179
  path: z.ZodString;
@@ -124,10 +263,64 @@ export declare const SourceFolderConfigSchema: z.ZodObject<{
124
263
  }, z.core.$strip>>;
125
264
  strictness: z.ZodOptional<z.ZodString>;
126
265
  }, z.core.$strict>>>;
266
+ requested_artifacts: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{
267
+ id: z.ZodOptional<z.ZodString>;
268
+ title: z.ZodString;
269
+ purpose: z.ZodOptional<z.ZodString>;
270
+ description: z.ZodOptional<z.ZodString>;
271
+ checks: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
272
+ label: z.ZodString;
273
+ }, z.core.$loose>]>>>;
274
+ output: z.ZodOptional<z.ZodObject<{
275
+ path: z.ZodOptional<z.ZodString>;
276
+ shape: z.ZodOptional<z.ZodObject<{
277
+ kind: z.ZodLiteral<"path">;
278
+ path: z.ZodString;
279
+ artifact_kind: z.ZodEnum<{
280
+ file: "file";
281
+ directory: "directory";
282
+ }>;
283
+ }, z.core.$strict>>;
284
+ checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
285
+ id: z.ZodString;
286
+ kind: z.ZodEnum<{
287
+ file_exists: "file_exists";
288
+ min_file_count: "min_file_count";
289
+ min_file_count_matches_source: "min_file_count_matches_source";
290
+ frontmatter_valid: "frontmatter_valid";
291
+ frontmatter_required_keys: "frontmatter_required_keys";
292
+ wikilinks_valid: "wikilinks_valid";
293
+ must_not_contain: "must_not_contain";
294
+ must_contain: "must_contain";
295
+ qa_match: "qa_match";
296
+ }>;
297
+ description: z.ZodOptional<z.ZodString>;
298
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
299
+ required: z.ZodDefault<z.ZodBoolean>;
300
+ }, z.core.$strict>>>;
301
+ stage_hint: z.ZodOptional<z.ZodString>;
302
+ }, z.core.$strict>>;
303
+ }, z.core.$strict>>>>;
304
+ source_profile: z.ZodOptional<z.ZodObject<{
305
+ summary: z.ZodOptional<z.ZodString>;
306
+ items: z.ZodDefault<z.ZodArray<z.ZodObject<{
307
+ name: z.ZodOptional<z.ZodString>;
308
+ path: z.ZodOptional<z.ZodString>;
309
+ kind: z.ZodOptional<z.ZodString>;
310
+ page_count: z.ZodOptional<z.ZodNumber>;
311
+ note: z.ZodOptional<z.ZodString>;
312
+ }, z.core.$loose>>>;
313
+ observations: z.ZodDefault<z.ZodArray<z.ZodString>>;
314
+ limitations: z.ZodDefault<z.ZodArray<z.ZodString>>;
315
+ }, z.core.$loose>>;
127
316
  }, z.core.$strict>>>;
128
317
  }, z.core.$strict>;
129
318
  export type SourceFolderBinding = z.infer<typeof SourceFolderBindingSchema>;
319
+ export type RequestedArtifactCheck = z.infer<typeof RequestedArtifactCheckSchema>;
320
+ export type RequestedArtifact = z.infer<typeof RequestedArtifactSchema>;
321
+ export type RequestedArtifactOutput = z.infer<typeof RequestedArtifactOutputSchema>;
130
322
  export type SourceReadinessCheck = z.infer<typeof SourceReadinessCheckSchema>;
323
+ export type SourceProfile = z.infer<typeof SourceProfileSchema>;
131
324
  export type PreparationName = z.infer<typeof PreparationNameSchema>;
132
325
  export type MethodId = z.infer<typeof MethodIdSchema>;
133
326
  export type SourcePreparationConfig = z.infer<typeof SourcePreparationConfigSchema>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { isAbsolute, normalize } from "node:path";
3
- import { InterfIdPattern, MethodIdSchema, PreparationNameSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, } from "../../contracts/lib/schema.js";
3
+ import { ArtifactPathShapeSchema, CheckSchema, InterfIdPattern, MethodIdSchema, PreparationNameSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, } from "../../contracts/lib/schema.js";
4
4
  export { MethodIdSchema, PreparationNameSchema, } from "../../contracts/lib/schema.js";
5
5
  /**
6
6
  * Absolute paths that an attacker-controlled config must never reach. The
@@ -45,6 +45,49 @@ export const SourceReadinessCheckSchema = z.object({
45
45
  });
46
46
  }
47
47
  });
48
+ export const RequestedArtifactCheckSchema = z.object({
49
+ label: z.string().min(1),
50
+ }).passthrough();
51
+ export const RequestedArtifactOutputSchema = z.object({
52
+ path: z.string().min(1).optional(),
53
+ shape: ArtifactPathShapeSchema.optional(),
54
+ checks: z.array(CheckSchema).default([]),
55
+ stage_hint: z.string().min(1).optional(),
56
+ }).strict();
57
+ const RequestedArtifactObjectSchema = z.object({
58
+ id: z.string().min(1).optional(),
59
+ title: z.string().min(1),
60
+ purpose: z.string().min(1).optional(),
61
+ description: z.string().min(1).optional(),
62
+ checks: z.array(z.union([z.string().min(1), RequestedArtifactCheckSchema])).default([]),
63
+ output: RequestedArtifactOutputSchema.optional(),
64
+ }).strict();
65
+ export const RequestedArtifactSchema = z.preprocess((value) => {
66
+ if (!value || typeof value !== "object" || Array.isArray(value))
67
+ return value;
68
+ const record = value;
69
+ if (typeof record.title === "string" && record.title.trim().length > 0)
70
+ return value;
71
+ const title = typeof record.label === "string"
72
+ ? record.label
73
+ : typeof record.name === "string"
74
+ ? record.name
75
+ : null;
76
+ return title ? { ...record, title } : value;
77
+ }, RequestedArtifactObjectSchema);
78
+ export const SourceProfileItemSchema = z.object({
79
+ name: z.string().min(1).optional(),
80
+ path: z.string().min(1).optional(),
81
+ kind: z.string().min(1).optional(),
82
+ page_count: z.number().int().nonnegative().optional(),
83
+ note: z.string().min(1).optional(),
84
+ }).passthrough();
85
+ export const SourceProfileSchema = z.object({
86
+ summary: z.string().min(1).optional(),
87
+ items: z.array(SourceProfileItemSchema).default([]),
88
+ observations: z.array(z.string().min(1)).default([]),
89
+ limitations: z.array(z.string().min(1)).default([]),
90
+ }).passthrough();
48
91
  export const SourcePreparationConfigSchema = z.object({
49
92
  id: z.string().regex(InterfIdPattern).optional(),
50
93
  name: PreparationNameSchema,
@@ -62,6 +105,8 @@ export const SourcePreparationConfigSchema = z.object({
62
105
  max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
63
106
  max_loops: SourceCompiledMaxLoopsSchema.optional(),
64
107
  checks: z.array(SourceReadinessCheckSchema).default([]),
108
+ requested_artifacts: z.array(RequestedArtifactSchema).optional(),
109
+ source_profile: SourceProfileSchema.optional(),
65
110
  }).strict();
66
111
  export const SourceFolderBindingSchema = z.object({
67
112
  path: z.string().min(1),
@@ -128,6 +128,10 @@ function toWritableSourcePreparationConfig(preparation) {
128
128
  ...(typeof preparation.max_attempts === "number" ? { max_attempts: preparation.max_attempts } : {}),
129
129
  ...(typeof preparation.max_loops === "number" ? { max_loops: preparation.max_loops } : {}),
130
130
  checks: preparation.checks,
131
+ ...(preparation.requested_artifacts?.length
132
+ ? { requested_artifacts: preparation.requested_artifacts }
133
+ : {}),
134
+ ...(preparation.source_profile ? { source_profile: preparation.source_profile } : {}),
131
135
  };
132
136
  }
133
137
  export function saveSourceFolderConfig(prepDataDir, config) {
@@ -47,7 +47,7 @@ export function normalizeSourcePreparationPathForConfig(prepDataDir, value) {
47
47
  const resolvedPath = resolveSourcePreparationPath(prepDataDir, { path: trimmedValue });
48
48
  const relativePath = relative(prepDataDir, resolvedPath).split(sep).join("/") || ".";
49
49
  if (relativePath === ".") {
50
- throw new Error("Pick a Source Folder, not the Interf Workspace itself.");
50
+ throw new Error("Pick a Source Folder, not the Interf preparation data folder itself.");
51
51
  }
52
52
  if (isAbsolute(trimmedValue) && !isPathWithinRoot(prepDataDir, resolvedPath)) {
53
53
  if (!existsSync(resolvedPath)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@interf/compiler",
3
- "version": "0.18.0",
4
- "description": "Interf prepares data for agent work. It runs locally, processes your files, shows evidence that your data is ready, and writes portable context: a local folder with verifiable outputs agents can use.",
3
+ "version": "0.21.0",
4
+ "description": "Interf compiles source files into verifiable Artifacts and writes portable context agents can read.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "interf": "dist/bin.js"
@@ -19,11 +19,11 @@
19
19
  "scripts": {
20
20
  "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true});require('fs').rmSync('.tsbuildinfo',{force:true})\" && tsc && chmod 755 dist/bin.js",
21
21
  "dev": "tsc --watch",
22
- "web:dev": "npm --prefix apps/compiler-ui run dev",
23
- "web:typecheck": "npm --prefix apps/compiler-ui run typecheck",
22
+ "web:dev": "npm --prefix src/apps/compiler-ui run dev",
23
+ "web:typecheck": "npm --prefix src/apps/compiler-ui run typecheck",
24
24
  "web:build": "node scripts/web/build-compiler-ui.mjs",
25
- "docs:sync-agent-skill-cli-reference": "npm run build && node scripts/docs/sync-agent-skill-cli-reference.mjs",
26
- "docs:check-agent-skill-cli-reference": "npm run build && node scripts/docs/sync-agent-skill-cli-reference.mjs --check",
25
+ "docs:sync-public": "node scripts/docs/sync-public-repo.mjs",
26
+ "docs:check-public": "node scripts/docs/sync-public-repo.mjs --check",
27
27
  "test:smoke": "npm run build && node --test test/**/*.test.mjs",
28
28
  "test": "npm run test:smoke",
29
29
  "test:full": "npm test && npm run web:build",
@@ -40,8 +40,7 @@
40
40
  },
41
41
  "files": [
42
42
  "dist",
43
- "builtin-methods",
44
- "agent-skills",
43
+ "public-repo",
45
44
  "LICENSE.md",
46
45
  "TRADEMARKS.md"
47
46
  ],