semantic-atlas 0.4.0 → 2.0.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/.agents/skills/semantic-atlas/SKILL.md +134 -166
- package/.agents/skills/semantic-atlas/agents/openai.yaml +4 -0
- package/.agents/skills/semantic-atlas/references/observations.md +130 -0
- package/.agents/skills/semantic-atlas/scripts/query-context.mjs +110 -0
- package/.agents/skills/semantic-atlas-maintenance/SKILL.md +93 -0
- package/.agents/skills/semantic-atlas-maintenance/agents/openai.yaml +4 -0
- package/.agents/skills/semantic-atlas-maintenance/references/reconciliation.md +56 -0
- package/README.md +133 -265
- package/dist/application/map-application.d.ts +24 -0
- package/dist/application/map-application.d.ts.map +1 -0
- package/dist/application/map-application.js +134 -0
- package/dist/application/map-application.js.map +1 -0
- package/dist/cli/bin.js +6 -42
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/observation-commands.d.ts +16 -0
- package/dist/cli/observation-commands.d.ts.map +1 -0
- package/dist/cli/observation-commands.js +118 -0
- package/dist/cli/observation-commands.js.map +1 -0
- package/dist/cli/projection-writer.d.ts +2 -0
- package/dist/cli/projection-writer.d.ts.map +1 -0
- package/dist/cli/projection-writer.js +9 -0
- package/dist/cli/projection-writer.js.map +1 -0
- package/dist/cli/reconciliation-command.d.ts +7 -0
- package/dist/cli/reconciliation-command.d.ts.map +1 -0
- package/dist/cli/reconciliation-command.js +33 -0
- package/dist/cli/reconciliation-command.js.map +1 -0
- package/dist/cli/run-cli.d.ts +21 -0
- package/dist/cli/run-cli.d.ts.map +1 -0
- package/dist/cli/run-cli.js +299 -0
- package/dist/cli/run-cli.js.map +1 -0
- package/dist/contracts/cli.d.ts +166 -1211
- package/dist/contracts/cli.d.ts.map +1 -1
- package/dist/contracts/cli.js +2 -232
- package/dist/contracts/cli.js.map +1 -0
- package/dist/contracts/insights.d.ts +39 -1
- package/dist/contracts/insights.d.ts.map +1 -1
- package/dist/contracts/insights.js +2 -1
- package/dist/contracts/insights.js.map +1 -0
- package/dist/contracts/map.d.ts +154 -0
- package/dist/contracts/map.d.ts.map +1 -0
- package/dist/contracts/map.js +60 -0
- package/dist/contracts/map.js.map +1 -0
- package/dist/contracts/observation.d.ts +414 -0
- package/dist/contracts/observation.d.ts.map +1 -0
- package/dist/contracts/observation.js +125 -0
- package/dist/contracts/observation.js.map +1 -0
- package/dist/contracts/projection.d.ts +7 -0
- package/dist/contracts/projection.d.ts.map +1 -0
- package/dist/contracts/projection.js +2 -0
- package/dist/contracts/projection.js.map +1 -0
- package/dist/contracts/reconciliation.d.ts +40 -0
- package/dist/contracts/reconciliation.d.ts.map +1 -0
- package/dist/contracts/reconciliation.js +2 -0
- package/dist/contracts/reconciliation.js.map +1 -0
- package/dist/index.d.ts +7 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -0
- package/dist/insights/insight-service.d.ts +14 -0
- package/dist/insights/insight-service.d.ts.map +1 -0
- package/dist/insights/insight-service.js +129 -0
- package/dist/insights/insight-service.js.map +1 -0
- package/dist/map/business-graph.d.ts +32 -0
- package/dist/map/business-graph.d.ts.map +1 -0
- package/dist/map/business-graph.js +122 -0
- package/dist/map/business-graph.js.map +1 -0
- package/dist/map/map-document-loader.d.ts +13 -0
- package/dist/map/map-document-loader.d.ts.map +1 -0
- package/dist/map/map-document-loader.js +86 -0
- package/dist/map/map-document-loader.js.map +1 -0
- package/dist/map/map-validator.d.ts +12 -0
- package/dist/map/map-validator.d.ts.map +1 -0
- package/dist/map/map-validator.js +322 -0
- package/dist/map/map-validator.js.map +1 -0
- package/dist/observations/observation-application.d.ts +23 -0
- package/dist/observations/observation-application.d.ts.map +1 -0
- package/dist/observations/observation-application.js +62 -0
- package/dist/observations/observation-application.js.map +1 -0
- package/dist/observations/observation-claim-manager.d.ts +17 -0
- package/dist/observations/observation-claim-manager.d.ts.map +1 -0
- package/dist/observations/observation-claim-manager.js +198 -0
- package/dist/observations/observation-claim-manager.js.map +1 -0
- package/dist/observations/observation-store.d.ts +43 -0
- package/dist/observations/observation-store.d.ts.map +1 -0
- package/dist/observations/observation-store.js +213 -0
- package/dist/observations/observation-store.js.map +1 -0
- package/dist/observations/repository-identity.d.ts +12 -0
- package/dist/observations/repository-identity.d.ts.map +1 -0
- package/dist/observations/repository-identity.js +108 -0
- package/dist/observations/repository-identity.js.map +1 -0
- package/dist/query/context-query-service.d.ts +15 -0
- package/dist/query/context-query-service.d.ts.map +1 -0
- package/dist/query/context-query-service.js +36 -0
- package/dist/query/context-query-service.js.map +1 -0
- package/dist/reconciliation/reconciliation-service.d.ts +10 -0
- package/dist/reconciliation/reconciliation-service.d.ts.map +1 -0
- package/dist/reconciliation/reconciliation-service.js +114 -0
- package/dist/reconciliation/reconciliation-service.js.map +1 -0
- package/dist/rendering/map-projector.d.ts +8 -0
- package/dist/rendering/map-projector.d.ts.map +1 -0
- package/dist/rendering/map-projector.js +386 -0
- package/dist/rendering/map-projector.js.map +1 -0
- package/dist/setup/managed-skill-installer.d.ts +60 -0
- package/dist/setup/managed-skill-installer.d.ts.map +1 -0
- package/dist/setup/managed-skill-installer.js +293 -0
- package/dist/setup/managed-skill-installer.js.map +1 -0
- package/dist/setup/package-identity.d.ts +6 -0
- package/dist/setup/package-identity.d.ts.map +1 -0
- package/dist/setup/package-identity.js +16 -0
- package/dist/setup/package-identity.js.map +1 -0
- package/dist/setup/package-upgrader.d.ts +10 -22
- package/dist/setup/package-upgrader.d.ts.map +1 -1
- package/dist/setup/package-upgrader.js +60 -76
- package/dist/setup/package-upgrader.js.map +1 -0
- package/docs/architecture.md +426 -0
- package/docs/evaluation.md +220 -174
- package/docs/index.md +27 -45
- package/docs/map-format.md +225 -0
- package/docs/observations.md +167 -0
- package/docs/product-contract.md +282 -165
- package/examples/commerce.yaml +204 -0
- package/package.json +31 -32
- package/.agents/skills/semantic-atlas/references/graph-patch.md +0 -190
- package/.agents/skills/semantic-atlas/references/product-feedback.md +0 -34
- package/.agents/skills/semantic-atlas/references/result-routing.md +0 -104
- package/.agents/skills/semantic-atlas/references/snapshot-bootstrap.md +0 -42
- package/.agents/skills/semantic-atlas-insights/SKILL.md +0 -55
- package/README.zh-CN.md +0 -296
- package/dist/business-flow/business-flow-derivation-service.d.ts +0 -11
- package/dist/business-flow/business-flow-derivation-service.d.ts.map +0 -1
- package/dist/business-flow/business-flow-derivation-service.js +0 -151
- package/dist/business-flow/business-flow-draft.d.ts +0 -16
- package/dist/business-flow/business-flow-draft.d.ts.map +0 -1
- package/dist/business-flow/business-flow-draft.js +0 -150
- package/dist/business-flow/framework-business-strategy.d.ts +0 -7
- package/dist/business-flow/framework-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/framework-business-strategy.js +0 -1
- package/dist/business-flow/strategies/bullmq-business-strategy.d.ts +0 -10
- package/dist/business-flow/strategies/bullmq-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/bullmq-business-strategy.js +0 -79
- package/dist/business-flow/strategies/called-operation-derivation.d.ts +0 -13
- package/dist/business-flow/strategies/called-operation-derivation.d.ts.map +0 -1
- package/dist/business-flow/strategies/called-operation-derivation.js +0 -32
- package/dist/business-flow/strategies/graphql-business-strategy.d.ts +0 -8
- package/dist/business-flow/strategies/graphql-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/graphql-business-strategy.js +0 -65
- package/dist/business-flow/strategies/nestjs-business-strategy.d.ts +0 -8
- package/dist/business-flow/strategies/nestjs-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/nestjs-business-strategy.js +0 -72
- package/dist/business-flow/strategies/strategy-helpers.d.ts +0 -32
- package/dist/business-flow/strategies/strategy-helpers.d.ts.map +0 -1
- package/dist/business-flow/strategies/strategy-helpers.js +0 -49
- package/dist/business-flow/strategies/typeorm-business-strategy.d.ts +0 -10
- package/dist/business-flow/strategies/typeorm-business-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/typeorm-business-strategy.js +0 -136
- package/dist/business-flow/strategies/verified-invariant-strategy.d.ts +0 -5
- package/dist/business-flow/strategies/verified-invariant-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/verified-invariant-strategy.js +0 -38
- package/dist/business-flow/strategies/verified-test-strategy.d.ts +0 -5
- package/dist/business-flow/strategies/verified-test-strategy.d.ts.map +0 -1
- package/dist/business-flow/strategies/verified-test-strategy.js +0 -26
- package/dist/business-flow/structural-flow-catalog.d.ts +0 -21
- package/dist/business-flow/structural-flow-catalog.d.ts.map +0 -1
- package/dist/business-flow/structural-flow-catalog.js +0 -125
- package/dist/business-flow/types.d.ts +0 -51
- package/dist/business-flow/types.d.ts.map +0 -1
- package/dist/business-flow/types.js +0 -1
- package/dist/cli/argument-parser.d.ts +0 -3
- package/dist/cli/argument-parser.d.ts.map +0 -1
- package/dist/cli/argument-parser.js +0 -200
- package/dist/cli/cli-application.d.ts +0 -39
- package/dist/cli/cli-application.d.ts.map +0 -1
- package/dist/cli/cli-application.js +0 -571
- package/dist/cli/cli-error.d.ts +0 -12
- package/dist/cli/cli-error.d.ts.map +0 -1
- package/dist/cli/cli-error.js +0 -44
- package/dist/cli/cli-presenter.d.ts +0 -14
- package/dist/cli/cli-presenter.d.ts.map +0 -1
- package/dist/cli/cli-presenter.js +0 -36
- package/dist/cli/insights-cli.d.ts +0 -6
- package/dist/cli/insights-cli.d.ts.map +0 -1
- package/dist/cli/insights-cli.js +0 -236
- package/dist/cli/main.d.ts +0 -3
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -137
- package/dist/cli/standalone-cli.d.ts +0 -3
- package/dist/cli/standalone-cli.d.ts.map +0 -1
- package/dist/cli/standalone-cli.js +0 -104
- package/dist/cli/types.d.ts +0 -49
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/types.js +0 -1
- package/dist/cli/web-cli.d.ts +0 -9
- package/dist/cli/web-cli.d.ts.map +0 -1
- package/dist/cli/web-cli.js +0 -134
- package/dist/contracts/graph.d.ts +0 -266
- package/dist/contracts/graph.d.ts.map +0 -1
- package/dist/contracts/graph.js +0 -182
- package/dist/contracts/identifiers.d.ts +0 -4
- package/dist/contracts/identifiers.d.ts.map +0 -1
- package/dist/contracts/identifiers.js +0 -7
- package/dist/contracts/public-contracts.d.ts +0 -5
- package/dist/contracts/public-contracts.d.ts.map +0 -1
- package/dist/contracts/public-contracts.js +0 -4
- package/dist/evaluation/comparison.d.ts +0 -30
- package/dist/evaluation/comparison.d.ts.map +0 -1
- package/dist/evaluation/comparison.js +0 -108
- package/dist/evaluation/contracts.d.ts +0 -301
- package/dist/evaluation/contracts.d.ts.map +0 -1
- package/dist/evaluation/contracts.js +0 -413
- package/dist/graph/graph-store.d.ts +0 -55
- package/dist/graph/graph-store.d.ts.map +0 -1
- package/dist/graph/graph-store.js +0 -912
- package/dist/graph/types.d.ts +0 -189
- package/dist/graph/types.d.ts.map +0 -1
- package/dist/graph/types.js +0 -1
- package/dist/insights/contracts.d.ts +0 -266
- package/dist/insights/contracts.d.ts.map +0 -1
- package/dist/insights/contracts.js +0 -124
- package/dist/insights/insights-store.d.ts +0 -73
- package/dist/insights/insights-store.d.ts.map +0 -1
- package/dist/insights/insights-store.js +0 -246
- package/dist/knowledge/business-knowledge-service.d.ts +0 -24
- package/dist/knowledge/business-knowledge-service.d.ts.map +0 -1
- package/dist/knowledge/business-knowledge-service.js +0 -200
- package/dist/knowledge/graph-patch-conflict-error.d.ts +0 -8
- package/dist/knowledge/graph-patch-conflict-error.d.ts.map +0 -1
- package/dist/knowledge/graph-patch-conflict-error.js +0 -12
- package/dist/knowledge/structural-target-binding.d.ts +0 -14
- package/dist/knowledge/structural-target-binding.d.ts.map +0 -1
- package/dist/knowledge/structural-target-binding.js +0 -11
- package/dist/package-metadata.d.ts +0 -2
- package/dist/package-metadata.d.ts.map +0 -1
- package/dist/package-metadata.js +0 -9
- package/dist/repository/git-command.d.ts +0 -3
- package/dist/repository/git-command.d.ts.map +0 -1
- package/dist/repository/git-command.js +0 -25
- package/dist/repository/repository-inspector.d.ts +0 -8
- package/dist/repository/repository-inspector.d.ts.map +0 -1
- package/dist/repository/repository-inspector.js +0 -97
- package/dist/repository/repository-language-support.d.ts +0 -14
- package/dist/repository/repository-language-support.d.ts.map +0 -1
- package/dist/repository/repository-language-support.js +0 -64
- package/dist/repository/types.d.ts +0 -9
- package/dist/repository/types.d.ts.map +0 -1
- package/dist/repository/types.js +0 -1
- package/dist/runtime/sqlite-compatibility-process.d.ts +0 -8
- package/dist/runtime/sqlite-compatibility-process.d.ts.map +0 -1
- package/dist/runtime/sqlite-compatibility-process.js +0 -20
- package/dist/setup/skill-installer.d.ts +0 -20
- package/dist/setup/skill-installer.d.ts.map +0 -1
- package/dist/setup/skill-installer.js +0 -187
- package/dist/snapshots/repository-snapshot.d.ts +0 -4
- package/dist/snapshots/repository-snapshot.d.ts.map +0 -1
- package/dist/snapshots/repository-snapshot.js +0 -119
- package/dist/snapshots/types.d.ts +0 -30
- package/dist/snapshots/types.d.ts.map +0 -1
- package/dist/snapshots/types.js +0 -1
- package/dist/storage/atlas-database.d.ts +0 -25
- package/dist/storage/atlas-database.d.ts.map +0 -1
- package/dist/storage/atlas-database.js +0 -483
- package/dist/storage/snapshot-store.d.ts +0 -19
- package/dist/storage/snapshot-store.d.ts.map +0 -1
- package/dist/storage/snapshot-store.js +0 -74
- package/dist/structural-backend/codegraph-backend.d.ts +0 -57
- package/dist/structural-backend/codegraph-backend.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-backend.js +0 -1230
- package/dist/structural-backend/codegraph-worker-client.d.ts +0 -5
- package/dist/structural-backend/codegraph-worker-client.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker-client.js +0 -118
- package/dist/structural-backend/codegraph-worker-protocol.d.ts +0 -35
- package/dist/structural-backend/codegraph-worker-protocol.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker-protocol.js +0 -1
- package/dist/structural-backend/codegraph-worker.d.ts +0 -2
- package/dist/structural-backend/codegraph-worker.d.ts.map +0 -1
- package/dist/structural-backend/codegraph-worker.js +0 -131
- package/dist/structural-backend/process-instance.d.ts +0 -18
- package/dist/structural-backend/process-instance.d.ts.map +0 -1
- package/dist/structural-backend/process-instance.js +0 -207
- package/dist/structural-backend/structural-fact-changes.d.ts +0 -7
- package/dist/structural-backend/structural-fact-changes.d.ts.map +0 -1
- package/dist/structural-backend/structural-fact-changes.js +0 -78
- package/dist/structural-backend/structural-projection-bootstrapper.d.ts +0 -10
- package/dist/structural-backend/structural-projection-bootstrapper.d.ts.map +0 -1
- package/dist/structural-backend/structural-projection-bootstrapper.js +0 -295
- package/dist/structural-backend/structural-publication.d.ts +0 -13
- package/dist/structural-backend/structural-publication.d.ts.map +0 -1
- package/dist/structural-backend/structural-publication.js +0 -255
- package/dist/structural-backend/structural-write-lock.d.ts +0 -8
- package/dist/structural-backend/structural-write-lock.d.ts.map +0 -1
- package/dist/structural-backend/structural-write-lock.js +0 -415
- package/dist/structural-backend/types.d.ts +0 -144
- package/dist/structural-backend/types.d.ts.map +0 -1
- package/dist/structural-backend/types.js +0 -11
- package/dist/web/application/atlas-read-service.d.ts +0 -27
- package/dist/web/application/atlas-read-service.d.ts.map +0 -1
- package/dist/web/application/atlas-read-service.js +0 -216
- package/dist/web/application/primary-repository-catalog.d.ts +0 -15
- package/dist/web/application/primary-repository-catalog.d.ts.map +0 -1
- package/dist/web/application/primary-repository-catalog.js +0 -202
- package/dist/web/application/types.d.ts +0 -41
- package/dist/web/application/types.d.ts.map +0 -1
- package/dist/web/application/types.js +0 -1
- package/dist/web/server/api-router.d.ts +0 -4
- package/dist/web/server/api-router.d.ts.map +0 -1
- package/dist/web/server/api-router.js +0 -151
- package/dist/web/server/local-web-server.d.ts +0 -12
- package/dist/web/server/local-web-server.d.ts.map +0 -1
- package/dist/web/server/local-web-server.js +0 -100
- package/dist/web-client/assets/index-DneaErDj.css +0 -1
- package/dist/web-client/assets/index-cze_4vtt.js +0 -2
- package/dist/web-client/assets/index-cze_4vtt.js.map +0 -1
- package/dist/web-client/index.html +0 -61
- package/dist/world/business-map-projector.d.ts +0 -14
- package/dist/world/business-map-projector.d.ts.map +0 -1
- package/dist/world/business-map-projector.js +0 -178
- package/dist/world/types.d.ts +0 -77
- package/dist/world/types.d.ts.map +0 -1
- package/dist/world/types.js +0 -1
- package/dist/world/world-graph-query.d.ts +0 -30
- package/dist/world/world-graph-query.d.ts.map +0 -1
- package/dist/world/world-graph-query.js +0 -252
- package/dist/world/world-model-service.d.ts +0 -21
- package/dist/world/world-model-service.d.ts.map +0 -1
- package/dist/world/world-model-service.js +0 -219
- package/dist/world/world-snapshot-store.d.ts +0 -41
- package/dist/world/world-snapshot-store.d.ts.map +0 -1
- package/dist/world/world-snapshot-store.js +0 -581
- package/docs/README.md +0 -30
- package/docs/architecture/codegraph-backend.md +0 -190
- package/docs/architecture/continuous-business-learning.md +0 -240
- package/docs/architecture/web-viewer.md +0 -225
- package/docs/contracts/cli-v1.md +0 -179
- package/docs/contracts/graph-model.md +0 -106
- package/docs/contracts/graph-patch-v1.md +0 -105
- package/docs/contracts/http-api-v1.md +0 -155
- package/docs/contracts/insights-v1.md +0 -84
- package/docs/log.md +0 -159
- package/docs/mindmaps/semantic-atlas-overview.drawio +0 -255
- package/docs/mindmaps/semantic-atlas-overview.png +0 -0
- package/docs/mindmaps/semantic-atlas-overview.zh-CN.drawio +0 -255
- package/docs/mindmaps/semantic-atlas-overview.zh-CN.png +0 -0
- package/schemas/cli-envelope-v1.schema.json +0 -1244
- package/schemas/evaluation-plan-v1.schema.json +0 -211
- package/schemas/evaluation-run-v1.schema.json +0 -659
- package/schemas/graph-patch-v1.schema.json +0 -392
- package/schemas/insights-envelope-v1.schema.json +0 -428
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type CliEnvelope } from "../contracts/cli.js";
|
|
2
|
-
import { type CliError } from "./cli-error.js";
|
|
3
|
-
import type { CliIo } from "./types.js";
|
|
4
|
-
export declare class CliPresenter {
|
|
5
|
-
private readonly io;
|
|
6
|
-
constructor(io: CliIo);
|
|
7
|
-
write(envelope: CliEnvelope, pretty: boolean): void;
|
|
8
|
-
writeError(error: CliError, context: {
|
|
9
|
-
readonly repository: CliEnvelope["repository"];
|
|
10
|
-
readonly snapshot: CliEnvelope["snapshot"];
|
|
11
|
-
}, pretty: boolean): void;
|
|
12
|
-
writeUnexpectedDiagnostic(error: unknown): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=cli-presenter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-presenter.d.ts","sourceRoot":"","sources":["../../src/cli/cli-presenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,KAAK;IAEtC,KAAK,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAKnD,UAAU,CACR,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE;QACP,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;QAC/C,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAC5C,EACD,MAAM,EAAE,OAAO,GACd,IAAI;IAmBP,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAMhD"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { cliEnvelopeSchema } from "../contracts/cli.js";
|
|
2
|
-
import { errorMessage } from "./cli-error.js";
|
|
3
|
-
export class CliPresenter {
|
|
4
|
-
io;
|
|
5
|
-
constructor(io) {
|
|
6
|
-
this.io = io;
|
|
7
|
-
}
|
|
8
|
-
write(envelope, pretty) {
|
|
9
|
-
const validated = cliEnvelopeSchema.parse(envelope);
|
|
10
|
-
this.io.stdout.write(`${JSON.stringify(validated, null, pretty ? 2 : undefined)}\n`);
|
|
11
|
-
}
|
|
12
|
-
writeError(error, context, pretty) {
|
|
13
|
-
const envelope = cliEnvelopeSchema.parse({
|
|
14
|
-
schemaVersion: 1,
|
|
15
|
-
repository: context.repository,
|
|
16
|
-
snapshot: context.snapshot,
|
|
17
|
-
status: "error",
|
|
18
|
-
data: {
|
|
19
|
-
command: error.command,
|
|
20
|
-
error: {
|
|
21
|
-
code: error.code,
|
|
22
|
-
message: error.message,
|
|
23
|
-
...(error.details === undefined ? {} : { details: error.details }),
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
warnings: [],
|
|
27
|
-
});
|
|
28
|
-
this.write(envelope, pretty);
|
|
29
|
-
}
|
|
30
|
-
writeUnexpectedDiagnostic(error) {
|
|
31
|
-
const diagnostic = error instanceof Error && error.stack !== undefined
|
|
32
|
-
? error.stack
|
|
33
|
-
: errorMessage(error);
|
|
34
|
-
this.io.stderr.write(`${diagnostic}\n`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type InsightsPeriod } from "../contracts/insights.js";
|
|
2
|
-
import { type InsightsRange } from "../insights/insights-store.js";
|
|
3
|
-
import type { CliIo } from "./types.js";
|
|
4
|
-
export declare function runInsightsCli(arguments_: readonly string[], io: CliIo): Promise<number | undefined>;
|
|
5
|
-
export declare function resolveInsightsRange(period: InsightsPeriod, now?: Date): InsightsRange;
|
|
6
|
-
//# sourceMappingURL=insights-cli.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"insights-cli.d.ts","sourceRoot":"","sources":["../../src/cli/insights-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAcxC,wBAAsB,cAAc,CAClC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,KAAK,GACR,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA6B7B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAa,GAAG,aAAa,CAY5F"}
|
package/dist/cli/insights-cli.js
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
|
-
import { feedbackReportUpdateInputSchema, feedbackStatusSchema, insightsEnvelopeSchema, insightsPeriodSchema, } from "../contracts/insights.js";
|
|
54
|
-
import { InsightsStore } from "../insights/insights-store.js";
|
|
55
|
-
class InsightsInputError extends Error {
|
|
56
|
-
}
|
|
57
|
-
export async function runInsightsCli(arguments_, io) {
|
|
58
|
-
if (arguments_[0] !== "insights")
|
|
59
|
-
return undefined;
|
|
60
|
-
let command = identifyInsightsCommand(arguments_);
|
|
61
|
-
try {
|
|
62
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
63
|
-
try {
|
|
64
|
-
const parsed = parseInsightsArguments(arguments_);
|
|
65
|
-
command = parsed.name;
|
|
66
|
-
const store = __addDisposableResource(env_1, new InsightsStore(), false);
|
|
67
|
-
const data = await executeInsightsCommand(parsed, store, io.stdin);
|
|
68
|
-
writeInsightsEnvelope(io, { schemaVersion: 1, status: "ok", data }, parsed.pretty);
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
catch (e_1) {
|
|
72
|
-
env_1.error = e_1;
|
|
73
|
-
env_1.hasError = true;
|
|
74
|
-
}
|
|
75
|
-
finally {
|
|
76
|
-
__disposeResources(env_1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
const inputError = error instanceof InsightsInputError;
|
|
81
|
-
writeInsightsEnvelope(io, {
|
|
82
|
-
schemaVersion: 1,
|
|
83
|
-
status: "error",
|
|
84
|
-
data: {
|
|
85
|
-
command,
|
|
86
|
-
error: {
|
|
87
|
-
code: inputError ? "INVALID_INPUT" : "INTERNAL_ERROR",
|
|
88
|
-
message: inputError ? error.message : "Semantic Atlas insights failed unexpectedly.",
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
}, false);
|
|
92
|
-
if (!inputError && error instanceof Error && error.stack !== undefined) {
|
|
93
|
-
io.stderr.write(`${error.stack}\n`);
|
|
94
|
-
}
|
|
95
|
-
return inputError ? 2 : 1;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
export function resolveInsightsRange(period, now = new Date()) {
|
|
99
|
-
if (period === "all") {
|
|
100
|
-
return { from: "1970-01-01T00:00:00.000Z", to: "9999-12-31T23:59:59.999Z" };
|
|
101
|
-
}
|
|
102
|
-
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
103
|
-
const start = new Date(today);
|
|
104
|
-
if (period === "yesterday")
|
|
105
|
-
start.setDate(start.getDate() - 1);
|
|
106
|
-
if (period === "7d")
|
|
107
|
-
start.setDate(start.getDate() - 6);
|
|
108
|
-
if (period === "30d")
|
|
109
|
-
start.setDate(start.getDate() - 29);
|
|
110
|
-
const end = period === "yesterday" ? today : new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
|
|
111
|
-
return { from: start.toISOString(), to: end.toISOString() };
|
|
112
|
-
}
|
|
113
|
-
async function executeInsightsCommand(command, store, stdin) {
|
|
114
|
-
if (command.name === "insights.summary") {
|
|
115
|
-
const range = resolveInsightsRange(command.period);
|
|
116
|
-
return { command: command.name, range, summary: store.summary(range) };
|
|
117
|
-
}
|
|
118
|
-
if (command.name === "insights.feedback") {
|
|
119
|
-
const range = resolveInsightsRange(command.period);
|
|
120
|
-
return { command: command.name, range, reports: store.listFeedback(range, command.status) };
|
|
121
|
-
}
|
|
122
|
-
const input = await readJsonStandardInput(stdin, command.name);
|
|
123
|
-
const parsed = feedbackReportUpdateInputSchema.safeParse(input);
|
|
124
|
-
if (!parsed.success) {
|
|
125
|
-
throw new InsightsInputError("The feedback update input is invalid.");
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
command: command.name,
|
|
129
|
-
report: store.updateFeedback({
|
|
130
|
-
id: parsed.data.id,
|
|
131
|
-
status: parsed.data.status,
|
|
132
|
-
note: parsed.data.note,
|
|
133
|
-
}),
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
function parseInsightsArguments(arguments_) {
|
|
137
|
-
const argumentsWithoutPretty = removePrettyOption(arguments_.slice(1));
|
|
138
|
-
const [subcommand, action, ...rest] = argumentsWithoutPretty.remaining;
|
|
139
|
-
if (subcommand === "summary") {
|
|
140
|
-
return {
|
|
141
|
-
name: "insights.summary",
|
|
142
|
-
period: parsePeriodOption([action, ...rest], "insights summary"),
|
|
143
|
-
pretty: argumentsWithoutPretty.pretty,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
if (subcommand === "feedback" && action === "update") {
|
|
147
|
-
if (rest.length !== 1 || rest[0] !== "--stdin") {
|
|
148
|
-
throw new InsightsInputError("insights feedback update requires exactly --stdin.");
|
|
149
|
-
}
|
|
150
|
-
return { name: "insights.feedback.update", pretty: argumentsWithoutPretty.pretty };
|
|
151
|
-
}
|
|
152
|
-
if (subcommand === "feedback") {
|
|
153
|
-
const options = parseOptions([action, ...rest].filter(isDefined), ["--period", "--status"], "insights feedback");
|
|
154
|
-
const statusValue = options.get("--status");
|
|
155
|
-
const parsedStatus = statusValue === undefined ? undefined : feedbackStatusSchema.safeParse(statusValue);
|
|
156
|
-
if (parsedStatus !== undefined && !parsedStatus.success) {
|
|
157
|
-
throw new InsightsInputError("--status must be a feedback status.");
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
name: "insights.feedback",
|
|
161
|
-
period: parsePeriod(options.get("--period")),
|
|
162
|
-
...(parsedStatus === undefined ? {} : { status: parsedStatus.data }),
|
|
163
|
-
pretty: argumentsWithoutPretty.pretty,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
throw new InsightsInputError("The insights command is invalid.");
|
|
167
|
-
}
|
|
168
|
-
function removePrettyOption(arguments_) {
|
|
169
|
-
const remaining = [];
|
|
170
|
-
let pretty = false;
|
|
171
|
-
for (const argument of arguments_) {
|
|
172
|
-
if (argument === "--pretty") {
|
|
173
|
-
if (pretty)
|
|
174
|
-
throw new InsightsInputError("--pretty may only be provided once.");
|
|
175
|
-
pretty = true;
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
remaining.push(argument);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
return { remaining, pretty };
|
|
182
|
-
}
|
|
183
|
-
function parsePeriodOption(arguments_, command) {
|
|
184
|
-
return parsePeriod(parseOptions(arguments_.filter(isDefined), ["--period"], command).get("--period"));
|
|
185
|
-
}
|
|
186
|
-
function parseOptions(arguments_, allowed, command) {
|
|
187
|
-
if (arguments_.length % 2 !== 0) {
|
|
188
|
-
throw new InsightsInputError(`${command} options require values.`);
|
|
189
|
-
}
|
|
190
|
-
const options = new Map();
|
|
191
|
-
for (let index = 0; index < arguments_.length; index += 2) {
|
|
192
|
-
const option = arguments_[index];
|
|
193
|
-
const value = arguments_[index + 1];
|
|
194
|
-
if (!allowed.includes(option) || value.startsWith("-") || options.has(option)) {
|
|
195
|
-
throw new InsightsInputError(`${command} accepts only ${allowed.join(" and ")}.`);
|
|
196
|
-
}
|
|
197
|
-
options.set(option, value);
|
|
198
|
-
}
|
|
199
|
-
return options;
|
|
200
|
-
}
|
|
201
|
-
function parsePeriod(value) {
|
|
202
|
-
if (value === undefined)
|
|
203
|
-
return "today";
|
|
204
|
-
const parsed = insightsPeriodSchema.safeParse(value);
|
|
205
|
-
if (!parsed.success) {
|
|
206
|
-
throw new InsightsInputError("--period must be one of today, yesterday, 7d, 30d, or all.");
|
|
207
|
-
}
|
|
208
|
-
return parsed.data;
|
|
209
|
-
}
|
|
210
|
-
async function readJsonStandardInput(stream, command) {
|
|
211
|
-
let contents = "";
|
|
212
|
-
for await (const chunk of stream)
|
|
213
|
-
contents += String(chunk);
|
|
214
|
-
try {
|
|
215
|
-
return JSON.parse(contents);
|
|
216
|
-
}
|
|
217
|
-
catch {
|
|
218
|
-
throw new InsightsInputError(`${command} requires one complete JSON value on standard input.`);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
function identifyInsightsCommand(arguments_) {
|
|
222
|
-
if (arguments_[0] !== "insights")
|
|
223
|
-
return null;
|
|
224
|
-
if (arguments_[1] === "summary")
|
|
225
|
-
return "insights.summary";
|
|
226
|
-
if (arguments_[1] !== "feedback")
|
|
227
|
-
return null;
|
|
228
|
-
return arguments_[2] === "update" ? "insights.feedback.update" : "insights.feedback";
|
|
229
|
-
}
|
|
230
|
-
function writeInsightsEnvelope(io, envelope, pretty) {
|
|
231
|
-
const validated = insightsEnvelopeSchema.parse(envelope);
|
|
232
|
-
io.stdout.write(`${JSON.stringify(validated, null, pretty ? 2 : undefined)}\n`);
|
|
233
|
-
}
|
|
234
|
-
function isDefined(value) {
|
|
235
|
-
return value !== undefined;
|
|
236
|
-
}
|
package/dist/cli/main.d.ts
DELETED
package/dist/cli/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAkB,KAAK,EAAE,MAAM,YAAY,CAAC;AAExD,wBAAsB,MAAM,CAC1B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,KAAK,EACT,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAkEjB"}
|
package/dist/cli/main.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
-
if (value !== null && value !== void 0) {
|
|
3
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
-
var dispose, inner;
|
|
5
|
-
if (async) {
|
|
6
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
-
dispose = value[Symbol.asyncDispose];
|
|
8
|
-
}
|
|
9
|
-
if (dispose === void 0) {
|
|
10
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
-
dispose = value[Symbol.dispose];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
-
}
|
|
18
|
-
else if (async) {
|
|
19
|
-
env.stack.push({ async: true });
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
-
return function (env) {
|
|
25
|
-
function fail(e) {
|
|
26
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
-
env.hasError = true;
|
|
28
|
-
}
|
|
29
|
-
var r, s = 0;
|
|
30
|
-
function next() {
|
|
31
|
-
while (r = env.stack.pop()) {
|
|
32
|
-
try {
|
|
33
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
-
if (r.dispose) {
|
|
35
|
-
var result = r.dispose.call(r.value);
|
|
36
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
-
}
|
|
38
|
-
else s |= 1;
|
|
39
|
-
}
|
|
40
|
-
catch (e) {
|
|
41
|
-
fail(e);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
-
if (env.hasError) throw env.error;
|
|
46
|
-
}
|
|
47
|
-
return next();
|
|
48
|
-
};
|
|
49
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
-
var e = new Error(message);
|
|
51
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
-
});
|
|
53
|
-
import { InsightsStore } from "../insights/insights-store.js";
|
|
54
|
-
import { parseCliArguments } from "./argument-parser.js";
|
|
55
|
-
import { CliApplication } from "./cli-application.js";
|
|
56
|
-
import { classifyCliError, CliError } from "./cli-error.js";
|
|
57
|
-
import { CliPresenter } from "./cli-presenter.js";
|
|
58
|
-
export async function runCli(arguments_, io, currentDirectory) {
|
|
59
|
-
const presenter = new CliPresenter(io);
|
|
60
|
-
let pretty = arguments_.includes("--pretty");
|
|
61
|
-
let command = null;
|
|
62
|
-
let repository = null;
|
|
63
|
-
let snapshot = null;
|
|
64
|
-
let application;
|
|
65
|
-
let observedRepository = null;
|
|
66
|
-
let outcome = "error";
|
|
67
|
-
let warningCodes = [];
|
|
68
|
-
let exitCode = 1;
|
|
69
|
-
const startedAt = performance.now();
|
|
70
|
-
try {
|
|
71
|
-
const invocation = parseCliArguments(arguments_, currentDirectory);
|
|
72
|
-
pretty = invocation.pretty;
|
|
73
|
-
command = invocation.command.name;
|
|
74
|
-
application = new CliApplication(io);
|
|
75
|
-
const context = await application.openRepository(invocation.repo, command);
|
|
76
|
-
observedRepository = context.repository;
|
|
77
|
-
({ repository, snapshot } = application.responseContext(context));
|
|
78
|
-
const result = await application.execute(invocation.command, context);
|
|
79
|
-
const responseContext = invocation.command.name === "index"
|
|
80
|
-
? await application.openRepository(context.repository.worktreeRoot, command)
|
|
81
|
-
: context;
|
|
82
|
-
const envelope = application.envelope(result, responseContext);
|
|
83
|
-
snapshot = envelope.snapshot;
|
|
84
|
-
outcome = envelope.status;
|
|
85
|
-
warningCodes = envelope.warnings.map((warning) => warning.code);
|
|
86
|
-
presenter.write(envelope, pretty);
|
|
87
|
-
exitCode = 0;
|
|
88
|
-
return exitCode;
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
const classified = classifyCliError(error, command);
|
|
92
|
-
if (application !== undefined && command !== null && repository !== null) {
|
|
93
|
-
try {
|
|
94
|
-
const failureContext = await application.openRepository(repository.root, command);
|
|
95
|
-
({ repository, snapshot } = application.responseContext(failureContext));
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
// Preserve the last successfully resolved response context.
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
presenter.writeError(classified, { repository, snapshot }, pretty);
|
|
102
|
-
if (classified.exitCode === 1 && !(error instanceof CliError)) {
|
|
103
|
-
presenter.writeUnexpectedDiagnostic(error);
|
|
104
|
-
}
|
|
105
|
-
exitCode = classified.exitCode;
|
|
106
|
-
return exitCode;
|
|
107
|
-
}
|
|
108
|
-
finally {
|
|
109
|
-
if (command !== null && observedRepository !== null) {
|
|
110
|
-
try {
|
|
111
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
112
|
-
try {
|
|
113
|
-
const insights = __addDisposableResource(env_1, new InsightsStore(), false);
|
|
114
|
-
insights.recordCommand({
|
|
115
|
-
repositoryId: observedRepository.repositoryId,
|
|
116
|
-
command: command,
|
|
117
|
-
outcome,
|
|
118
|
-
exitCode,
|
|
119
|
-
warningCodes,
|
|
120
|
-
durationMs: performance.now() - startedAt,
|
|
121
|
-
snapshotId: snapshot?.id ?? null,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
catch (e_1) {
|
|
125
|
-
env_1.error = e_1;
|
|
126
|
-
env_1.hasError = true;
|
|
127
|
-
}
|
|
128
|
-
finally {
|
|
129
|
-
__disposeResources(env_1);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
catch {
|
|
133
|
-
// Observability must not change the outcome or output of a development command.
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"standalone-cli.d.ts","sourceRoot":"","sources":["../../src/cli/standalone-cli.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAqCxC,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,KAAK,GACR,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA6D7B"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { readPackageVersion } from "../package-metadata.js";
|
|
2
|
-
import { SemanticAtlasPackageUpgrader } from "../setup/package-upgrader.js";
|
|
3
|
-
import { SkillInstaller } from "../setup/skill-installer.js";
|
|
4
|
-
const helpText = `Usage: semantic-atlas <command> [options]
|
|
5
|
-
|
|
6
|
-
Project understanding:
|
|
7
|
-
status Report Atlas state and freshness
|
|
8
|
-
index Publish the current project world
|
|
9
|
-
map view [business-key] View or zoom into business regions
|
|
10
|
-
map search <business-term> Search learned business vocabulary
|
|
11
|
-
map show <business-key> Show one business concept and evidence
|
|
12
|
-
code search <structural-term> Find bounded structural source evidence
|
|
13
|
-
learn --stdin Apply one GraphPatch JSON value
|
|
14
|
-
changes [--from id] [--to id] Report semantic changes
|
|
15
|
-
feedback report --stdin Record confirmed product friction
|
|
16
|
-
|
|
17
|
-
Human browsing:
|
|
18
|
-
web [--repo path] [--port n] Start the local read-only desktop viewer
|
|
19
|
-
|
|
20
|
-
Installation and information:
|
|
21
|
-
insights summary [--period period] Summarize local Atlas product signals
|
|
22
|
-
insights feedback [options] List local Agent feedback reports
|
|
23
|
-
insights feedback update --stdin Record a feedback triage decision
|
|
24
|
-
setup Install or update the bundled user Skills
|
|
25
|
-
upgrade Install the latest release and sync its Skills
|
|
26
|
-
-h, --help Show this help
|
|
27
|
-
--version Print the installed package version
|
|
28
|
-
|
|
29
|
-
Global project options:
|
|
30
|
-
--repo <path> Select a Git worktree (default: cwd)
|
|
31
|
-
--pretty Indent JSON project or insights output
|
|
32
|
-
|
|
33
|
-
Web options:
|
|
34
|
-
--port <n> Bind 127.0.0.1 on this port (default: 4310)
|
|
35
|
-
--no-open Do not open the default browser
|
|
36
|
-
--repo <path> Select an eligible initial project
|
|
37
|
-
`;
|
|
38
|
-
export async function runStandaloneCli(arguments_, io) {
|
|
39
|
-
const [command, ...rest] = arguments_;
|
|
40
|
-
if (command === "help" || command === "--help" || command === "-h") {
|
|
41
|
-
return writeArgumentFreeResult(rest, io, () => helpText);
|
|
42
|
-
}
|
|
43
|
-
if (command === "version" || command === "--version" || command === "-v") {
|
|
44
|
-
return writeArgumentFreeResult(rest, io, async () => `${await readPackageVersion()}\n`);
|
|
45
|
-
}
|
|
46
|
-
if (command === "setup") {
|
|
47
|
-
if (rest.length > 0) {
|
|
48
|
-
io.stderr.write("semantic-atlas setup does not accept arguments.\n");
|
|
49
|
-
return 2;
|
|
50
|
-
}
|
|
51
|
-
try {
|
|
52
|
-
const version = await readPackageVersion();
|
|
53
|
-
const result = await new SkillInstaller({ version }).install();
|
|
54
|
-
const action = result.outcome === "current"
|
|
55
|
-
? "Semantic Atlas Skills are already current at"
|
|
56
|
-
: result.outcome === "installed"
|
|
57
|
-
? "Installed Semantic Atlas Skills at"
|
|
58
|
-
: "Updated Semantic Atlas Skills at";
|
|
59
|
-
io.stdout.write(`${action} ${result.targetDirectory}\n`);
|
|
60
|
-
io.stdout.write(`Semantic Atlas Insights Skill is synchronized at ${result.insightsTargetDirectory}\n`);
|
|
61
|
-
for (const directory of result.removedLegacyDirectories) {
|
|
62
|
-
io.stdout.write(`Removed legacy Semantic Atlas Skill at ${directory}\n`);
|
|
63
|
-
}
|
|
64
|
-
return 0;
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
io.stderr.write(`Semantic Atlas setup failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
68
|
-
return 1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (command === "upgrade") {
|
|
72
|
-
if (rest.length > 0) {
|
|
73
|
-
io.stderr.write("semantic-atlas upgrade does not accept arguments.\n");
|
|
74
|
-
return 2;
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
const currentVersion = await readPackageVersion();
|
|
78
|
-
io.stdout.write("Checking the latest stable Semantic Atlas release...\n");
|
|
79
|
-
const result = await new SemanticAtlasPackageUpgrader({ currentVersion }).upgrade();
|
|
80
|
-
if (result.outcome === "current") {
|
|
81
|
-
io.stdout.write(`Semantic Atlas ${result.targetVersion} is already current.\n`);
|
|
82
|
-
io.stdout.write(`Semantic Atlas Skills are synchronized at ${result.skillDirectory}\n`);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
io.stdout.write(`Upgraded Semantic Atlas from ${result.previousVersion} to ${result.targetVersion}.\n`);
|
|
86
|
-
io.stdout.write(`Semantic Atlas Skills are synchronized at ${result.skillDirectory}\n`);
|
|
87
|
-
}
|
|
88
|
-
return 0;
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
io.stderr.write(`Semantic Atlas upgrade failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
92
|
-
return 1;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
async function writeArgumentFreeResult(rest, io, contents) {
|
|
98
|
-
if (rest.length > 0) {
|
|
99
|
-
io.stderr.write("The command does not accept arguments.\n");
|
|
100
|
-
return 2;
|
|
101
|
-
}
|
|
102
|
-
io.stdout.write(await contents());
|
|
103
|
-
return 0;
|
|
104
|
-
}
|
package/dist/cli/types.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { CliEnvelope } from "../contracts/cli.js";
|
|
2
|
-
export type CliCommandName = Exclude<CliEnvelope["data"]["command"], null>;
|
|
3
|
-
export type ParsedCommand = {
|
|
4
|
-
readonly name: "status";
|
|
5
|
-
} | {
|
|
6
|
-
readonly name: "index";
|
|
7
|
-
} | {
|
|
8
|
-
readonly name: "map.view";
|
|
9
|
-
readonly focusKey?: string;
|
|
10
|
-
} | {
|
|
11
|
-
readonly name: "map.search";
|
|
12
|
-
readonly query: string;
|
|
13
|
-
readonly limit: number;
|
|
14
|
-
} | {
|
|
15
|
-
readonly name: "map.show";
|
|
16
|
-
readonly businessKey: string;
|
|
17
|
-
} | {
|
|
18
|
-
readonly name: "code.search";
|
|
19
|
-
readonly query: string;
|
|
20
|
-
readonly limit: number;
|
|
21
|
-
} | {
|
|
22
|
-
readonly name: "learn";
|
|
23
|
-
} | {
|
|
24
|
-
readonly name: "feedback.report";
|
|
25
|
-
} | {
|
|
26
|
-
readonly name: "changes";
|
|
27
|
-
readonly fromSnapshotId?: string;
|
|
28
|
-
readonly toSnapshotId?: string;
|
|
29
|
-
};
|
|
30
|
-
export interface ParsedInvocation {
|
|
31
|
-
readonly repo: string;
|
|
32
|
-
readonly pretty: boolean;
|
|
33
|
-
readonly command: ParsedCommand;
|
|
34
|
-
}
|
|
35
|
-
export interface CliWarning {
|
|
36
|
-
readonly code: string;
|
|
37
|
-
readonly message: string;
|
|
38
|
-
readonly details?: unknown;
|
|
39
|
-
}
|
|
40
|
-
export interface CommandResult {
|
|
41
|
-
readonly data: unknown;
|
|
42
|
-
readonly warnings: readonly CliWarning[];
|
|
43
|
-
}
|
|
44
|
-
export interface CliIo {
|
|
45
|
-
readonly stdin: NodeJS.ReadableStream;
|
|
46
|
-
readonly stdout: NodeJS.WritableStream;
|
|
47
|
-
readonly stderr: NodeJS.WritableStream;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/cli/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cli/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;AAE3E,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChF;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;CAAE,GACpC;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEN,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;CAC1C;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CACxC"}
|
package/dist/cli/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/cli/web-cli.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CliIo } from "./types.js";
|
|
2
|
-
export interface ParsedWebArguments {
|
|
3
|
-
readonly initialRepositoryPath: string | undefined;
|
|
4
|
-
readonly port: number;
|
|
5
|
-
readonly openBrowser: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function parseWebArguments(arguments_: readonly string[], currentDirectory: string): ParsedWebArguments | undefined;
|
|
8
|
-
export declare function runWebCli(arguments_: readonly string[], io: CliIo, currentDirectory: string): Promise<number | undefined>;
|
|
9
|
-
//# sourceMappingURL=web-cli.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web-cli.d.ts","sourceRoot":"","sources":["../../src/cli/web-cli.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,gBAAgB,EAAE,MAAM,GACvB,kBAAkB,GAAG,SAAS,CAiDhC;AAED,wBAAsB,SAAS,CAC7B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,EAAE,EAAE,KAAK,EACT,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqC7B"}
|