@interf/compiler 0.5.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -201
- package/builtin-workflows/interf/README.md +22 -10
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +8 -5
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
- package/builtin-workflows/interf/improve/SKILL.md +4 -4
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +19 -5
- package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +10 -3
- package/dist/bin.js +2 -28
- package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
- package/dist/{commands → cli/commands}/check-draft.js +13 -13
- package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
- package/dist/{commands → cli/commands}/compile-controller.js +39 -44
- package/dist/cli/commands/compile.d.ts +33 -0
- package/dist/{commands → cli/commands}/compile.js +107 -33
- package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
- package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
- package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +20 -2
- package/dist/cli/commands/create-workflow-wizard.js +288 -0
- package/dist/{commands → cli/commands}/create.d.ts +2 -2
- package/dist/cli/commands/create.js +166 -0
- package/dist/cli/commands/dataset-selection.d.ts +6 -0
- package/dist/cli/commands/dataset-selection.js +11 -0
- package/dist/{commands → cli/commands}/default.js +5 -5
- package/dist/{commands → cli/commands}/doctor.js +12 -13
- package/dist/{commands → cli/commands}/executor-flow.d.ts +2 -2
- package/dist/{commands → cli/commands}/executor-flow.js +17 -17
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/{commands → cli/commands}/init.js +202 -109
- package/dist/{commands → cli/commands}/list.js +9 -6
- package/dist/{commands → cli/commands}/reset.js +5 -5
- package/dist/{commands → cli/commands}/source-config-wizard.d.ts +10 -5
- package/dist/{commands → cli/commands}/source-config-wizard.js +202 -95
- package/dist/{commands → cli/commands}/status.js +20 -11
- package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
- package/dist/{commands → cli/commands}/test-flow.js +30 -26
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/{commands → cli/commands}/test.js +48 -40
- package/dist/{commands → cli/commands}/verify.js +4 -4
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.js +33 -0
- package/dist/index.d.ts +22 -11
- package/dist/index.js +15 -6
- package/dist/lib/agent-args.d.ts +1 -3
- package/dist/lib/agent-args.js +1 -42
- package/dist/lib/agent-constants.d.ts +1 -5
- package/dist/lib/agent-constants.js +1 -28
- package/dist/lib/agent-detection.d.ts +1 -7
- package/dist/lib/agent-detection.js +1 -65
- package/dist/lib/agent-execution.d.ts +1 -2
- package/dist/lib/agent-execution.js +1 -242
- package/dist/lib/agent-logs.d.ts +1 -2
- package/dist/lib/agent-logs.js +1 -17
- package/dist/lib/agent-preflight.d.ts +1 -7
- package/dist/lib/agent-preflight.js +1 -76
- package/dist/lib/agent-render.d.ts +1 -8
- package/dist/lib/agent-render.js +1 -218
- package/dist/lib/agent-shells.d.ts +1 -44
- package/dist/lib/agent-shells.js +1 -847
- package/dist/lib/agent-status.d.ts +1 -3
- package/dist/lib/agent-status.js +1 -58
- package/dist/lib/agent-types.d.ts +1 -30
- package/dist/lib/agent-types.js +1 -1
- package/dist/lib/agents.d.ts +1 -6
- package/dist/lib/agents.js +1 -5
- package/dist/lib/builtin-compiled-workflow.d.ts +1 -129
- package/dist/lib/builtin-compiled-workflow.js +1 -153
- package/dist/lib/compiled-compile.d.ts +1 -52
- package/dist/lib/compiled-compile.js +1 -274
- package/dist/lib/compiled-paths.d.ts +1 -39
- package/dist/lib/compiled-paths.js +3 -103
- package/dist/lib/compiled-raw.d.ts +1 -49
- package/dist/lib/compiled-raw.js +3 -102
- package/dist/lib/compiled-reset.d.ts +1 -1
- package/dist/lib/compiled-reset.js +3 -44
- package/dist/lib/compiled-schema.d.ts +1 -27
- package/dist/lib/compiled-schema.js +1 -110
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +2 -2
- package/dist/lib/execution-profile.d.ts +1 -17
- package/dist/lib/execution-profile.js +1 -84
- package/dist/lib/executors.d.ts +1 -32
- package/dist/lib/executors.js +1 -43
- package/dist/lib/interf-bootstrap.d.ts +1 -3
- package/dist/lib/interf-bootstrap.js +3 -18
- package/dist/lib/interf-detect.d.ts +1 -33
- package/dist/lib/interf-detect.js +3 -176
- package/dist/lib/interf-scaffold.d.ts +1 -2
- package/dist/lib/interf-scaffold.js +3 -121
- package/dist/lib/interf-workflow-package.d.ts +1 -20
- package/dist/lib/interf-workflow-package.js +1 -276
- package/dist/lib/interf.d.ts +1 -5
- package/dist/lib/interf.js +3 -4
- package/dist/lib/local-workflows.d.ts +1 -53
- package/dist/lib/local-workflows.js +1 -399
- package/dist/lib/package-root.d.ts +1 -0
- package/dist/lib/package-root.js +1 -0
- package/dist/lib/project-paths.d.ts +1 -11
- package/dist/lib/project-paths.js +3 -32
- package/dist/lib/runtime-acceptance.d.ts +1 -9
- package/dist/lib/runtime-acceptance.js +1 -257
- package/dist/lib/runtime-contracts.d.ts +1 -2
- package/dist/lib/runtime-contracts.js +1 -47
- package/dist/lib/runtime-inventory.d.ts +1 -7
- package/dist/lib/runtime-inventory.js +1 -29
- package/dist/lib/runtime-paths.d.ts +1 -7
- package/dist/lib/runtime-paths.js +1 -23
- package/dist/lib/runtime-prompt.d.ts +1 -2
- package/dist/lib/runtime-prompt.js +1 -46
- package/dist/lib/runtime-reconcile.d.ts +1 -2
- package/dist/lib/runtime-reconcile.js +1 -156
- package/dist/lib/runtime-runs.d.ts +1 -11
- package/dist/lib/runtime-runs.js +1 -250
- package/dist/lib/runtime-types.d.ts +1 -43
- package/dist/lib/runtime-types.js +1 -1
- package/dist/lib/runtime.d.ts +1 -6
- package/dist/lib/runtime.js +1 -5
- package/dist/lib/schema.d.ts +4 -1016
- package/dist/lib/schema.js +6 -539
- package/dist/lib/source-config.d.ts +1 -39
- package/dist/lib/source-config.js +3 -293
- package/dist/lib/state-artifacts.d.ts +1 -8
- package/dist/lib/state-artifacts.js +1 -13
- package/dist/lib/state-health.d.ts +1 -4
- package/dist/lib/state-health.js +1 -132
- package/dist/lib/state-io.d.ts +1 -10
- package/dist/lib/state-io.js +1 -76
- package/dist/lib/state-paths.d.ts +1 -4
- package/dist/lib/state-paths.js +1 -13
- package/dist/lib/state-view.d.ts +1 -4
- package/dist/lib/state-view.js +1 -103
- package/dist/lib/state.d.ts +1 -6
- package/dist/lib/state.js +1 -5
- package/dist/lib/test-execution.d.ts +1 -14
- package/dist/lib/test-execution.js +3 -525
- package/dist/lib/test-matrices.d.ts +1 -90
- package/dist/lib/test-matrices.js +3 -96
- package/dist/lib/test-paths.d.ts +1 -12
- package/dist/lib/test-paths.js +3 -59
- package/dist/lib/test-profile-presets.d.ts +1 -57
- package/dist/lib/test-profile-presets.js +3 -50
- package/dist/lib/test-sandbox.d.ts +1 -11
- package/dist/lib/test-sandbox.js +3 -105
- package/dist/lib/test-specs.d.ts +1 -7
- package/dist/lib/test-specs.js +3 -114
- package/dist/lib/test-targets.d.ts +1 -5
- package/dist/lib/test-targets.js +3 -38
- package/dist/lib/test-types.d.ts +1 -17
- package/dist/lib/test-types.js +3 -1
- package/dist/lib/test.d.ts +1 -4
- package/dist/lib/test.js +3 -3
- package/dist/lib/validate-compiled.d.ts +1 -27
- package/dist/lib/validate-compiled.js +1 -238
- package/dist/lib/validate-helpers.d.ts +1 -12
- package/dist/lib/validate-helpers.js +1 -41
- package/dist/lib/validate.d.ts +1 -19
- package/dist/lib/validate.js +1 -256
- package/dist/lib/workflow-authoring.d.ts +1 -0
- package/dist/lib/workflow-authoring.js +1 -0
- package/dist/lib/workflow-definitions.d.ts +1 -68
- package/dist/lib/workflow-definitions.js +1 -206
- package/dist/lib/workflow-edit-session.d.ts +1 -0
- package/dist/lib/workflow-edit-session.js +1 -0
- package/dist/lib/workflow-edit-utils.d.ts +1 -0
- package/dist/lib/workflow-edit-utils.js +1 -0
- package/dist/lib/workflow-helpers.d.ts +1 -38
- package/dist/lib/workflow-helpers.js +1 -167
- package/dist/lib/workflow-improvement.d.ts +1 -22
- package/dist/lib/workflow-improvement.js +1 -396
- package/dist/lib/workflow-primitives.d.ts +1 -2
- package/dist/lib/workflow-primitives.js +1 -5
- package/dist/lib/workflow-review-paths.d.ts +1 -10
- package/dist/lib/workflow-review-paths.js +1 -27
- package/dist/lib/workflow-stage-policy.d.ts +1 -0
- package/dist/lib/workflow-stage-policy.js +1 -0
- package/dist/lib/workflow-stage-runner.d.ts +1 -41
- package/dist/lib/workflow-stage-runner.js +1 -109
- package/dist/lib/workflows.d.ts +1 -15
- package/dist/lib/workflows.js +1 -31
- package/dist/packages/agents/index.d.ts +17 -0
- package/dist/packages/agents/index.js +15 -0
- package/dist/packages/agents/lib/agents.d.ts +6 -0
- package/dist/packages/agents/lib/agents.js +5 -0
- package/dist/packages/agents/lib/args.d.ts +4 -0
- package/dist/packages/agents/lib/args.js +52 -0
- package/dist/packages/agents/lib/constants.d.ts +5 -0
- package/dist/packages/agents/lib/constants.js +28 -0
- package/dist/packages/agents/lib/detection.d.ts +7 -0
- package/dist/packages/agents/lib/detection.js +65 -0
- package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
- package/dist/packages/agents/lib/execution-profile.js +84 -0
- package/dist/packages/agents/lib/execution.d.ts +2 -0
- package/dist/packages/agents/lib/execution.js +243 -0
- package/dist/packages/agents/lib/executors.d.ts +32 -0
- package/dist/packages/agents/lib/executors.js +45 -0
- package/dist/packages/agents/lib/logs.d.ts +2 -0
- package/dist/packages/agents/lib/logs.js +17 -0
- package/dist/packages/agents/lib/preflight.d.ts +7 -0
- package/dist/packages/agents/lib/preflight.js +77 -0
- package/dist/packages/agents/lib/render.d.ts +8 -0
- package/dist/packages/agents/lib/render.js +218 -0
- package/dist/packages/agents/lib/schema.d.ts +8 -0
- package/dist/packages/agents/lib/schema.js +7 -0
- package/dist/packages/agents/lib/shells.d.ts +69 -0
- package/dist/packages/agents/lib/shells.js +1021 -0
- package/dist/packages/agents/lib/status.d.ts +3 -0
- package/dist/packages/agents/lib/status.js +58 -0
- package/dist/packages/agents/lib/types.d.ts +30 -0
- package/dist/packages/agents/lib/types.js +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
- package/dist/packages/compiler/compiled-compile.d.ts +48 -0
- package/dist/packages/compiler/compiled-compile.js +256 -0
- package/dist/packages/compiler/compiled-schema.d.ts +31 -0
- package/dist/packages/compiler/compiled-schema.js +141 -0
- package/dist/packages/compiler/index.d.ts +24 -0
- package/dist/packages/compiler/index.js +23 -0
- package/dist/packages/compiler/lib/schema.d.ts +684 -0
- package/dist/packages/compiler/lib/schema.js +361 -0
- package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
- package/dist/packages/compiler/runtime-acceptance.js +269 -0
- package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
- package/dist/packages/compiler/runtime-contracts.js +48 -0
- package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
- package/dist/packages/compiler/runtime-inventory.js +29 -0
- package/dist/packages/compiler/runtime-paths.d.ts +8 -0
- package/dist/packages/compiler/runtime-paths.js +26 -0
- package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
- package/dist/packages/compiler/runtime-prompt.js +48 -0
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
- package/dist/packages/compiler/runtime-reconcile.js +193 -0
- package/dist/packages/compiler/runtime-runs.d.ts +11 -0
- package/dist/packages/compiler/runtime-runs.js +262 -0
- package/dist/packages/compiler/runtime-types.d.ts +43 -0
- package/dist/packages/compiler/runtime-types.js +1 -0
- package/dist/packages/compiler/runtime.d.ts +6 -0
- package/dist/packages/compiler/runtime.js +5 -0
- package/dist/packages/compiler/state-artifacts.d.ts +8 -0
- package/dist/packages/compiler/state-artifacts.js +13 -0
- package/dist/packages/compiler/state-health.d.ts +4 -0
- package/dist/packages/compiler/state-health.js +132 -0
- package/dist/packages/compiler/state-io.d.ts +10 -0
- package/dist/packages/compiler/state-io.js +76 -0
- package/dist/packages/compiler/state-paths.d.ts +4 -0
- package/dist/packages/compiler/state-paths.js +13 -0
- package/dist/packages/compiler/state-view.d.ts +4 -0
- package/dist/packages/compiler/state-view.js +103 -0
- package/dist/packages/compiler/state.d.ts +7 -0
- package/dist/packages/compiler/state.js +12 -0
- package/dist/packages/compiler/validate-compiled.d.ts +27 -0
- package/dist/packages/compiler/validate-compiled.js +241 -0
- package/dist/packages/compiler/validate-helpers.d.ts +12 -0
- package/dist/packages/compiler/validate-helpers.js +41 -0
- package/dist/packages/compiler/validate.d.ts +21 -0
- package/dist/packages/compiler/validate.js +249 -0
- package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
- package/dist/packages/compiler/workflow-primitives.js +5 -0
- package/dist/packages/compiler/workflows.d.ts +15 -0
- package/dist/packages/compiler/workflows.js +31 -0
- package/dist/packages/project-model/compiled-paths.d.ts +40 -0
- package/dist/packages/project-model/compiled-paths.js +106 -0
- package/dist/packages/project-model/compiled-raw.d.ts +49 -0
- package/dist/packages/project-model/compiled-raw.js +102 -0
- package/dist/packages/project-model/compiled-reset.d.ts +2 -0
- package/dist/packages/project-model/compiled-reset.js +72 -0
- package/dist/packages/project-model/index.d.ts +11 -0
- package/dist/packages/project-model/index.js +10 -0
- package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
- package/dist/packages/project-model/interf-bootstrap.js +18 -0
- package/dist/packages/project-model/interf-detect.d.ts +33 -0
- package/dist/packages/project-model/interf-detect.js +176 -0
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
- package/dist/packages/project-model/interf-scaffold.js +124 -0
- package/dist/packages/project-model/interf.d.ts +5 -0
- package/dist/packages/project-model/interf.js +4 -0
- package/dist/packages/project-model/lib/schema.d.ts +125 -0
- package/dist/packages/project-model/lib/schema.js +62 -0
- package/dist/packages/project-model/project-paths.d.ts +11 -0
- package/dist/packages/project-model/project-paths.js +32 -0
- package/dist/packages/project-model/source-config.d.ts +38 -0
- package/dist/packages/project-model/source-config.js +297 -0
- package/dist/packages/testing/index.d.ts +13 -0
- package/dist/packages/testing/index.js +10 -0
- package/dist/packages/testing/lib/schema.d.ts +261 -0
- package/dist/packages/testing/lib/schema.js +119 -0
- package/dist/packages/testing/test-execution.d.ts +14 -0
- package/dist/packages/testing/test-execution.js +525 -0
- package/dist/packages/testing/test-matrices.d.ts +90 -0
- package/dist/packages/testing/test-matrices.js +96 -0
- package/dist/packages/testing/test-paths.d.ts +12 -0
- package/dist/packages/testing/test-paths.js +59 -0
- package/dist/packages/testing/test-profile-presets.d.ts +57 -0
- package/dist/packages/testing/test-profile-presets.js +50 -0
- package/dist/packages/testing/test-sandbox.d.ts +11 -0
- package/dist/packages/testing/test-sandbox.js +105 -0
- package/dist/packages/testing/test-specs.d.ts +7 -0
- package/dist/packages/testing/test-specs.js +114 -0
- package/dist/packages/testing/test-targets.d.ts +5 -0
- package/dist/packages/testing/test-targets.js +38 -0
- package/dist/packages/testing/test-types.d.ts +16 -0
- package/dist/packages/testing/test-types.js +1 -0
- package/dist/packages/testing/test.d.ts +4 -0
- package/dist/packages/testing/test.js +3 -0
- package/dist/packages/workflow-authoring/index.d.ts +4 -0
- package/dist/packages/workflow-authoring/index.js +4 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
- package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
- package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
- package/dist/packages/workflow-package/index.d.ts +9 -0
- package/dist/packages/workflow-package/index.js +9 -0
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
- package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
- package/dist/packages/workflow-package/lib/package-root.js +6 -0
- package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
- package/dist/packages/workflow-package/local-workflows.js +422 -0
- package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
- package/dist/packages/workflow-package/workflow-definitions.js +203 -0
- package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
- package/dist/packages/workflow-package/workflow-helpers.js +167 -0
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
- package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
- package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
- package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
- package/package.json +44 -21
- package/dist/commands/compile.d.ts +0 -15
- package/dist/commands/create-workflow-wizard.js +0 -125
- package/dist/commands/create.js +0 -162
- package/dist/commands/init.d.ts +0 -3
- package/dist/commands/test.d.ts +0 -9
- package/dist/lib/compiled-home.d.ts +0 -5
- package/dist/lib/compiled-home.js +0 -32
- package/dist/lib/config.js +0 -9
- package/dist/lib/obsidian.d.ts +0 -1
- package/dist/lib/obsidian.js +0 -15
- package/dist/lib/summarize-plan.d.ts +0 -17
- package/dist/lib/summarize-plan.js +0 -120
- /package/dist/{commands → cli/commands}/default.d.ts +0 -0
- /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
- /package/dist/{commands → cli/commands}/status.d.ts +0 -0
- /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interf/compiler",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Interf
|
|
3
|
+
"version": "0.6.3",
|
|
4
|
+
"description": "Interf prepares task context for your agents by testing the files behind a task, building a local context folder, and using self-improving loops until checks pass.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"interf": "dist/bin.js"
|
|
@@ -14,38 +14,63 @@
|
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
|
+
"./compiler": {
|
|
18
|
+
"types": "./dist/packages/compiler/index.d.ts",
|
|
19
|
+
"import": "./dist/packages/compiler/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./workflow-package": {
|
|
22
|
+
"types": "./dist/packages/workflow-package/index.d.ts",
|
|
23
|
+
"import": "./dist/packages/workflow-package/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./workflow-authoring": {
|
|
26
|
+
"types": "./dist/packages/workflow-authoring/index.d.ts",
|
|
27
|
+
"import": "./dist/packages/workflow-authoring/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./project-model": {
|
|
30
|
+
"types": "./dist/packages/project-model/index.d.ts",
|
|
31
|
+
"import": "./dist/packages/project-model/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./agents": {
|
|
34
|
+
"types": "./dist/packages/agents/index.d.ts",
|
|
35
|
+
"import": "./dist/packages/agents/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./testing": {
|
|
38
|
+
"types": "./dist/packages/testing/index.d.ts",
|
|
39
|
+
"import": "./dist/packages/testing/index.js"
|
|
40
|
+
},
|
|
17
41
|
"./package.json": "./package.json"
|
|
18
42
|
},
|
|
19
43
|
"scripts": {
|
|
20
44
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && chmod 755 dist/bin.js",
|
|
21
45
|
"dev": "tsc --watch",
|
|
22
|
-
"refresh:bootstrap-mirror": "node scripts/sync-bootstrap-mirror.mjs",
|
|
23
|
-
"test:matrix": "npm run build && node scripts/
|
|
46
|
+
"refresh:bootstrap-mirror": "node scripts/docs/sync-bootstrap-mirror.mjs",
|
|
47
|
+
"test:matrix": "npm run build && node scripts/matrix/run.mjs",
|
|
24
48
|
"test:smoke": "npm run build && node --test test/**/*.test.mjs",
|
|
25
49
|
"test": "npm run test:smoke",
|
|
26
50
|
"test:e2e": "npm run test:acceptance-live",
|
|
27
51
|
"test:e2e:claude": "npm run test:acceptance-live -- --agent claude-code",
|
|
28
52
|
"test:e2e:codex": "npm run test:acceptance-live -- --agent codex",
|
|
29
53
|
"test:e2e:quick": "npm run test:e2e:quick:matrix",
|
|
30
|
-
"test:e2e:quick:agent": "node scripts/run-quick-e2e.mjs",
|
|
54
|
+
"test:e2e:quick:agent": "node scripts/acceptance/run-quick-e2e.mjs",
|
|
31
55
|
"test:e2e:quick:claude": "npm run test:e2e:quick:agent -- --agent claude-code",
|
|
32
56
|
"test:e2e:quick:codex": "npm run test:e2e:quick:agent -- --agent codex",
|
|
33
57
|
"test:e2e:quick:matrix": "npm run test:e2e:quick:claude && npm run test:e2e:quick:codex",
|
|
34
|
-
"test:
|
|
35
|
-
"test:
|
|
36
|
-
"test:
|
|
37
|
-
"test:
|
|
58
|
+
"test:matrix:cbre:fast": "npm run test:matrix -- --matrix test/matrices/cbre-chart-sanity.json",
|
|
59
|
+
"test:matrix:cbre:fast:keep": "npm run test:matrix -- --matrix test/matrices/cbre-chart-sanity.json --keep-project-clones",
|
|
60
|
+
"test:matrix:cbre:max": "npm run test:matrix -- --matrix test/matrices/cbre-chart-tier1-max.json",
|
|
61
|
+
"test:matrix:cbre:max:keep": "npm run test:matrix -- --matrix test/matrices/cbre-chart-tier1-max.json --keep-project-clones",
|
|
38
62
|
"test:full": "npm test && npm run test:e2e:quick:matrix",
|
|
39
|
-
"test:release:matrix": "npm run test:
|
|
40
|
-
"test:release": "npm test && npm run test:acceptance-live -- --agent claude-code --with-test && npm run test:acceptance-live -- --agent codex --with-test",
|
|
41
|
-
"test:acceptance-live": "npm run build && node scripts/acceptance
|
|
42
|
-
"test:
|
|
43
|
-
"test:
|
|
44
|
-
"test:
|
|
45
|
-
"test:acceptance-quick:create-compiled": "npm run build && node scripts/acceptance
|
|
46
|
-
"test:acceptance-quick:compiled-query": "npm run build && node scripts/acceptance
|
|
47
|
-
"test:acceptance-quick:
|
|
48
|
-
"
|
|
63
|
+
"test:release:matrix": "npm run test:matrix:cbre:max",
|
|
64
|
+
"test:release": "npm test && npm run test:acceptance-quick:workflow-authoring -- --agent claude-code && npm run test:acceptance-live -- --agent claude-code --with-test && npm run test:acceptance-quick:workflow-authoring -- --agent codex && npm run test:acceptance-live -- --agent codex --with-test",
|
|
65
|
+
"test:acceptance-live": "npm run build && node scripts/acceptance/live.mjs",
|
|
66
|
+
"test:e2e:quick:refresh-cache": "npm run test:e2e:quick:refresh-cache:claude && npm run test:e2e:quick:refresh-cache:codex",
|
|
67
|
+
"test:e2e:quick:refresh-cache:claude": "node scripts/acceptance/refresh-quick-cache.mjs --agent claude-code",
|
|
68
|
+
"test:e2e:quick:refresh-cache:codex": "node scripts/acceptance/refresh-quick-cache.mjs --agent codex",
|
|
69
|
+
"test:acceptance-quick:create-compiled": "npm run build && node scripts/acceptance/targeted.mjs create-compiled",
|
|
70
|
+
"test:acceptance-quick:compiled-query": "npm run build && node scripts/acceptance/targeted.mjs compiled-query",
|
|
71
|
+
"test:acceptance-quick:workflow-authoring": "npm run build && node scripts/acceptance/targeted.mjs workflow-authoring",
|
|
72
|
+
"test:acceptance-quick:self-improving": "npm run build && node scripts/acceptance/targeted.mjs self-improving-compile",
|
|
73
|
+
"prepublishOnly": "node scripts/release/prepublish-gate.mjs"
|
|
49
74
|
},
|
|
50
75
|
"files": [
|
|
51
76
|
"dist",
|
|
@@ -59,8 +84,6 @@
|
|
|
59
84
|
"interf",
|
|
60
85
|
"ai",
|
|
61
86
|
"agent",
|
|
62
|
-
"knowledge",
|
|
63
|
-
"obsidian",
|
|
64
87
|
"coding-agent",
|
|
65
88
|
"claude",
|
|
66
89
|
"codex"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { SourceDatasetConfig } from "../lib/schema.js";
|
|
2
|
-
import type { CommandModule } from "yargs";
|
|
3
|
-
export { runConfiguredCompiledCompile } from "./compile-controller.js";
|
|
4
|
-
export declare const compileCommand: CommandModule;
|
|
5
|
-
export declare function runCompileCommand(argv?: Record<string, unknown>): Promise<void>;
|
|
6
|
-
export declare function resolveInteractiveCompileLoopOverrides(options: {
|
|
7
|
-
compiledPath: string;
|
|
8
|
-
compiledConfig: SourceDatasetConfig | null;
|
|
9
|
-
maxAttemptsOverride: number | null;
|
|
10
|
-
maxLoopsOverride: number | null;
|
|
11
|
-
}): Promise<{
|
|
12
|
-
compiledConfig: SourceDatasetConfig | null;
|
|
13
|
-
maxAttemptsOverride: number | null;
|
|
14
|
-
maxLoopsOverride: number | null;
|
|
15
|
-
} | null>;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import * as p from "@clack/prompts";
|
|
3
|
-
import { listCompiledWorkflowChoices, } from "../lib/workflow-definitions.js";
|
|
4
|
-
import { createLocalWorkflowPackageFromTemplate } from "../lib/interf-workflow-package.js";
|
|
5
|
-
import { isWorkflowId, } from "../lib/local-workflows.js";
|
|
6
|
-
import { slugify } from "../lib/util.js";
|
|
7
|
-
export const clackWorkflowPrompts = {
|
|
8
|
-
intro: p.intro,
|
|
9
|
-
select: (options) => p.select(options),
|
|
10
|
-
text: (options) => p.text(options),
|
|
11
|
-
isCancel: p.isCancel,
|
|
12
|
-
log: {
|
|
13
|
-
info: p.log.info,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
export function formatWorkflowLabel(workflow) {
|
|
17
|
-
return {
|
|
18
|
-
value: workflow.id,
|
|
19
|
-
label: workflow.scope === "local" ? `${workflow.label} (Local)` : workflow.label,
|
|
20
|
-
hint: workflow.hint,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export function buildCompiledWorkflowOptions(sourcePath) {
|
|
24
|
-
return listCompiledWorkflowChoices(sourcePath).map(formatWorkflowLabel);
|
|
25
|
-
}
|
|
26
|
-
export async function chooseCompiledWorkflow(sourcePath, options = {}) {
|
|
27
|
-
const currentWorkflowId = options.currentWorkflowId;
|
|
28
|
-
const workflowOptions = buildCompiledWorkflowOptions(sourcePath);
|
|
29
|
-
const orderedOptions = workflowOptions
|
|
30
|
-
.map((option) => option.value === currentWorkflowId
|
|
31
|
-
? {
|
|
32
|
-
...option,
|
|
33
|
-
label: `${option.label} (Current)`,
|
|
34
|
-
hint: option.hint,
|
|
35
|
-
}
|
|
36
|
-
: option)
|
|
37
|
-
.sort((left, right) => {
|
|
38
|
-
if (left.value === currentWorkflowId)
|
|
39
|
-
return -1;
|
|
40
|
-
if (right.value === currentWorkflowId)
|
|
41
|
-
return 1;
|
|
42
|
-
return 0;
|
|
43
|
-
});
|
|
44
|
-
if (orderedOptions.length === 1) {
|
|
45
|
-
return orderedOptions[0]?.value ?? "interf";
|
|
46
|
-
}
|
|
47
|
-
return p.select({
|
|
48
|
-
message: options.message ?? "Dataset workflow?",
|
|
49
|
-
options: orderedOptions,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export async function createWorkflowWizard(options = {}, prompts = clackWorkflowPrompts) {
|
|
53
|
-
if (options.intro !== false) {
|
|
54
|
-
prompts.intro(chalk.bold("Create a workflow"));
|
|
55
|
-
}
|
|
56
|
-
const sourcePath = options.sourcePath ?? process.cwd();
|
|
57
|
-
return createCompiledWorkflowWizard(sourcePath, prompts);
|
|
58
|
-
}
|
|
59
|
-
export async function createCompiledWorkflowWizard(sourcePath, prompts = clackWorkflowPrompts) {
|
|
60
|
-
const baseWorkflow = await prompts.select({
|
|
61
|
-
message: "Start from which existing workflow?",
|
|
62
|
-
options: listCompiledWorkflowChoices(sourcePath).map(formatWorkflowLabel),
|
|
63
|
-
});
|
|
64
|
-
if (prompts.isCancel(baseWorkflow))
|
|
65
|
-
return baseWorkflow;
|
|
66
|
-
const rawName = await prompts.text({
|
|
67
|
-
message: "New workflow name?",
|
|
68
|
-
placeholder: "founder-research",
|
|
69
|
-
validate: (value) => {
|
|
70
|
-
if (value.trim().length === 0)
|
|
71
|
-
return "Name is required";
|
|
72
|
-
const workflowId = slugify(value);
|
|
73
|
-
if (!isWorkflowId(workflowId))
|
|
74
|
-
return "Use letters, numbers, and dashes only";
|
|
75
|
-
if (listCompiledWorkflowChoices(sourcePath).some((workflow) => workflow.id === workflowId)) {
|
|
76
|
-
return "That workflow name already exists";
|
|
77
|
-
}
|
|
78
|
-
return undefined;
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
if (prompts.isCancel(rawName))
|
|
82
|
-
return rawName;
|
|
83
|
-
const workflowId = slugify(rawName);
|
|
84
|
-
const label = rawName.trim();
|
|
85
|
-
const hint = await prompts.text({
|
|
86
|
-
message: "One-line workflow description?",
|
|
87
|
-
placeholder: "Bias toward evidence-backed summaries and strong retrieval structure",
|
|
88
|
-
validate: (value) => (value.trim().length === 0 ? "Description is required" : undefined),
|
|
89
|
-
});
|
|
90
|
-
if (prompts.isCancel(hint))
|
|
91
|
-
return hint;
|
|
92
|
-
const summarizeBias = await prompts.text({
|
|
93
|
-
message: "What should summarize emphasize?",
|
|
94
|
-
placeholder: "Preserve evidence tiers, decision context, and source metadata",
|
|
95
|
-
validate: (value) => (value.trim().length === 0 ? "Summarize guidance is required" : undefined),
|
|
96
|
-
});
|
|
97
|
-
if (prompts.isCancel(summarizeBias))
|
|
98
|
-
return summarizeBias;
|
|
99
|
-
const structureBias = await prompts.text({
|
|
100
|
-
message: "What should structure emphasize?",
|
|
101
|
-
placeholder: "Build retrieval-ready entities, claims, timelines, and indexes",
|
|
102
|
-
validate: (value) => (value.trim().length === 0 ? "Structure guidance is required" : undefined),
|
|
103
|
-
});
|
|
104
|
-
if (prompts.isCancel(structureBias))
|
|
105
|
-
return structureBias;
|
|
106
|
-
const shapeBias = await prompts.text({
|
|
107
|
-
message: "What should shape emphasize?",
|
|
108
|
-
placeholder: "Bias home.md and navigation toward the questions this dataset should answer best",
|
|
109
|
-
validate: (value) => (value.trim().length === 0 ? "Shape guidance is required" : undefined),
|
|
110
|
-
});
|
|
111
|
-
if (prompts.isCancel(shapeBias))
|
|
112
|
-
return shapeBias;
|
|
113
|
-
const workflowPath = createLocalWorkflowPackageFromTemplate({
|
|
114
|
-
sourcePath,
|
|
115
|
-
baseWorkflowId: baseWorkflow,
|
|
116
|
-
workflowId,
|
|
117
|
-
label,
|
|
118
|
-
hint: hint.trim(),
|
|
119
|
-
summarizeBias: summarizeBias.trim(),
|
|
120
|
-
structureBias: structureBias.trim(),
|
|
121
|
-
shapeBias: shapeBias.trim(),
|
|
122
|
-
});
|
|
123
|
-
prompts.log.info(`Saved local workflow: ${workflowPath}`);
|
|
124
|
-
return workflowId;
|
|
125
|
-
}
|
package/dist/commands/create.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { basename } from "node:path";
|
|
3
|
-
import * as p from "@clack/prompts";
|
|
4
|
-
import { detectInterf, defaultCompiledNameForSource, listCompiledDatasetsForSourceFolder, } from "../lib/interf.js";
|
|
5
|
-
import { slugify } from "../lib/util.js";
|
|
6
|
-
import { addExecutionProfileOptions, executionProfileFromArgv, } from "../lib/execution-profile.js";
|
|
7
|
-
import { listSourceDatasetConfigs, loadSourceFolderConfig, upsertSourceDatasetConfig, } from "../lib/source-config.js";
|
|
8
|
-
import { createWorkflowWizard, } from "./create-workflow-wizard.js";
|
|
9
|
-
import { ensureCompiledFromConfig, } from "./compiled-flow.js";
|
|
10
|
-
import { DEFAULT_COMPILED_NAME, promptSingleCompiledConfig, } from "./source-config-wizard.js";
|
|
11
|
-
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
12
|
-
import { runConfiguredCompiledCompile } from "./compile.js";
|
|
13
|
-
function normalizeCreateTarget(value) {
|
|
14
|
-
if (!value)
|
|
15
|
-
return null;
|
|
16
|
-
switch (value) {
|
|
17
|
-
case "dataset":
|
|
18
|
-
case "ds":
|
|
19
|
-
return "dataset";
|
|
20
|
-
case "workflow":
|
|
21
|
-
case "wf":
|
|
22
|
-
return "workflow";
|
|
23
|
-
default:
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
async function selectCreateTarget() {
|
|
28
|
-
return p.select({
|
|
29
|
-
message: "Create what?",
|
|
30
|
-
options: [
|
|
31
|
-
{
|
|
32
|
-
value: "dataset",
|
|
33
|
-
label: "Dataset (Recommended)",
|
|
34
|
-
hint: "Add one dataset entry to this project",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: "workflow",
|
|
38
|
-
label: "Workflow",
|
|
39
|
-
hint: "Create a reusable local workflow",
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export const createCommand = {
|
|
45
|
-
command: "create [type]",
|
|
46
|
-
describe: "Create a dataset entry or reusable workflow",
|
|
47
|
-
builder: (yargs) => addExecutionProfileOptions(yargs.positional("type", {
|
|
48
|
-
type: "string",
|
|
49
|
-
describe: "Type to create (`dataset` or `workflow`)",
|
|
50
|
-
default: undefined,
|
|
51
|
-
})),
|
|
52
|
-
handler: async (argv) => {
|
|
53
|
-
const rawType = argv.type;
|
|
54
|
-
let type = normalizeCreateTarget(rawType);
|
|
55
|
-
const executionProfile = executionProfileFromArgv(argv);
|
|
56
|
-
if (rawType && !type) {
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
p.log.error(`Unknown create target: ${rawType}`);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (!type) {
|
|
62
|
-
const selected = await selectCreateTarget();
|
|
63
|
-
if (p.isCancel(selected))
|
|
64
|
-
return;
|
|
65
|
-
type = selected;
|
|
66
|
-
}
|
|
67
|
-
if (type === "workflow") {
|
|
68
|
-
await createWorkflowWizard({ sourcePath: process.cwd() });
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
await createCompiledWizard({ executionProfile });
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
export async function createCompiledWizard(options = {}) {
|
|
75
|
-
if (options.intro !== false) {
|
|
76
|
-
p.intro(chalk.bold("Add a dataset"));
|
|
77
|
-
}
|
|
78
|
-
const cwd = process.cwd();
|
|
79
|
-
const detected = detectInterf(cwd);
|
|
80
|
-
if (detected) {
|
|
81
|
-
process.exitCode = 1;
|
|
82
|
-
p.log.error("You are already inside a compiled dataset.");
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const existing = listCompiledDatasetsForSourceFolder(cwd);
|
|
86
|
-
if (existing.length > 0) {
|
|
87
|
-
p.log.info(`This project already has ${existing.length} compiled dataset${existing.length === 1 ? "" : "s"}. Add another only when you need a separate folder, truth checks, or focus.`);
|
|
88
|
-
}
|
|
89
|
-
p.log.info("Interf Compiler measures one dataset at a time. Start with truth checks and a baseline, then build a compiled dataset only when you need it.");
|
|
90
|
-
const existingConfig = loadSourceFolderConfig(cwd);
|
|
91
|
-
const suggestedName = slugify(defaultCompiledNameForSource(cwd) || basename(cwd)) || DEFAULT_COMPILED_NAME;
|
|
92
|
-
const workflowId = "interf";
|
|
93
|
-
const draft = await promptSingleCompiledConfig({
|
|
94
|
-
projectPath: cwd,
|
|
95
|
-
initial: { name: suggestedName },
|
|
96
|
-
introStyle: existingConfig ? "additional" : "first",
|
|
97
|
-
});
|
|
98
|
-
if (!draft)
|
|
99
|
-
return;
|
|
100
|
-
const configToSave = {
|
|
101
|
-
...draft,
|
|
102
|
-
workflow: workflowId,
|
|
103
|
-
};
|
|
104
|
-
const existingNames = new Set(listSourceDatasetConfigs(existingConfig).map((dataset) => dataset.name));
|
|
105
|
-
if (existingNames.has(configToSave.name)) {
|
|
106
|
-
process.exitCode = 1;
|
|
107
|
-
p.log.error(`Dataset "${configToSave.name}" already exists. Use \`interf\` or \`interf init\` to edit it.`);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
upsertSourceDatasetConfig(cwd, configToSave);
|
|
111
|
-
const compileNow = await p.confirm({
|
|
112
|
-
message: "Build the compiled dataset now? (Recommended)",
|
|
113
|
-
initialValue: true,
|
|
114
|
-
});
|
|
115
|
-
if (p.isCancel(compileNow) || !compileNow) {
|
|
116
|
-
p.outro(configToSave.checks.length > 0
|
|
117
|
-
? "Next:\n interf test\n interf compile"
|
|
118
|
-
: "Next:\n interf or interf init");
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const { executor, error } = await resolveOrConfigureLocalExecutor({
|
|
122
|
-
executionProfile: options.executionProfile,
|
|
123
|
-
purpose: "compile",
|
|
124
|
-
});
|
|
125
|
-
if (!executor && !error) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
if (!executor) {
|
|
129
|
-
process.exitCode = 1;
|
|
130
|
-
p.log.error(error ?? "No coding agent detected.");
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const spinner = p.spinner();
|
|
134
|
-
spinner.start("Preparing compiled dataset...");
|
|
135
|
-
let compiledPath = "";
|
|
136
|
-
try {
|
|
137
|
-
compiledPath = ensureCompiledFromConfig(cwd, configToSave);
|
|
138
|
-
spinner.stop("Compiled dataset target ready.");
|
|
139
|
-
}
|
|
140
|
-
catch (error) {
|
|
141
|
-
spinner.stop("Compiled dataset target preparation failed.");
|
|
142
|
-
process.exitCode = 1;
|
|
143
|
-
p.log.error(error instanceof Error ? error.message : String(error));
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
await compileCompiledAfterCreate(executor, cwd, configToSave, compiledPath, options.executionProfile);
|
|
147
|
-
}
|
|
148
|
-
async function compileCompiledAfterCreate(executor, sourcePath, datasetConfig, compiledPath, executionProfile) {
|
|
149
|
-
const compiled = await runConfiguredCompiledCompile({
|
|
150
|
-
executor,
|
|
151
|
-
compiledPath,
|
|
152
|
-
sourcePath,
|
|
153
|
-
compiledConfig: datasetConfig,
|
|
154
|
-
executionProfile,
|
|
155
|
-
maxAttemptsOverride: null,
|
|
156
|
-
maxLoopsOverride: null,
|
|
157
|
-
});
|
|
158
|
-
if (!compiled)
|
|
159
|
-
process.exitCode = 1;
|
|
160
|
-
return compiled;
|
|
161
|
-
}
|
|
162
|
-
export { formatWorkflowLabel, chooseCompiledWorkflow, createWorkflowWizard, createCompiledWorkflowWizard, } from "./create-workflow-wizard.js";
|
package/dist/commands/init.d.ts
DELETED
package/dist/commands/test.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CommandModule } from "yargs";
|
|
2
|
-
import type { SourceDatasetConfig } from "../lib/schema.js";
|
|
3
|
-
export declare function resolveConfiguredDatasetSelection(options: {
|
|
4
|
-
sourcePath: string;
|
|
5
|
-
requestedDatasetName?: string | null;
|
|
6
|
-
hintedDatasetConfig?: SourceDatasetConfig | null;
|
|
7
|
-
}): SourceDatasetConfig | null;
|
|
8
|
-
export declare const testCommand: CommandModule;
|
|
9
|
-
export declare function runTestCommand(argv?: Record<string, unknown>): Promise<boolean>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const UNCOMPILED_COMPILED_HOME_NOTICE = "Not yet compiled. Run `interf compile` to build the compiled dataset.";
|
|
2
|
-
export declare function renderUncompiledCompiledHome(compiledName: string, about?: string): string;
|
|
3
|
-
export declare function compiledHomeHasCompilePlaceholder(content: string): boolean;
|
|
4
|
-
export declare function readCompiledHomeContent(dirPath: string): string | null;
|
|
5
|
-
export declare function compiledHomeIsShaped(dirPath: string): boolean;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { compiledHomePath } from "./compiled-schema.js";
|
|
3
|
-
export const UNCOMPILED_COMPILED_HOME_NOTICE = "Not yet compiled. Run `interf compile` to build the compiled dataset.";
|
|
4
|
-
export function renderUncompiledCompiledHome(compiledName, about) {
|
|
5
|
-
return [
|
|
6
|
-
`# ${compiledName} — Home`,
|
|
7
|
-
"",
|
|
8
|
-
UNCOMPILED_COMPILED_HOME_NOTICE,
|
|
9
|
-
...(about ? ["", `About: ${about}`] : []),
|
|
10
|
-
"",
|
|
11
|
-
].join("\n");
|
|
12
|
-
}
|
|
13
|
-
export function compiledHomeHasCompilePlaceholder(content) {
|
|
14
|
-
return content.includes(UNCOMPILED_COMPILED_HOME_NOTICE);
|
|
15
|
-
}
|
|
16
|
-
export function readCompiledHomeContent(dirPath) {
|
|
17
|
-
const homePath = compiledHomePath(dirPath);
|
|
18
|
-
if (!existsSync(homePath))
|
|
19
|
-
return null;
|
|
20
|
-
try {
|
|
21
|
-
return readFileSync(homePath, "utf8");
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function compiledHomeIsShaped(dirPath) {
|
|
28
|
-
const content = readCompiledHomeContent(dirPath);
|
|
29
|
-
if (content === null)
|
|
30
|
-
return false;
|
|
31
|
-
return !compiledHomeHasCompilePlaceholder(content);
|
|
32
|
-
}
|
package/dist/lib/config.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { homedir } from "node:os";
|
|
2
|
-
import { join, dirname } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
-
const __dirname = dirname(__filename);
|
|
6
|
-
// Package root (dist/lib/ → package root)
|
|
7
|
-
export const PACKAGE_ROOT = join(__dirname, "..", "..");
|
|
8
|
-
// User config
|
|
9
|
-
export const INTERF_HOME = join(homedir(), ".interf");
|
package/dist/lib/obsidian.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function writeObsidianDefaults(dirPath: string, type: "compiled"): void;
|
package/dist/lib/obsidian.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
export function writeObsidianDefaults(dirPath, type) {
|
|
4
|
-
const obsidianDir = join(dirPath, ".obsidian");
|
|
5
|
-
mkdirSync(obsidianDir, { recursive: true });
|
|
6
|
-
const graphSettings = {
|
|
7
|
-
"collapse-filter": true,
|
|
8
|
-
search: 'path:"summaries" OR path:"knowledge" OR path:"home"',
|
|
9
|
-
showTags: false,
|
|
10
|
-
showAttachments: false,
|
|
11
|
-
hideUnresolved: true,
|
|
12
|
-
showOrphans: false,
|
|
13
|
-
};
|
|
14
|
-
writeFileSync(join(obsidianDir, "graph.json"), JSON.stringify(graphSettings, null, 2) + "\n");
|
|
15
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface SummarizeTarget {
|
|
2
|
-
source: string;
|
|
3
|
-
summary: string | null;
|
|
4
|
-
output: string;
|
|
5
|
-
reason: "pending" | "missing_synth" | "changed" | "full_pass";
|
|
6
|
-
}
|
|
7
|
-
export interface SummarizePlan {
|
|
8
|
-
generatedAt: string;
|
|
9
|
-
sourceCount: number;
|
|
10
|
-
summaryCount: number;
|
|
11
|
-
pendingCount: number;
|
|
12
|
-
targetCount: number;
|
|
13
|
-
targets: SummarizeTarget[];
|
|
14
|
-
}
|
|
15
|
-
export declare const SUMMARIZE_PLAN_RELATIVE_PATH: string;
|
|
16
|
-
export declare function buildSummarizePlan(sourcePath: string, compiledPath: string, mode?: "pending" | "all"): SummarizePlan;
|
|
17
|
-
export declare function writeSummarizePlan(compiledPath: string, plan: SummarizePlan): string;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "./filesystem.js";
|
|
4
|
-
import { builtinCompiledZoneRelativePath, compiledSummariesPath, BUILTIN_COMPILED_ZONE_IDS, } from "./compiled-schema.js";
|
|
5
|
-
import { discoverSourceFiles } from "./discovery.js";
|
|
6
|
-
import { loadState } from "./state.js";
|
|
7
|
-
import { parseJsonFrontmatter } from "./parse.js";
|
|
8
|
-
import { compiledRuntimeRoot } from "./compiled-paths.js";
|
|
9
|
-
export const SUMMARIZE_PLAN_RELATIVE_PATH = join(".interf", "runtime", "summarize-targets.json");
|
|
10
|
-
export function buildSummarizePlan(sourcePath, compiledPath, mode = "pending") {
|
|
11
|
-
const discovery = discoverSourceFiles(sourcePath, compiledPath);
|
|
12
|
-
const sourceFiles = discovery.sourceFiles;
|
|
13
|
-
const summariesDir = compiledSummariesPath(compiledPath);
|
|
14
|
-
const summaryFiles = listSummaryFiles(summariesDir, compiledPath);
|
|
15
|
-
const state = loadState(compiledPath);
|
|
16
|
-
const pending = new Set((state?.pending ?? []).filter((value) => typeof value === "string" && sourceFiles.includes(value)));
|
|
17
|
-
const summaryIndex = new Map();
|
|
18
|
-
for (const summary of summaryFiles) {
|
|
19
|
-
const source = readSourceReference(join(compiledPath, summary));
|
|
20
|
-
if (source)
|
|
21
|
-
summaryIndex.set(source, summary);
|
|
22
|
-
}
|
|
23
|
-
const targets = new Map();
|
|
24
|
-
if (mode === "all") {
|
|
25
|
-
for (const src of sourceFiles) {
|
|
26
|
-
targets.set(src, {
|
|
27
|
-
source: src,
|
|
28
|
-
summary: summaryIndex.get(src) ?? null,
|
|
29
|
-
output: defaultSummaryPath(src),
|
|
30
|
-
reason: "full_pass",
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
generatedAt: new Date().toISOString(),
|
|
35
|
-
sourceCount: sourceFiles.length,
|
|
36
|
-
summaryCount: summaryFiles.length,
|
|
37
|
-
pendingCount: pending.size,
|
|
38
|
-
targetCount: targets.size,
|
|
39
|
-
targets: Array.from(targets.values()).sort((a, b) => a.source.localeCompare(b.source)),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
for (const src of pending) {
|
|
43
|
-
targets.set(src, {
|
|
44
|
-
source: src,
|
|
45
|
-
summary: summaryIndex.get(src) ?? null,
|
|
46
|
-
output: defaultSummaryPath(src),
|
|
47
|
-
reason: "pending",
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
for (const src of sourceFiles) {
|
|
51
|
-
if (summaryIndex.has(src))
|
|
52
|
-
continue;
|
|
53
|
-
if (targets.has(src))
|
|
54
|
-
continue;
|
|
55
|
-
targets.set(src, {
|
|
56
|
-
source: src,
|
|
57
|
-
summary: null,
|
|
58
|
-
output: defaultSummaryPath(src),
|
|
59
|
-
reason: "missing_synth",
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
// Detect changed source files (source newer than its summary)
|
|
63
|
-
for (const [src, summary] of summaryIndex) {
|
|
64
|
-
if (targets.has(src))
|
|
65
|
-
continue;
|
|
66
|
-
const sourceFile = join(sourcePath, src);
|
|
67
|
-
const synthFile = join(compiledPath, summary);
|
|
68
|
-
if (!existsSync(sourceFile) || !existsSync(synthFile))
|
|
69
|
-
continue;
|
|
70
|
-
try {
|
|
71
|
-
const sourceMtime = statSync(sourceFile).mtimeMs;
|
|
72
|
-
const synthMtime = statSync(synthFile).mtimeMs;
|
|
73
|
-
if (sourceMtime > synthMtime) {
|
|
74
|
-
targets.set(src, {
|
|
75
|
-
source: src,
|
|
76
|
-
summary,
|
|
77
|
-
output: defaultSummaryPath(src),
|
|
78
|
-
reason: "changed",
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
generatedAt: new Date().toISOString(),
|
|
88
|
-
sourceCount: sourceFiles.length,
|
|
89
|
-
summaryCount: summaryFiles.length,
|
|
90
|
-
pendingCount: pending.size,
|
|
91
|
-
targetCount: targets.size,
|
|
92
|
-
targets: Array.from(targets.values()).sort((a, b) => a.source.localeCompare(b.source)),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export function writeSummarizePlan(compiledPath, plan) {
|
|
96
|
-
const planPath = join(compiledPath, SUMMARIZE_PLAN_RELATIVE_PATH);
|
|
97
|
-
mkdirSync(compiledRuntimeRoot(compiledPath), { recursive: true });
|
|
98
|
-
writeFileSync(planPath, JSON.stringify(plan, null, 2) + "\n");
|
|
99
|
-
return planPath;
|
|
100
|
-
}
|
|
101
|
-
function listSummaryFiles(summariesDir, compiledPath) {
|
|
102
|
-
return listFilesRecursive(summariesDir, (filePath) => filePath.endsWith(".md")).map((filePath) => relative(compiledPath, filePath));
|
|
103
|
-
}
|
|
104
|
-
function readSourceReference(synthPath) {
|
|
105
|
-
if (!existsSync(synthPath))
|
|
106
|
-
return null;
|
|
107
|
-
const content = readFileSync(synthPath, "utf-8");
|
|
108
|
-
const parsed = parseJsonFrontmatter(content);
|
|
109
|
-
const source = typeof parsed?.frontmatter.source === "string"
|
|
110
|
-
? parsed.frontmatter.source
|
|
111
|
-
: null;
|
|
112
|
-
return source?.trim() ?? null;
|
|
113
|
-
}
|
|
114
|
-
function defaultSummaryPath(sourcePath) {
|
|
115
|
-
const summariesRoot = builtinCompiledZoneRelativePath(BUILTIN_COMPILED_ZONE_IDS.SUMMARIES);
|
|
116
|
-
if (sourcePath.endsWith(".md"))
|
|
117
|
-
return `${summariesRoot}/${sourcePath}`;
|
|
118
|
-
const replaced = sourcePath.replace(/\.[^.]+$/, ".md");
|
|
119
|
-
return `${summariesRoot}/${replaced === sourcePath ? `${sourcePath}.md` : replaced}`;
|
|
120
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|