ctxr-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +25 -0
- package/dist/adapter.d.ts +18 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +4 -0
- package/dist/adapter.js.map +1 -0
- package/dist/adapters/builtin/index.d.ts +10 -0
- package/dist/adapters/builtin/index.d.ts.map +1 -0
- package/dist/adapters/builtin/index.js +11 -0
- package/dist/adapters/builtin/index.js.map +1 -0
- package/dist/adapters/forge/github.d.ts +9 -0
- package/dist/adapters/forge/github.d.ts.map +1 -0
- package/dist/adapters/forge/github.js +36 -0
- package/dist/adapters/forge/github.js.map +1 -0
- package/dist/adapters/forge/types.d.ts +23 -0
- package/dist/adapters/forge/types.d.ts.map +1 -0
- package/dist/adapters/forge/types.js +2 -0
- package/dist/adapters/forge/types.js.map +1 -0
- package/dist/adapters/harness/claude-code.d.ts +9 -0
- package/dist/adapters/harness/claude-code.d.ts.map +1 -0
- package/dist/adapters/harness/claude-code.js +42 -0
- package/dist/adapters/harness/claude-code.js.map +1 -0
- package/dist/adapters/identity/claude-code.d.ts +11 -0
- package/dist/adapters/identity/claude-code.d.ts.map +1 -0
- package/dist/adapters/identity/claude-code.js +18 -0
- package/dist/adapters/identity/claude-code.js.map +1 -0
- package/dist/adapters/registry.d.ts +16 -0
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +29 -0
- package/dist/adapters/registry.js.map +1 -0
- package/dist/adapters/types.d.ts +65 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +12 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +6 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/adapters-generate.d.ts +23 -0
- package/dist/commands/adapters-generate.d.ts.map +1 -0
- package/dist/commands/adapters-generate.js +59 -0
- package/dist/commands/adapters-generate.js.map +1 -0
- package/dist/commands/archive.d.ts +28 -0
- package/dist/commands/archive.d.ts.map +1 -0
- package/dist/commands/archive.js +66 -0
- package/dist/commands/archive.js.map +1 -0
- package/dist/commands/catalog-build.d.ts +7 -0
- package/dist/commands/catalog-build.d.ts.map +1 -0
- package/dist/commands/catalog-build.js +15 -0
- package/dist/commands/catalog-build.js.map +1 -0
- package/dist/commands/catalog-check.d.ts +22 -0
- package/dist/commands/catalog-check.d.ts.map +1 -0
- package/dist/commands/catalog-check.js +49 -0
- package/dist/commands/catalog-check.js.map +1 -0
- package/dist/commands/catalog-show.d.ts +13 -0
- package/dist/commands/catalog-show.d.ts.map +1 -0
- package/dist/commands/catalog-show.js +19 -0
- package/dist/commands/catalog-show.js.map +1 -0
- package/dist/commands/check.d.ts +22 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +43 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +53 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/graph-build.d.ts +24 -0
- package/dist/commands/graph-build.d.ts.map +1 -0
- package/dist/commands/graph-build.js +36 -0
- package/dist/commands/graph-build.js.map +1 -0
- package/dist/commands/graph-query.d.ts +41 -0
- package/dist/commands/graph-query.d.ts.map +1 -0
- package/dist/commands/graph-query.js +63 -0
- package/dist/commands/graph-query.js.map +1 -0
- package/dist/commands/ingest.d.ts +28 -0
- package/dist/commands/ingest.d.ts.map +1 -0
- package/dist/commands/ingest.js +60 -0
- package/dist/commands/ingest.js.map +1 -0
- package/dist/commands/init.d.ts +28 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +203 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/lint.d.ts +30 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +48 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/commands/migrate.d.ts +30 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +56 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/note-resolve.d.ts +14 -0
- package/dist/commands/note-resolve.d.ts.map +1 -0
- package/dist/commands/note-resolve.js +24 -0
- package/dist/commands/note-resolve.js.map +1 -0
- package/dist/commands/rollup-gather.d.ts +21 -0
- package/dist/commands/rollup-gather.d.ts.map +1 -0
- package/dist/commands/rollup-gather.js +40 -0
- package/dist/commands/rollup-gather.js.map +1 -0
- package/dist/commands/rollup-write.d.ts +25 -0
- package/dist/commands/rollup-write.d.ts.map +1 -0
- package/dist/commands/rollup-write.js +43 -0
- package/dist/commands/rollup-write.js.map +1 -0
- package/dist/commands/session-abandon.d.ts +13 -0
- package/dist/commands/session-abandon.d.ts.map +1 -0
- package/dist/commands/session-abandon.js +22 -0
- package/dist/commands/session-abandon.js.map +1 -0
- package/dist/commands/session-list.d.ts +14 -0
- package/dist/commands/session-list.d.ts.map +1 -0
- package/dist/commands/session-list.js +19 -0
- package/dist/commands/session-list.js.map +1 -0
- package/dist/commands/session-reap.d.ts +22 -0
- package/dist/commands/session-reap.d.ts.map +1 -0
- package/dist/commands/session-reap.js +47 -0
- package/dist/commands/session-reap.js.map +1 -0
- package/dist/commands/session-start.d.ts +18 -0
- package/dist/commands/session-start.d.ts.map +1 -0
- package/dist/commands/session-start.js +36 -0
- package/dist/commands/session-start.js.map +1 -0
- package/dist/commands/session-submit.d.ts +27 -0
- package/dist/commands/session-submit.d.ts.map +1 -0
- package/dist/commands/session-submit.js +68 -0
- package/dist/commands/session-submit.js.map +1 -0
- package/dist/commands/source-check.d.ts +21 -0
- package/dist/commands/source-check.d.ts.map +1 -0
- package/dist/commands/source-check.js +54 -0
- package/dist/commands/source-check.js.map +1 -0
- package/dist/commands/source-hash.d.ts +14 -0
- package/dist/commands/source-hash.d.ts.map +1 -0
- package/dist/commands/source-hash.js +34 -0
- package/dist/commands/source-hash.js.map +1 -0
- package/dist/commands/update.d.ts +17 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +25 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verify.d.ts +23 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +126 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/config/defaults.d.ts +69 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +71 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/load.d.ts +11 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +49 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/render.d.ts +9 -0
- package/dist/config/render.d.ts.map +1 -0
- package/dist/config/render.js +15 -0
- package/dist/config/render.js.map +1 -0
- package/dist/config/schema.d.ts +124 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +142 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/agents-doc.d.ts +80 -0
- package/dist/core/agents-doc.d.ts.map +1 -0
- package/dist/core/agents-doc.js +207 -0
- package/dist/core/agents-doc.js.map +1 -0
- package/dist/core/catalog/build.d.ts +49 -0
- package/dist/core/catalog/build.d.ts.map +1 -0
- package/dist/core/catalog/build.js +113 -0
- package/dist/core/catalog/build.js.map +1 -0
- package/dist/core/catalog/model.d.ts +33 -0
- package/dist/core/catalog/model.d.ts.map +1 -0
- package/dist/core/catalog/model.js +58 -0
- package/dist/core/catalog/model.js.map +1 -0
- package/dist/core/checks/catalog-checks.d.ts +4 -0
- package/dist/core/checks/catalog-checks.d.ts.map +1 -0
- package/dist/core/checks/catalog-checks.js +65 -0
- package/dist/core/checks/catalog-checks.js.map +1 -0
- package/dist/core/checks/identity-checks.d.ts +11 -0
- package/dist/core/checks/identity-checks.d.ts.map +1 -0
- package/dist/core/checks/identity-checks.js +39 -0
- package/dist/core/checks/identity-checks.js.map +1 -0
- package/dist/core/checks/integrity-checks.d.ts +23 -0
- package/dist/core/checks/integrity-checks.d.ts.map +1 -0
- package/dist/core/checks/integrity-checks.js +132 -0
- package/dist/core/checks/integrity-checks.js.map +1 -0
- package/dist/core/checks/manifest.d.ts +7 -0
- package/dist/core/checks/manifest.d.ts.map +1 -0
- package/dist/core/checks/manifest.js +20 -0
- package/dist/core/checks/manifest.js.map +1 -0
- package/dist/core/checks/organize-checks.d.ts +18 -0
- package/dist/core/checks/organize-checks.d.ts.map +1 -0
- package/dist/core/checks/organize-checks.js +97 -0
- package/dist/core/checks/organize-checks.js.map +1 -0
- package/dist/core/checks/registry.d.ts +24 -0
- package/dist/core/checks/registry.d.ts.map +1 -0
- package/dist/core/checks/registry.js +33 -0
- package/dist/core/checks/registry.js.map +1 -0
- package/dist/core/checks/types.d.ts +72 -0
- package/dist/core/checks/types.d.ts.map +1 -0
- package/dist/core/checks/types.js +4 -0
- package/dist/core/checks/types.js.map +1 -0
- package/dist/core/checks/write-lifecycle-checks.d.ts +24 -0
- package/dist/core/checks/write-lifecycle-checks.d.ts.map +1 -0
- package/dist/core/checks/write-lifecycle-checks.js +205 -0
- package/dist/core/checks/write-lifecycle-checks.js.map +1 -0
- package/dist/core/command.d.ts +23 -0
- package/dist/core/command.d.ts.map +1 -0
- package/dist/core/command.js +2 -0
- package/dist/core/command.js.map +1 -0
- package/dist/core/content/canonicalize.d.ts +14 -0
- package/dist/core/content/canonicalize.d.ts.map +1 -0
- package/dist/core/content/canonicalize.js +34 -0
- package/dist/core/content/canonicalize.js.map +1 -0
- package/dist/core/conventions.d.ts +21 -0
- package/dist/core/conventions.d.ts.map +1 -0
- package/dist/core/conventions.js +73 -0
- package/dist/core/conventions.js.map +1 -0
- package/dist/core/disclosure/model.d.ts +18 -0
- package/dist/core/disclosure/model.d.ts.map +1 -0
- package/dist/core/disclosure/model.js +45 -0
- package/dist/core/disclosure/model.js.map +1 -0
- package/dist/core/env.d.ts +40 -0
- package/dist/core/env.d.ts.map +1 -0
- package/dist/core/env.js +24 -0
- package/dist/core/env.js.map +1 -0
- package/dist/core/envelope.d.ts +46 -0
- package/dist/core/envelope.d.ts.map +1 -0
- package/dist/core/envelope.js +21 -0
- package/dist/core/envelope.js.map +1 -0
- package/dist/core/errors.d.ts +96 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +267 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/exit-codes.d.ts +32 -0
- package/dist/core/exit-codes.d.ts.map +1 -0
- package/dist/core/exit-codes.js +31 -0
- package/dist/core/exit-codes.js.map +1 -0
- package/dist/core/fs/atomic.d.ts +10 -0
- package/dist/core/fs/atomic.d.ts.map +1 -0
- package/dist/core/fs/atomic.js +31 -0
- package/dist/core/fs/atomic.js.map +1 -0
- package/dist/core/fs/fenced-region.d.ts +47 -0
- package/dist/core/fs/fenced-region.d.ts.map +1 -0
- package/dist/core/fs/fenced-region.js +122 -0
- package/dist/core/fs/fenced-region.js.map +1 -0
- package/dist/core/git/exec.d.ts +28 -0
- package/dist/core/git/exec.d.ts.map +1 -0
- package/dist/core/git/exec.js +21 -0
- package/dist/core/git/exec.js.map +1 -0
- package/dist/core/git/repo.d.ts +63 -0
- package/dist/core/git/repo.d.ts.map +1 -0
- package/dist/core/git/repo.js +91 -0
- package/dist/core/git/repo.js.map +1 -0
- package/dist/core/git/staged.d.ts +10 -0
- package/dist/core/git/staged.d.ts.map +1 -0
- package/dist/core/git/staged.js +49 -0
- package/dist/core/git/staged.js.map +1 -0
- package/dist/core/git/worktree.d.ts +29 -0
- package/dist/core/git/worktree.d.ts.map +1 -0
- package/dist/core/git/worktree.js +61 -0
- package/dist/core/git/worktree.js.map +1 -0
- package/dist/core/graph/model.d.ts +43 -0
- package/dist/core/graph/model.d.ts.map +1 -0
- package/dist/core/graph/model.js +60 -0
- package/dist/core/graph/model.js.map +1 -0
- package/dist/core/graph/persist.d.ts +7 -0
- package/dist/core/graph/persist.d.ts.map +1 -0
- package/dist/core/graph/persist.js +23 -0
- package/dist/core/graph/persist.js.map +1 -0
- package/dist/core/graph/query.d.ts +16 -0
- package/dist/core/graph/query.d.ts.map +1 -0
- package/dist/core/graph/query.js +91 -0
- package/dist/core/graph/query.js.map +1 -0
- package/dist/core/graph/visibility-filter.d.ts +13 -0
- package/dist/core/graph/visibility-filter.d.ts.map +1 -0
- package/dist/core/graph/visibility-filter.js +26 -0
- package/dist/core/graph/visibility-filter.js.map +1 -0
- package/dist/core/hooks.d.ts +34 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +89 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/identity.d.ts +14 -0
- package/dist/core/identity.d.ts.map +1 -0
- package/dist/core/identity.js +36 -0
- package/dist/core/identity.js.map +1 -0
- package/dist/core/ingest/identity.d.ts +15 -0
- package/dist/core/ingest/identity.d.ts.map +1 -0
- package/dist/core/ingest/identity.js +17 -0
- package/dist/core/ingest/identity.js.map +1 -0
- package/dist/core/ingest/model.d.ts +17 -0
- package/dist/core/ingest/model.d.ts.map +1 -0
- package/dist/core/ingest/model.js +24 -0
- package/dist/core/ingest/model.js.map +1 -0
- package/dist/core/json-config-merge.d.ts +13 -0
- package/dist/core/json-config-merge.d.ts.map +1 -0
- package/dist/core/json-config-merge.js +43 -0
- package/dist/core/json-config-merge.js.map +1 -0
- package/dist/core/markers.d.ts +17 -0
- package/dist/core/markers.d.ts.map +1 -0
- package/dist/core/markers.js +16 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/migrations/registry.d.ts +6 -0
- package/dist/core/migrations/registry.d.ts.map +1 -0
- package/dist/core/migrations/registry.js +8 -0
- package/dist/core/migrations/registry.js.map +1 -0
- package/dist/core/migrations/rename-visibility-field.d.ts +3 -0
- package/dist/core/migrations/rename-visibility-field.d.ts.map +1 -0
- package/dist/core/migrations/rename-visibility-field.js +62 -0
- package/dist/core/migrations/rename-visibility-field.js.map +1 -0
- package/dist/core/migrations/types.d.ts +27 -0
- package/dist/core/migrations/types.d.ts.map +1 -0
- package/dist/core/migrations/types.js +2 -0
- package/dist/core/migrations/types.js.map +1 -0
- package/dist/core/notes/checks.d.ts +20 -0
- package/dist/core/notes/checks.d.ts.map +1 -0
- package/dist/core/notes/checks.js +58 -0
- package/dist/core/notes/checks.js.map +1 -0
- package/dist/core/notes/list.d.ts +26 -0
- package/dist/core/notes/list.d.ts.map +1 -0
- package/dist/core/notes/list.js +84 -0
- package/dist/core/notes/list.js.map +1 -0
- package/dist/core/notes/parse.d.ts +12 -0
- package/dist/core/notes/parse.d.ts.map +1 -0
- package/dist/core/notes/parse.js +36 -0
- package/dist/core/notes/parse.js.map +1 -0
- package/dist/core/notes/render.d.ts +7 -0
- package/dist/core/notes/render.d.ts.map +1 -0
- package/dist/core/notes/render.js +13 -0
- package/dist/core/notes/render.js.map +1 -0
- package/dist/core/notes/visibility.d.ts +26 -0
- package/dist/core/notes/visibility.d.ts.map +1 -0
- package/dist/core/notes/visibility.js +41 -0
- package/dist/core/notes/visibility.js.map +1 -0
- package/dist/core/procedures.d.ts +44 -0
- package/dist/core/procedures.d.ts.map +1 -0
- package/dist/core/procedures.js +154 -0
- package/dist/core/procedures.js.map +1 -0
- package/dist/core/queue.d.ts +16 -0
- package/dist/core/queue.d.ts.map +1 -0
- package/dist/core/queue.js +75 -0
- package/dist/core/queue.js.map +1 -0
- package/dist/core/reconcile.d.ts +18 -0
- package/dist/core/reconcile.d.ts.map +1 -0
- package/dist/core/reconcile.js +49 -0
- package/dist/core/reconcile.js.map +1 -0
- package/dist/core/records.d.ts +16 -0
- package/dist/core/records.d.ts.map +1 -0
- package/dist/core/records.js +36 -0
- package/dist/core/records.js.map +1 -0
- package/dist/core/reporter.d.ts +20 -0
- package/dist/core/reporter.d.ts.map +1 -0
- package/dist/core/reporter.js +25 -0
- package/dist/core/reporter.js.map +1 -0
- package/dist/core/root.d.ts +24 -0
- package/dist/core/root.d.ts.map +1 -0
- package/dist/core/root.js +51 -0
- package/dist/core/root.js.map +1 -0
- package/dist/core/security/secrets.d.ts +17 -0
- package/dist/core/security/secrets.d.ts.map +1 -0
- package/dist/core/security/secrets.js +21 -0
- package/dist/core/security/secrets.js.map +1 -0
- package/dist/core/session.d.ts +15 -0
- package/dist/core/session.d.ts.map +1 -0
- package/dist/core/session.js +27 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/store.d.ts +15 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +19 -0
- package/dist/core/store.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt/inquirer-prompter.d.ts +14 -0
- package/dist/prompt/inquirer-prompter.d.ts.map +1 -0
- package/dist/prompt/inquirer-prompter.js +27 -0
- package/dist/prompt/inquirer-prompter.js.map +1 -0
- package/dist/prompt/prompter.d.ts +24 -0
- package/dist/prompt/prompter.d.ts.map +1 -0
- package/dist/prompt/prompter.js +2 -0
- package/dist/prompt/prompter.js.map +1 -0
- package/dist/run.d.ts +16 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +464 -0
- package/dist/run.js.map +1 -0
- package/dist/taxonomy/profiles.d.ts +31 -0
- package/dist/taxonomy/profiles.d.ts.map +1 -0
- package/dist/taxonomy/profiles.js +45 -0
- package/dist/taxonomy/profiles.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +56 -0
- package/templates/.gitkeep +0 -0
- package/templates/hooks/pre-commit.sh +21 -0
- package/templates/hooks/pre-push.sh +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-build.js","sourceRoot":"","sources":["../../src/commands/graph-build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAA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SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE;QACzG,QAAQ;QACR,YAAY,EAAE,gBAAgB,KAAK,CAAC,KAAK,CAAC,MAAM,aAAa,KAAK,CAAC,KAAK,CAAC,MAAM,aAAa,KAAK,CAAC,QAAQ,CAAC,MAAM,oBAAoB;QACrI,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CommandOutcome, CommandRequires } from '../core/command.js';
|
|
2
|
+
import type { Direction, HubEntry } from '../core/graph/query.js';
|
|
3
|
+
import type { GraphBuildResult } from '../core/graph/model.js';
|
|
4
|
+
import type { Store } from '../core/store.js';
|
|
5
|
+
export declare const requires: CommandRequires;
|
|
6
|
+
export interface NeighborsFlags {
|
|
7
|
+
node: string;
|
|
8
|
+
depth?: number;
|
|
9
|
+
direction?: Direction;
|
|
10
|
+
as?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function executeNeighbors(store: Store, flags: NeighborsFlags): Promise<CommandOutcome<{
|
|
13
|
+
neighbors: string[];
|
|
14
|
+
}>>;
|
|
15
|
+
export interface PathFlags {
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
as?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function executePath(store: Store, flags: PathFlags): Promise<CommandOutcome<{
|
|
21
|
+
path: string[] | null;
|
|
22
|
+
}>>;
|
|
23
|
+
export interface SubgraphFlags {
|
|
24
|
+
ids: string[];
|
|
25
|
+
as?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function executeSubgraph(store: Store, flags: SubgraphFlags): Promise<CommandOutcome<GraphBuildResult>>;
|
|
28
|
+
export interface HubsFlags {
|
|
29
|
+
top?: number;
|
|
30
|
+
as?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function executeHubs(store: Store, flags?: HubsFlags): Promise<CommandOutcome<{
|
|
33
|
+
hubs: HubEntry[];
|
|
34
|
+
}>>;
|
|
35
|
+
export interface OrphansFlags {
|
|
36
|
+
as?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function executeOrphans(store: Store, flags?: OrphansFlags): Promise<CommandOutcome<{
|
|
39
|
+
orphans: string[];
|
|
40
|
+
}>>;
|
|
41
|
+
//# sourceMappingURL=graph-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-query.d.ts","sourceRoot":"","sources":["../../src/commands/graph-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AA6B/D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,cAAc,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC,CAKlD;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,WAAW,CAC/B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,cAAc,CAAC;IAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC,CAUpD;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAKnH;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAE,SAAc,GAAG,OAAO,CAAC,cAAc,CAAC;IAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC,CAAC,CAIpH;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAE,YAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAAC,CAI3H"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { GraphNodeNotFoundError, GraphNotBuiltError } from '../core/errors.js';
|
|
2
|
+
import { ExitCode } from '../core/exit-codes.js';
|
|
3
|
+
import { hubs, neighbors, orphans, shortestPath, subgraph } from '../core/graph/query.js';
|
|
4
|
+
import { readGraph } from '../core/graph/persist.js';
|
|
5
|
+
import { filterGraphByAudience } from '../core/graph/visibility-filter.js';
|
|
6
|
+
export const requires = { store: 'required' };
|
|
7
|
+
/**
|
|
8
|
+
* context-visibility spec: when `--as <context>` is given, the graph is
|
|
9
|
+
* filtered to only nodes visible to that context BEFORE any traversal runs
|
|
10
|
+
* — see filterGraphByAudience. Every subcommand below routes through this
|
|
11
|
+
* one loader so none of them can accidentally query the unfiltered graph.
|
|
12
|
+
*/
|
|
13
|
+
async function loadGraph(store, as) {
|
|
14
|
+
const graph = await readGraph(store);
|
|
15
|
+
if (!graph)
|
|
16
|
+
throw new GraphNotBuiltError();
|
|
17
|
+
return as ? filterGraphByAudience(store, graph, as) : graph;
|
|
18
|
+
}
|
|
19
|
+
function assertNode(graph, nodeId) {
|
|
20
|
+
if (!graph.nodes.some((n) => n.id === nodeId))
|
|
21
|
+
throw new GraphNodeNotFoundError(nodeId);
|
|
22
|
+
}
|
|
23
|
+
function outcome(store, data, humanSummary) {
|
|
24
|
+
return {
|
|
25
|
+
exitCode: ExitCode.Ok,
|
|
26
|
+
data,
|
|
27
|
+
findings: [],
|
|
28
|
+
humanSummary,
|
|
29
|
+
storeRoot: store.root,
|
|
30
|
+
schemaVersion: store.config.schema_version,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export async function executeNeighbors(store, flags) {
|
|
34
|
+
const graph = await loadGraph(store, flags.as);
|
|
35
|
+
assertNode(graph, flags.node);
|
|
36
|
+
const result = neighbors(graph, flags.node, { depth: flags.depth, direction: flags.direction });
|
|
37
|
+
return outcome(store, { neighbors: result }, `${result.length} neighbor(s) of "${flags.node}".`);
|
|
38
|
+
}
|
|
39
|
+
export async function executePath(store, flags) {
|
|
40
|
+
const graph = await loadGraph(store, flags.as);
|
|
41
|
+
assertNode(graph, flags.from);
|
|
42
|
+
assertNode(graph, flags.to);
|
|
43
|
+
const result = shortestPath(graph, flags.from, flags.to);
|
|
44
|
+
return outcome(store, { path: result }, result ? `Path: ${result.join(' -> ')}` : `No path from "${flags.from}" to "${flags.to}".`);
|
|
45
|
+
}
|
|
46
|
+
export async function executeSubgraph(store, flags) {
|
|
47
|
+
const graph = await loadGraph(store, flags.as);
|
|
48
|
+
for (const id of flags.ids)
|
|
49
|
+
assertNode(graph, id);
|
|
50
|
+
const result = subgraph(graph, flags.ids);
|
|
51
|
+
return outcome(store, result, `Subgraph: ${result.nodes.length} node(s), ${result.edges.length} edge(s).`);
|
|
52
|
+
}
|
|
53
|
+
export async function executeHubs(store, flags = {}) {
|
|
54
|
+
const graph = await loadGraph(store, flags.as);
|
|
55
|
+
const result = hubs(graph, flags.top ?? 10);
|
|
56
|
+
return outcome(store, { hubs: result }, `Top ${result.length} hub(s) by backlink count.`);
|
|
57
|
+
}
|
|
58
|
+
export async function executeOrphans(store, flags = {}) {
|
|
59
|
+
const graph = await loadGraph(store, flags.as);
|
|
60
|
+
const result = orphans(graph);
|
|
61
|
+
return outcome(store, { orphans: result }, `${result.length} orphan node(s) (no links in or out).`);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=graph-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-query.js","sourceRoot":"","sources":["../../src/commands/graph-query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAE1F,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAE/D;;;;;GAKG;AACH,KAAK,UAAU,SAAS,CAAC,KAAY,EAAE,EAAW;IAChD,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,kBAAkB,EAAE,CAAC;IAC3C,OAAO,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,EAAE,KAAK,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,EAAE,MAAM,EAAE,EAAE,OAAO,MAAM,CAAC,MAAM,4BAA4B,CAAC,CAAC;AAC5F,CAAC;AAMD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,KAAY,EAAE,KAAK,GAAiB,EAAE;IACzE,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,uCAAuC,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CommandOutcome, CommandRequires } from '../core/command.js';
|
|
2
|
+
import type { RunEnv } from '../core/env.js';
|
|
3
|
+
import type { Store } from '../core/store.js';
|
|
4
|
+
export declare const requires: CommandRequires;
|
|
5
|
+
export interface IngestFlags {
|
|
6
|
+
path: string;
|
|
7
|
+
sourceType: string;
|
|
8
|
+
sourceId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IngestData {
|
|
11
|
+
path: string;
|
|
12
|
+
sourceType: string;
|
|
13
|
+
sourceId: string;
|
|
14
|
+
sourceHash: string;
|
|
15
|
+
ingested: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* context-ingest spec: identity fields are assigned once, here, and never
|
|
19
|
+
* recomputed from the live body afterward — the hash computed in this
|
|
20
|
+
* function IS the frozen source-hash for this note's lifetime. Rebuilding
|
|
21
|
+
* the catalog before returning (rather than documenting it as a required
|
|
22
|
+
* next step) is this codebase's choice for task 6.6: a successful write
|
|
23
|
+
* leaves its own derived-artifact consequence consistent immediately,
|
|
24
|
+
* matching every other writer in the system (init's .gitignore/AGENTS.md
|
|
25
|
+
* reconciliation, catalog build itself).
|
|
26
|
+
*/
|
|
27
|
+
export declare function execute(env: RunEnv, store: Store, flags: IngestFlags): Promise<CommandOutcome<IngestData>>;
|
|
28
|
+
//# sourceMappingURL=ingest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../../src/commands/ingest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAO7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD;;;;;;;;;GASG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAqChH"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { buildCatalog } from '../core/catalog/build.js';
|
|
3
|
+
import { contentHashOfBody } from '../core/content/canonicalize.js';
|
|
4
|
+
import { AlreadyIngestedError, NoteNotFoundError } from '../core/errors.js';
|
|
5
|
+
import { ExitCode } from '../core/exit-codes.js';
|
|
6
|
+
import { writeFileAtomic } from '../core/fs/atomic.js';
|
|
7
|
+
import { hasSourceIdentity, INGESTED_FIELD, SOURCE_HASH_FIELD, SOURCE_ID_FIELD, SOURCE_TYPE_FIELD } from '../core/ingest/identity.js';
|
|
8
|
+
import { parseNote } from '../core/notes/parse.js';
|
|
9
|
+
import { renderNoteText } from '../core/notes/render.js';
|
|
10
|
+
export const requires = { store: 'required' };
|
|
11
|
+
function toStoreRelativePath(env, store, givenPath) {
|
|
12
|
+
const absolute = path.isAbsolute(givenPath) ? givenPath : path.resolve(env.cwd, givenPath);
|
|
13
|
+
return path.relative(store.root, absolute).split(path.sep).join('/');
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* context-ingest spec: identity fields are assigned once, here, and never
|
|
17
|
+
* recomputed from the live body afterward — the hash computed in this
|
|
18
|
+
* function IS the frozen source-hash for this note's lifetime. Rebuilding
|
|
19
|
+
* the catalog before returning (rather than documenting it as a required
|
|
20
|
+
* next step) is this codebase's choice for task 6.6: a successful write
|
|
21
|
+
* leaves its own derived-artifact consequence consistent immediately,
|
|
22
|
+
* matching every other writer in the system (init's .gitignore/AGENTS.md
|
|
23
|
+
* reconciliation, catalog build itself).
|
|
24
|
+
*/
|
|
25
|
+
export async function execute(env, store, flags) {
|
|
26
|
+
const relativePath = toStoreRelativePath(env, store, flags.path);
|
|
27
|
+
const absolutePath = path.join(store.root, relativePath);
|
|
28
|
+
let note;
|
|
29
|
+
try {
|
|
30
|
+
note = await parseNote(absolutePath, relativePath);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (err.code === 'ENOENT')
|
|
34
|
+
throw new NoteNotFoundError(relativePath);
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
if (hasSourceIdentity(note)) {
|
|
38
|
+
throw new AlreadyIngestedError(relativePath);
|
|
39
|
+
}
|
|
40
|
+
const sourceHash = contentHashOfBody(note.body);
|
|
41
|
+
const ingested = env.now().toISOString();
|
|
42
|
+
const frontmatter = {
|
|
43
|
+
...note.frontmatter,
|
|
44
|
+
[SOURCE_TYPE_FIELD]: flags.sourceType,
|
|
45
|
+
[SOURCE_ID_FIELD]: flags.sourceId,
|
|
46
|
+
[SOURCE_HASH_FIELD]: sourceHash,
|
|
47
|
+
[INGESTED_FIELD]: ingested,
|
|
48
|
+
};
|
|
49
|
+
await writeFileAtomic(absolutePath, renderNoteText(frontmatter, note.body));
|
|
50
|
+
await buildCatalog(store);
|
|
51
|
+
return {
|
|
52
|
+
exitCode: ExitCode.Ok,
|
|
53
|
+
data: { path: relativePath, sourceType: flags.sourceType, sourceId: flags.sourceId, sourceHash, ingested },
|
|
54
|
+
findings: [],
|
|
55
|
+
humanSummary: `Ingested "${relativePath}" (source: ${flags.sourceType}/${flags.sourceId}).`,
|
|
56
|
+
storeRoot: store.root,
|
|
57
|
+
schemaVersion: store.config.schema_version,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ingest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ingest.js","sourceRoot":"","sources":["../../src/commands/ingest.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACtI,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,MAAM,CAAC,MAAM,QAAQ,GAAoB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAgB/D,SAAS,mBAAmB,CAAC,GAAW,EAAE,KAAY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,CAAC,EAAE,KAAK,CAAC,UAAU;QACrC,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ;QACjC,CAAC,iBAAiB,CAAC,EAAE,UAAU;QAC/B,CAAC,cAAc,CAAC,EAAE,QAAQ;KAC3B,CAAC;IAEF,MAAM,eAAe,CAAC,YAAY,EAAE,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC;IAE1B,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE;QAC1G,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,aAAa,YAAY,cAAc,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,QAAQ,IAAI;QAC3F,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CommandOutcome, CommandRequires } from '../core/command.js';
|
|
2
|
+
import { type TaxonomyLayerConfig } from '../config/schema.js';
|
|
3
|
+
import { type RunEnv } from '../core/env.js';
|
|
4
|
+
export declare const requires: CommandRequires;
|
|
5
|
+
export interface InitFlags {
|
|
6
|
+
root?: string;
|
|
7
|
+
profile?: string;
|
|
8
|
+
taxonomy?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface InitData {
|
|
11
|
+
root: string;
|
|
12
|
+
already_initialized: boolean;
|
|
13
|
+
created: string[];
|
|
14
|
+
unchanged: string[];
|
|
15
|
+
git: {
|
|
16
|
+
repository_created: boolean;
|
|
17
|
+
commit: string | null;
|
|
18
|
+
default_branch: string | null;
|
|
19
|
+
};
|
|
20
|
+
/** null when a custom taxonomy definition was supplied (no shipped profile applies). */
|
|
21
|
+
taxonomy: {
|
|
22
|
+
profile: string | null;
|
|
23
|
+
layers: TaxonomyLayerConfig[];
|
|
24
|
+
};
|
|
25
|
+
schema_version: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function execute(env: RunEnv, flags: InitFlags): Promise<CommandOutcome<InitData>>;
|
|
28
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAsB1E,OAAO,EAAmE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAchI,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAgB5D,eAAO,MAAM,QAAQ,EAAE,eAAqC,CAAC;AAE7D,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,EAAE;QAAE,kBAAkB,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC3F,wFAAwF;IACxF,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,mBAAmB,EAAE,CAAA;KAAE,CAAC;IACpE,cAAc,EAAE,MAAM,CAAC;CACxB;AAwMD,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAY9F"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { mkdir, readFile } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { parse as parseYaml } from 'yaml';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { DEFAULT_ADAPTERS, DEFAULT_ARCHIVE_PATH, DEFAULT_CATALOG_PATH, DEFAULT_CATALOG_SECTION_MAX_BYTES, DEFAULT_CONVENTIONS_PATH, DEFAULT_DERIVED_PATHS, DEFAULT_DIFF_SIZE_CEILING_LINES, DEFAULT_EXCLUDE_PATHS, DEFAULT_HARD_WALLS, DEFAULT_IDENTITY_PATH, DEFAULT_INBOX_PATH, DEFAULT_INTERNAL_AUDIENCES, DEFAULT_PROCEDURES_PATH, DEFAULT_SESSION_BRANCH_PREFIX, DEFAULT_VISIBILITY_CONTEXT, DEFAULT_VISIBILITY_FIELD_KEY, DEFAULT_WORKTREES_PATH, } from '../config/defaults.js';
|
|
7
|
+
import { configPathFor, readConfig } from '../config/load.js';
|
|
8
|
+
import { renderStoreConfig } from '../config/render.js';
|
|
9
|
+
import { SUPPORTED_SCHEMA_VERSION, TaxonomyLayerSchema } from '../config/schema.js';
|
|
10
|
+
import { buildAgentsCanonicalSection, buildAgentsCaptureSection, buildAgentsConventionsSection, buildAgentsIdentitySection, buildAgentsLegRoutingSection, buildAgentsPlacementSection, agentsMdPath, } from '../core/agents-doc.js';
|
|
11
|
+
import { ensureIdentityFiles } from '../core/identity.js';
|
|
12
|
+
import { syncShippedSkills } from '../core/procedures.js';
|
|
13
|
+
import { reconcileStore, WORKTREES_GITIGNORE_FENCE } from '../core/reconcile.js';
|
|
14
|
+
import { isInteractive } from '../core/env.js';
|
|
15
|
+
import { GitIdentityMissingError, InvalidTaxonomyFileError, TaxonomySelectionConflictError, UnknownTaxonomyProfileError, } from '../core/errors.js';
|
|
16
|
+
import { ExitCode } from '../core/exit-codes.js';
|
|
17
|
+
import { writeFileAtomic } from '../core/fs/atomic.js';
|
|
18
|
+
import { upsertFencedRegionInFile } from '../core/fs/fenced-region.js';
|
|
19
|
+
import { addPaths, commitIfStaged, currentBranch, findToplevel, gitInit, hasGitIdentity } from '../core/git/repo.js';
|
|
20
|
+
import { configureHooksPath, installHooks } from '../core/hooks.js';
|
|
21
|
+
import { DERIVED_GITIGNORE_FENCE } from '../core/markers.js';
|
|
22
|
+
import { resolveRootForInit } from '../core/root.js';
|
|
23
|
+
import { defaultProfile, DEFAULT_PROFILE_ID, profileById, SHIPPED_PROFILES } from '../taxonomy/profiles.js';
|
|
24
|
+
export const requires = { store: 'absent' };
|
|
25
|
+
const CustomTaxonomyFileSchema = z.object({ layers: z.array(TaxonomyLayerSchema) });
|
|
26
|
+
async function resolveTaxonomy(env, flags) {
|
|
27
|
+
if (flags.profile && flags.taxonomy) {
|
|
28
|
+
throw new TaxonomySelectionConflictError();
|
|
29
|
+
}
|
|
30
|
+
if (flags.taxonomy) {
|
|
31
|
+
const text = await readFile(flags.taxonomy, 'utf8');
|
|
32
|
+
const raw = parseYaml(text);
|
|
33
|
+
const result = CustomTaxonomyFileSchema.safeParse(raw);
|
|
34
|
+
if (!result.success) {
|
|
35
|
+
const issues = result.error.issues.map((issue) => ({
|
|
36
|
+
path: issue.path.join('.') || '(root)',
|
|
37
|
+
message: issue.message,
|
|
38
|
+
}));
|
|
39
|
+
throw new InvalidTaxonomyFileError(flags.taxonomy, issues);
|
|
40
|
+
}
|
|
41
|
+
return { profileId: 'custom', layers: result.data.layers };
|
|
42
|
+
}
|
|
43
|
+
if (flags.profile) {
|
|
44
|
+
const profile = profileById(flags.profile);
|
|
45
|
+
if (!profile) {
|
|
46
|
+
throw new UnknownTaxonomyProfileError(flags.profile, SHIPPED_PROFILES.map((p) => p.id));
|
|
47
|
+
}
|
|
48
|
+
return { profileId: profile.id, layers: [...profile.layers] };
|
|
49
|
+
}
|
|
50
|
+
if (isInteractive(env)) {
|
|
51
|
+
const selectedId = await env.prompter.selectProfile({
|
|
52
|
+
message: 'Choose a taxonomy profile for this store:',
|
|
53
|
+
choices: SHIPPED_PROFILES.map((p) => ({ id: p.id, name: p.name, description: p.description })),
|
|
54
|
+
defaultId: DEFAULT_PROFILE_ID,
|
|
55
|
+
});
|
|
56
|
+
const profile = profileById(selectedId) ?? defaultProfile();
|
|
57
|
+
return { profileId: profile.id, layers: [...profile.layers] };
|
|
58
|
+
}
|
|
59
|
+
// Non-interactive, nothing specified: PARA immediately — never prompt, never block.
|
|
60
|
+
const profile = defaultProfile();
|
|
61
|
+
return { profileId: profile.id, layers: [...profile.layers] };
|
|
62
|
+
}
|
|
63
|
+
async function safeCurrentBranch(env, root) {
|
|
64
|
+
try {
|
|
65
|
+
return await currentBranch(env.git, root);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function runInitCore(env, flags) {
|
|
72
|
+
const root = resolveRootForInit(env, flags);
|
|
73
|
+
await mkdir(root, { recursive: true });
|
|
74
|
+
const configPath = configPathFor(root);
|
|
75
|
+
// --- Idempotent path: already initialized -----------------------------
|
|
76
|
+
if (existsSync(configPath)) {
|
|
77
|
+
const config = await readConfig(root); // validates + gates schema_version
|
|
78
|
+
// Reconciling an existing store is exactly `ctxr update`'s job — one shared implementation.
|
|
79
|
+
await reconcileStore(env, root, config);
|
|
80
|
+
return {
|
|
81
|
+
data: {
|
|
82
|
+
root,
|
|
83
|
+
already_initialized: true,
|
|
84
|
+
created: [],
|
|
85
|
+
unchanged: [],
|
|
86
|
+
git: {
|
|
87
|
+
repository_created: false,
|
|
88
|
+
commit: null,
|
|
89
|
+
default_branch: config.git.default_branch,
|
|
90
|
+
},
|
|
91
|
+
taxonomy: {
|
|
92
|
+
profile: config.taxonomy.profile === 'custom' ? null : config.taxonomy.profile,
|
|
93
|
+
layers: config.taxonomy.layers,
|
|
94
|
+
},
|
|
95
|
+
schema_version: config.schema_version,
|
|
96
|
+
},
|
|
97
|
+
findings: [],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// --- Resolve taxonomy in memory, no writes yet -------------------------
|
|
101
|
+
const taxonomy = await resolveTaxonomy(env, flags);
|
|
102
|
+
// --- Git preflight, still no writes -------------------------------------
|
|
103
|
+
const toplevel = await findToplevel(env.git, root);
|
|
104
|
+
const findings = [];
|
|
105
|
+
if (toplevel.kind === 'ancestor') {
|
|
106
|
+
findings.push({
|
|
107
|
+
code: 'git.ancestor_repository',
|
|
108
|
+
severity: 'warning',
|
|
109
|
+
message: `"${root}" is inside an existing git repository rooted at "${toplevel.toplevel}".`,
|
|
110
|
+
subject: toplevel.toplevel,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (!(await hasGitIdentity(env.git, root, env.env))) {
|
|
114
|
+
throw new GitIdentityMissingError();
|
|
115
|
+
}
|
|
116
|
+
// --- Mutate: create the repo so we can learn its default branch name ----
|
|
117
|
+
const repositoryAlreadyExists = toplevel.kind === 'this-dir';
|
|
118
|
+
if (!repositoryAlreadyExists) {
|
|
119
|
+
await gitInit(env.git, root);
|
|
120
|
+
}
|
|
121
|
+
// Works even pre-commit: git init leaves HEAD pointing at an unborn branch.
|
|
122
|
+
const defaultBranch = (await safeCurrentBranch(env, root)) ?? 'main';
|
|
123
|
+
const config = {
|
|
124
|
+
schema_version: SUPPORTED_SCHEMA_VERSION,
|
|
125
|
+
taxonomy: { profile: taxonomy.profileId, layers: taxonomy.layers },
|
|
126
|
+
fields: { visibility: DEFAULT_VISIBILITY_FIELD_KEY },
|
|
127
|
+
visibility: { default_context: DEFAULT_VISIBILITY_CONTEXT, directory_defaults: {}, contexts: {} },
|
|
128
|
+
derived: { paths: [...DEFAULT_DERIVED_PATHS] },
|
|
129
|
+
retrieval: { exclude_paths: [...DEFAULT_EXCLUDE_PATHS] },
|
|
130
|
+
git: { default_branch: defaultBranch },
|
|
131
|
+
session: { branch_prefix: DEFAULT_SESSION_BRANCH_PREFIX, worktrees_path: DEFAULT_WORKTREES_PATH },
|
|
132
|
+
write_lifecycle: { diff_size_ceiling_lines: DEFAULT_DIFF_SIZE_CEILING_LINES },
|
|
133
|
+
catalog: { path: DEFAULT_CATALOG_PATH, section_max_bytes: DEFAULT_CATALOG_SECTION_MAX_BYTES },
|
|
134
|
+
disclosure: { internal_audiences: [...DEFAULT_INTERNAL_AUDIENCES], hard_walls: [...DEFAULT_HARD_WALLS] },
|
|
135
|
+
ingest: { inbox_path: DEFAULT_INBOX_PATH },
|
|
136
|
+
organize: { archive_path: DEFAULT_ARCHIVE_PATH },
|
|
137
|
+
identity: { path: DEFAULT_IDENTITY_PATH },
|
|
138
|
+
harness: { procedures_path: DEFAULT_PROCEDURES_PATH, conventions_path: DEFAULT_CONVENTIONS_PATH },
|
|
139
|
+
adapters: [...DEFAULT_ADAPTERS],
|
|
140
|
+
};
|
|
141
|
+
// Round-trips through the schema internally; throws before any byte is written if it doesn't.
|
|
142
|
+
const configText = renderStoreConfig(config);
|
|
143
|
+
await writeFileAtomic(configPath, configText);
|
|
144
|
+
const gitignorePath = path.join(root, '.gitignore');
|
|
145
|
+
await upsertFencedRegionInFile(gitignorePath, DERIVED_GITIGNORE_FENCE, config.derived.paths);
|
|
146
|
+
await upsertFencedRegionInFile(gitignorePath, WORKTREES_GITIGNORE_FENCE, [config.session.worktrees_path]);
|
|
147
|
+
await buildAgentsLegRoutingSection(root, config);
|
|
148
|
+
await buildAgentsCaptureSection(root, config);
|
|
149
|
+
await buildAgentsPlacementSection(root, config);
|
|
150
|
+
const identityFilesCreated = await ensureIdentityFiles(root, config);
|
|
151
|
+
const procedureFilesCreated = await syncShippedSkills(root, config);
|
|
152
|
+
await buildAgentsCanonicalSection(root, config);
|
|
153
|
+
await buildAgentsIdentitySection(root, config);
|
|
154
|
+
await buildAgentsConventionsSection(root, config);
|
|
155
|
+
// One directory per configured layer with a .gitkeep — makes Zettelkasten's
|
|
156
|
+
// zero-layer shape visibly different from PARA's at a glance. This is a
|
|
157
|
+
// deliberate addition beyond tasks.md's literal text (0.6), noted here
|
|
158
|
+
// rather than absorbed silently.
|
|
159
|
+
const layerGitkeeps = [];
|
|
160
|
+
for (const layer of config.taxonomy.layers) {
|
|
161
|
+
const dir = path.join(root, layer.path);
|
|
162
|
+
await mkdir(dir, { recursive: true });
|
|
163
|
+
const gitkeepPath = path.join(dir, '.gitkeep');
|
|
164
|
+
await writeFileAtomic(gitkeepPath, '');
|
|
165
|
+
layerGitkeeps.push(path.join(layer.path, '.gitkeep'));
|
|
166
|
+
}
|
|
167
|
+
// Version-controlled hooks (write-lifecycle spec): generated now, staged
|
|
168
|
+
// and committed below alongside the rest of the scaffold.
|
|
169
|
+
const { changed: hookFiles } = await installHooks(root, defaultBranch);
|
|
170
|
+
await configureHooksPath(env.git, root);
|
|
171
|
+
const relConfigPath = path.relative(root, configPath);
|
|
172
|
+
await addPaths(env.git, root, [relConfigPath, '.gitignore', path.relative(root, agentsMdPath(root)), ...layerGitkeeps, ...identityFilesCreated, ...procedureFilesCreated, ...hookFiles]);
|
|
173
|
+
const commitSha = await commitIfStaged(env.git, root, { kind: 'bootstrap' }, 'chore: initialize contexture store');
|
|
174
|
+
return {
|
|
175
|
+
data: {
|
|
176
|
+
root,
|
|
177
|
+
already_initialized: false,
|
|
178
|
+
created: [relConfigPath, '.gitignore', path.relative(root, agentsMdPath(root)), ...layerGitkeeps, ...identityFilesCreated, ...procedureFilesCreated, ...hookFiles],
|
|
179
|
+
unchanged: [],
|
|
180
|
+
git: { repository_created: !repositoryAlreadyExists, commit: commitSha, default_branch: defaultBranch },
|
|
181
|
+
taxonomy: {
|
|
182
|
+
profile: config.taxonomy.profile === 'custom' ? null : config.taxonomy.profile,
|
|
183
|
+
layers: config.taxonomy.layers,
|
|
184
|
+
},
|
|
185
|
+
schema_version: config.schema_version,
|
|
186
|
+
},
|
|
187
|
+
findings,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export async function execute(env, flags) {
|
|
191
|
+
const result = await runInitCore(env, flags);
|
|
192
|
+
return {
|
|
193
|
+
exitCode: ExitCode.Ok,
|
|
194
|
+
data: result.data,
|
|
195
|
+
findings: result.findings,
|
|
196
|
+
humanSummary: result.data.already_initialized
|
|
197
|
+
? `"${result.data.root}" is already an initialized store.`
|
|
198
|
+
: `Initialized contexture store at "${result.data.root}".`,
|
|
199
|
+
storeRoot: result.data.root,
|
|
200
|
+
schemaVersion: result.data.schema_version,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,wBAAwB,EACxB,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,w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mB;YAC3C,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,oCAAoC;YAC1D,CAAC,CAAC,oCAAoC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI;QAC5D,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI;QAC3B,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CommandOutcome, CommandRequires } from '../core/command.js';
|
|
2
|
+
import type { CheckStatus } from '../core/checks/types.js';
|
|
3
|
+
import type { RunEnv } from '../core/env.js';
|
|
4
|
+
import type { Finding } from '../core/envelope.js';
|
|
5
|
+
import type { Store } from '../core/store.js';
|
|
6
|
+
export declare const requires: CommandRequires;
|
|
7
|
+
export interface LintCheckSummary {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
result: CheckStatus;
|
|
11
|
+
reason?: string;
|
|
12
|
+
findings?: Finding[];
|
|
13
|
+
}
|
|
14
|
+
export interface LintData {
|
|
15
|
+
checks: LintCheckSummary[];
|
|
16
|
+
summary: {
|
|
17
|
+
pass: number;
|
|
18
|
+
fail: number;
|
|
19
|
+
skip: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* context-organize spec: "lint SHALL always exit 0 ... regardless of how
|
|
24
|
+
* many findings it reports" and "SHALL NOT be used as a gate." Runs the
|
|
25
|
+
* SAME check registry doctor does, filtered to `severity: 'observation'`
|
|
26
|
+
* instead of `'invariant'` — the type-level split (task 9.4) that keeps
|
|
27
|
+
* this command from ever affecting an exit code.
|
|
28
|
+
*/
|
|
29
|
+
export declare function execute(env: RunEnv, store: Store): Promise<CommandOutcome<LintData>>;
|
|
30
|
+
//# sourceMappingURL=lint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1E,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAmC1F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CHECKS } from '../core/checks/manifest.js';
|
|
2
|
+
import { runChecks } from '../core/checks/registry.js';
|
|
3
|
+
import { ExitCode } from '../core/exit-codes.js';
|
|
4
|
+
import { readGraph } from '../core/graph/persist.js';
|
|
5
|
+
import { listNotes } from '../core/notes/list.js';
|
|
6
|
+
export const requires = { store: 'required' };
|
|
7
|
+
/**
|
|
8
|
+
* context-organize spec: "lint SHALL always exit 0 ... regardless of how
|
|
9
|
+
* many findings it reports" and "SHALL NOT be used as a gate." Runs the
|
|
10
|
+
* SAME check registry doctor does, filtered to `severity: 'observation'`
|
|
11
|
+
* instead of `'invariant'` — the type-level split (task 9.4) that keeps
|
|
12
|
+
* this command from ever affecting an exit code.
|
|
13
|
+
*/
|
|
14
|
+
export async function execute(env, store) {
|
|
15
|
+
const ctx = {
|
|
16
|
+
storeRoot: store.root,
|
|
17
|
+
config: store.config,
|
|
18
|
+
scope: 'store',
|
|
19
|
+
git: env.git,
|
|
20
|
+
notes: () => listNotes(store.root, store.config),
|
|
21
|
+
graph: () => readGraph(store),
|
|
22
|
+
catalog: async () => undefined,
|
|
23
|
+
};
|
|
24
|
+
const reports = await runChecks(CHECKS, ctx, { scope: 'store', severity: 'observation' });
|
|
25
|
+
const summary = {
|
|
26
|
+
pass: reports.filter((r) => r.result.status === 'pass').length,
|
|
27
|
+
fail: reports.filter((r) => r.result.status === 'fail').length,
|
|
28
|
+
skip: reports.filter((r) => r.result.status === 'skip').length,
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
exitCode: ExitCode.Ok,
|
|
32
|
+
data: {
|
|
33
|
+
checks: reports.map((r) => ({
|
|
34
|
+
id: r.id,
|
|
35
|
+
title: r.title,
|
|
36
|
+
result: r.result.status,
|
|
37
|
+
reason: r.result.skipReason,
|
|
38
|
+
findings: r.result.findings.length > 0 ? r.result.findings : undefined,
|
|
39
|
+
})),
|
|
40
|
+
summary,
|
|
41
|
+
},
|
|
42
|
+
findings: reports.flatMap((r) => r.result.findings),
|
|
43
|
+
humanSummary: `lint: ${summary.pass} clean, ${summary.fail} with findings, ${summary.skip} skipped`,
|
|
44
|
+
storeRoot: store.root,
|
|
45
|
+
schemaVersion: store.config.schema_version,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=lint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint.js","sourceRoot":"","sources":["../../src/commands/lint.ts"],"names":[],"mappings":"AACA,OAAO,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,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;KAC/D,CAAC;IAEF,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,EAAE;QACrB,IAAI,EAAE;YACJ,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC1B,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;gBACvB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU;gBAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;aACvE,CAAC,CAAC;YACH,OAAO;SACR;QACD,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;QACnD,YAAY,EAAE,SAAS,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,IAAI,mBAAmB,OAAO,CAAC,IAAI,UAAU;QACnG,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CommandOutcome, CommandRequires } from '../core/command.js';
|
|
2
|
+
import type { MigrationDelta } from '../core/migrations/types.js';
|
|
3
|
+
import type { Store } from '../core/store.js';
|
|
4
|
+
export declare const requires: CommandRequires;
|
|
5
|
+
export interface MigrateFlags {
|
|
6
|
+
dryRun?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface MigrateMigrationResult {
|
|
9
|
+
id: string;
|
|
10
|
+
fromVersion: number;
|
|
11
|
+
toVersion: number;
|
|
12
|
+
deltas: MigrationDelta[];
|
|
13
|
+
}
|
|
14
|
+
export interface MigrateData {
|
|
15
|
+
currentVersion: number;
|
|
16
|
+
targetVersion: number;
|
|
17
|
+
applied: boolean;
|
|
18
|
+
migrations: MigrateMigrationResult[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* store-lifecycle spec: `--dry-run` reports exact deltas with nothing
|
|
22
|
+
* applied; a real run applies each pending migration in order, reloading
|
|
23
|
+
* the store's config after each one so a later migration in the chain
|
|
24
|
+
* (none exist yet, but the mechanism supports it) sees the version it
|
|
25
|
+
* actually needs to start from. Resumability is a property of each
|
|
26
|
+
* migration's own plan()/apply() (see core/migrations/types.ts) — this
|
|
27
|
+
* command does no extra bookkeeping of its own.
|
|
28
|
+
*/
|
|
29
|
+
export declare function execute(store: Store, flags: MigrateFlags): Promise<CommandOutcome<MigrateData>>;
|
|
30
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,eAAuC,CAAC;AAE/D,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CA4CrG"}
|