@isaacriehm/cairn-core 0.19.1 → 0.22.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/dist/.tsbuildinfo +1 -1
- package/dist/align-undo/log.js +3 -2
- package/dist/align-undo/log.js.map +1 -1
- package/dist/attention/index.d.ts +0 -2
- package/dist/attention/index.js +0 -2
- package/dist/attention/index.js.map +1 -1
- package/dist/attention/restore.d.ts +1 -1
- package/dist/attention/restore.js +1 -1
- package/dist/attention/source-strip.d.ts +2 -2
- package/dist/attention/source-strip.js +4 -3
- package/dist/attention/source-strip.js.map +1 -1
- package/dist/components/audit.d.ts +7 -1
- package/dist/components/audit.js +144 -72
- package/dist/components/audit.js.map +1 -1
- package/dist/components/emit.js +33 -6
- package/dist/components/emit.js.map +1 -1
- package/dist/components/freshness.d.ts +51 -0
- package/dist/components/freshness.js +121 -0
- package/dist/components/freshness.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/reconfirm.d.ts +64 -0
- package/dist/components/reconfirm.js +204 -0
- package/dist/components/reconfirm.js.map +1 -0
- package/dist/context/handoff-builder.js +3 -3
- package/dist/context/handoff-builder.js.map +1 -1
- package/dist/context/task-summary.js +2 -2
- package/dist/context/task-summary.js.map +1 -1
- package/dist/doctor/index.js +102 -9
- package/dist/doctor/index.js.map +1 -1
- package/dist/events/paths.js +2 -2
- package/dist/events/paths.js.map +1 -1
- package/dist/fix-align/sentinel.js +2 -3
- package/dist/fix-align/sentinel.js.map +1 -1
- package/dist/gc/attested-commits.js +2 -2
- package/dist/gc/attested-commits.js.map +1 -1
- package/dist/gc/canary.js +2 -3
- package/dist/gc/canary.js.map +1 -1
- package/dist/gc/citation-integrity.d.ts +4 -5
- package/dist/gc/citation-integrity.js +11 -33
- package/dist/gc/citation-integrity.js.map +1 -1
- package/dist/gc/classify.js +3 -16
- package/dist/gc/classify.js.map +1 -1
- package/dist/gc/completion-integrity.js +4 -3
- package/dist/gc/completion-integrity.js.map +1 -1
- package/dist/gc/entity-orphan.js +66 -12
- package/dist/gc/entity-orphan.js.map +1 -1
- package/dist/gc/ghost-anchor.d.ts +57 -0
- package/dist/gc/ghost-anchor.js +171 -0
- package/dist/gc/ghost-anchor.js.map +1 -0
- package/dist/gc/index.d.ts +2 -0
- package/dist/gc/index.js +1 -0
- package/dist/gc/index.js.map +1 -1
- package/dist/gc/sweep.d.ts +1 -1
- package/dist/gc/sweep.js +13 -1
- package/dist/gc/sweep.js.map +1 -1
- package/dist/gc/types.d.ts +1 -1
- package/dist/hooks/bypass-detection.js +3 -2
- package/dist/hooks/bypass-detection.js.map +1 -1
- package/dist/hooks/defer.js +3 -2
- package/dist/hooks/defer.js.map +1 -1
- package/dist/hooks/ghost-backup.d.ts +37 -0
- package/dist/hooks/ghost-backup.js +82 -0
- package/dist/hooks/ghost-backup.js.map +1 -0
- package/dist/hooks/post-tool-use/allowlist-reader.js +2 -2
- package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -1
- package/dist/hooks/post-tool-use/ask-user-blocked.d.ts +1 -2
- package/dist/hooks/post-tool-use/ask-user-blocked.js +3 -4
- package/dist/hooks/post-tool-use/ask-user-blocked.js.map +1 -1
- package/dist/hooks/post-tool-use/citation-scanner.d.ts +9 -7
- package/dist/hooks/post-tool-use/citation-scanner.js +9 -14
- package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -1
- package/dist/hooks/post-tool-use/legend-builder.d.ts +2 -2
- package/dist/hooks/post-tool-use/legend-builder.js +1 -19
- package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
- package/dist/hooks/post-tool-use/post-write.js +18 -1
- package/dist/hooks/post-tool-use/post-write.js.map +1 -1
- package/dist/hooks/post-tool-use/read-enricher.d.ts +2 -2
- package/dist/hooks/post-tool-use/read-enricher.js +4 -6
- package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
- package/dist/hooks/post-tool-use/sot-align.js +29 -3
- package/dist/hooks/post-tool-use/sot-align.js.map +1 -1
- package/dist/hooks/post-tool-use/write-guardian.d.ts +1 -5
- package/dist/hooks/post-tool-use/write-guardian.js +25 -18
- package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
- package/dist/hooks/runners/context-threshold.js +3 -3
- package/dist/hooks/runners/context-threshold.js.map +1 -1
- package/dist/hooks/runners/payload.js +2 -1
- package/dist/hooks/runners/payload.js.map +1 -1
- package/dist/hooks/runners/phase-ready-surface.js +3 -2
- package/dist/hooks/runners/phase-ready-surface.js.map +1 -1
- package/dist/hooks/runners/session-start.js +103 -4
- package/dist/hooks/runners/session-start.js.map +1 -1
- package/dist/hooks/runners/stop.js +46 -42
- package/dist/hooks/runners/stop.js.map +1 -1
- package/dist/hooks/runners/user-prompt-submit.d.ts +2 -2
- package/dist/hooks/runners/user-prompt-submit.js +4 -9
- package/dist/hooks/runners/user-prompt-submit.js.map +1 -1
- package/dist/hooks/seed-attested.js +3 -2
- package/dist/hooks/seed-attested.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/init/baseline-audit.js +3 -3
- package/dist/init/baseline-audit.js.map +1 -1
- package/dist/init/claude-rule.js +13 -1
- package/dist/init/claude-rule.js.map +1 -1
- package/dist/init/curator/corpus.d.ts +1 -0
- package/dist/init/curator/corpus.js +6 -2
- package/dist/init/curator/corpus.js.map +1 -1
- package/dist/init/curator/emit.js +2 -3
- package/dist/init/curator/emit.js.map +1 -1
- package/dist/init/detect-components.d.ts +3 -2
- package/dist/init/detect-components.js +33 -15
- package/dist/init/detect-components.js.map +1 -1
- package/dist/init/detect.d.ts +1 -5
- package/dist/init/detect.js +157 -143
- package/dist/init/detect.js.map +1 -1
- package/dist/init/eta-calibration.js +2 -2
- package/dist/init/eta-calibration.js.map +1 -1
- package/dist/init/glob-inference.js +24 -0
- package/dist/init/glob-inference.js.map +1 -1
- package/dist/init/index.d.ts +4 -4
- package/dist/init/index.js +2 -2
- package/dist/init/index.js.map +1 -1
- package/dist/init/init.d.ts +8 -0
- package/dist/init/init.js +16 -20
- package/dist/init/init.js.map +1 -1
- package/dist/init/mapper-merge.d.ts +1 -4
- package/dist/init/mapper-merge.js +4 -17
- package/dist/init/mapper-merge.js.map +1 -1
- package/dist/init/mapper-parallel.js +1 -1
- package/dist/init/mapper-parallel.js.map +1 -1
- package/dist/init/mapper-prompts.d.ts +1 -23
- package/dist/init/mapper-prompts.js +1 -25
- package/dist/init/mapper-prompts.js.map +1 -1
- package/dist/init/mapper.d.ts +0 -6
- package/dist/init/mapper.js +2 -5
- package/dist/init/mapper.js.map +1 -1
- package/dist/init/module-slicer.js +3 -24
- package/dist/init/module-slicer.js.map +1 -1
- package/dist/init/multi-dev/install.js +24 -0
- package/dist/init/multi-dev/install.js.map +1 -1
- package/dist/init/overlay.js +5 -16
- package/dist/init/overlay.js.map +1 -1
- package/dist/init/phases/11-baseline.js +1 -1
- package/dist/init/phases/11-baseline.js.map +1 -1
- package/dist/init/phases/4-seed.js +7 -5
- package/dist/init/phases/4-seed.js.map +1 -1
- package/dist/init/phases/9a-walker.js +4 -0
- package/dist/init/phases/9a-walker.js.map +1 -1
- package/dist/init/phases/9b-curate.d.ts +1 -0
- package/dist/init/phases/9b-curate.js +6 -2
- package/dist/init/phases/9b-curate.js.map +1 -1
- package/dist/init/phases/9d-comp-walk.js +3 -3
- package/dist/init/phases/9d-comp-walk.js.map +1 -1
- package/dist/init/phases/9e-comp-annotate.js +63 -3
- package/dist/init/phases/9e-comp-annotate.js.map +1 -1
- package/dist/init/phases/index.d.ts +0 -1
- package/dist/init/phases/index.js +0 -1
- package/dist/init/phases/index.js.map +1 -1
- package/dist/init/phases/mapper-output-io.d.ts +1 -1
- package/dist/init/phases/mapper-output-io.js +3 -2
- package/dist/init/phases/mapper-output-io.js.map +1 -1
- package/dist/init/phases/state-io.d.ts +1 -1
- package/dist/init/phases/state-io.js +3 -2
- package/dist/init/phases/state-io.js.map +1 -1
- package/dist/init/phases/types.d.ts +20 -8
- package/dist/init/phases/types.js +0 -1
- package/dist/init/phases/types.js.map +1 -1
- package/dist/init/progress.d.ts +1 -0
- package/dist/init/progress.js +3 -1
- package/dist/init/progress.js.map +1 -1
- package/dist/init/rules-merge/ingest.js +3 -3
- package/dist/init/rules-merge/ingest.js.map +1 -1
- package/dist/init/seed.js +54 -5
- package/dist/init/seed.js.map +1 -1
- package/dist/init/source-comments/strip-replace.d.ts +1 -2
- package/dist/init/source-comments/strip-replace.js +19 -3
- package/dist/init/source-comments/strip-replace.js.map +1 -1
- package/dist/init/source-comments/walker.js +8 -79
- package/dist/init/source-comments/walker.js.map +1 -1
- package/dist/init/types.d.ts +8 -16
- package/dist/init/walker.d.ts +1 -1
- package/dist/init/walker.js +1 -1
- package/dist/join/index.d.ts +9 -0
- package/dist/join/index.js +82 -25
- package/dist/join/index.js.map +1 -1
- package/dist/lock.js +4 -3
- package/dist/lock.js.map +1 -1
- package/dist/mcp/bootstrap-guard.js +10 -1
- package/dist/mcp/bootstrap-guard.js.map +1 -1
- package/dist/mcp/schemas.d.ts +26 -4
- package/dist/mcp/schemas.js +23 -1
- package/dist/mcp/schemas.js.map +1 -1
- package/dist/mcp/serve.js +9 -0
- package/dist/mcp/serve.js.map +1 -1
- package/dist/mcp/server.js +3 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/telemetry.js +4 -3
- package/dist/mcp/telemetry.js.map +1 -1
- package/dist/mcp/tools/component-reconfirm.d.ts +7 -0
- package/dist/mcp/tools/component-reconfirm.js +39 -0
- package/dist/mcp/tools/component-reconfirm.js.map +1 -0
- package/dist/mcp/tools/component-register.d.ts +15 -0
- package/dist/mcp/tools/component-register.js +65 -0
- package/dist/mcp/tools/component-register.js.map +1 -0
- package/dist/mcp/tools/decision-get.js +2 -2
- package/dist/mcp/tools/decision-get.js.map +1 -1
- package/dist/mcp/tools/index.js +5 -6
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/init-phases.d.ts +2 -0
- package/dist/mcp/tools/init-phases.js +21 -5
- package/dist/mcp/tools/init-phases.js.map +1 -1
- package/dist/mcp/tools/mission-advance.d.ts +3 -4
- package/dist/mcp/tools/mission-advance.js +15 -19
- package/dist/mcp/tools/mission-advance.js.map +1 -1
- package/dist/mcp/tools/mission-resume.js +3 -3
- package/dist/mcp/tools/mission-resume.js.map +1 -1
- package/dist/mcp/tools/record-decision.js +17 -9
- package/dist/mcp/tools/record-decision.js.map +1 -1
- package/dist/mcp/tools/resolve-attention.js +70 -34
- package/dist/mcp/tools/resolve-attention.js.map +1 -1
- package/dist/mcp/tools/resume.js +3 -2
- package/dist/mcp/tools/resume.js.map +1 -1
- package/dist/mcp/tools/search.js +2 -2
- package/dist/mcp/tools/search.js.map +1 -1
- package/dist/mcp/tools/task-complete.js +2 -3
- package/dist/mcp/tools/task-complete.js.map +1 -1
- package/dist/mcp/tools/task-create.js +2 -2
- package/dist/mcp/tools/task-create.js.map +1 -1
- package/dist/migrate/config-io.d.ts +24 -0
- package/dist/migrate/config-io.js +73 -0
- package/dist/migrate/config-io.js.map +1 -0
- package/dist/migrate/gitignore.d.ts +28 -0
- package/dist/migrate/gitignore.js +82 -0
- package/dist/migrate/gitignore.js.map +1 -0
- package/dist/migrate/index.d.ts +6 -0
- package/dist/migrate/index.js +6 -0
- package/dist/migrate/index.js.map +1 -0
- package/dist/migrate/migrations/0001-drop-dead-config-fields.d.ts +12 -0
- package/dist/migrate/migrations/0001-drop-dead-config-fields.js +39 -0
- package/dist/migrate/migrations/0001-drop-dead-config-fields.js.map +1 -0
- package/dist/migrate/migrations/0002-backfill-gitignore.d.ts +14 -0
- package/dist/migrate/migrations/0002-backfill-gitignore.js +40 -0
- package/dist/migrate/migrations/0002-backfill-gitignore.js.map +1 -0
- package/dist/migrate/registry.d.ts +9 -0
- package/dist/migrate/registry.js +11 -0
- package/dist/migrate/registry.js.map +1 -0
- package/dist/migrate/runner.d.ts +45 -0
- package/dist/migrate/runner.js +177 -0
- package/dist/migrate/runner.js.map +1 -0
- package/dist/migrate/semver.d.ts +11 -0
- package/dist/migrate/semver.js +35 -0
- package/dist/migrate/semver.js.map +1 -0
- package/dist/migrate/types.d.ts +47 -0
- package/dist/migrate/types.js +13 -0
- package/dist/migrate/types.js.map +1 -0
- package/dist/missions/task-link.js +7 -8
- package/dist/missions/task-link.js.map +1 -1
- package/dist/paths/index.d.ts +12 -1
- package/dist/paths/index.js +17 -3
- package/dist/paths/index.js.map +1 -1
- package/dist/sensors/catalog.js +6 -11
- package/dist/sensors/catalog.js.map +1 -1
- package/dist/sensors/decisions.js +55 -19
- package/dist/sensors/decisions.js.map +1 -1
- package/dist/sensors/diff.d.ts +12 -0
- package/dist/sensors/diff.js +103 -0
- package/dist/sensors/diff.js.map +1 -1
- package/dist/sensors/index.d.ts +4 -5
- package/dist/sensors/index.js +2 -3
- package/dist/sensors/index.js.map +1 -1
- package/dist/sensors/runner.d.ts +34 -37
- package/dist/sensors/runner.js +63 -53
- package/dist/sensors/runner.js.map +1 -1
- package/dist/sensors/stub-catalog.d.ts +6 -3
- package/dist/sensors/stub-catalog.js +7 -19
- package/dist/sensors/stub-catalog.js.map +1 -1
- package/dist/sensors/types.d.ts +11 -55
- package/dist/sensors/types.js +4 -8
- package/dist/sensors/types.js.map +1 -1
- package/dist/session-start/build.js +36 -21
- package/dist/session-start/build.js.map +1 -1
- package/dist/session-start/templates.d.ts +1 -1
- package/dist/session-start/templates.js +1 -1
- package/dist/status-line/event-queue.js +2 -1
- package/dist/status-line/event-queue.js.map +1 -1
- package/dist/status-line/reader.js +5 -5
- package/dist/status-line/reader.js.map +1 -1
- package/dist/status-line/writer.js +2 -1
- package/dist/status-line/writer.js.map +1 -1
- package/dist/tasks/lifecycle.d.ts +3 -4
- package/dist/tasks/lifecycle.js +19 -21
- package/dist/tasks/lifecycle.js.map +1 -1
- package/dist/trace/index.js +2 -2
- package/dist/trace/index.js.map +1 -1
- package/dist/update-check.d.ts +28 -0
- package/dist/update-check.js +137 -0
- package/dist/update-check.js.map +1 -0
- package/package.json +2 -2
- package/templates/.cairn/git-hooks/commit-msg +33 -5
- package/templates/.cairn/git-hooks/post-commit +13 -3
- package/templates/.cairn/git-hooks/pre-commit +48 -22
- package/templates/.github/workflows/cairn-check.yml +8 -0
- package/dist/attention/bulk-accept.d.ts +0 -78
- package/dist/attention/bulk-accept.js +0 -348
- package/dist/attention/bulk-accept.js.map +0 -1
- package/dist/attention/serve/api.d.ts +0 -24
- package/dist/attention/serve/api.js +0 -383
- package/dist/attention/serve/api.js.map +0 -1
- package/dist/attention/serve/index.d.ts +0 -63
- package/dist/attention/serve/index.js +0 -219
- package/dist/attention/serve/index.js.map +0 -1
- package/dist/hooks/read-enrich.d.ts +0 -6
- package/dist/hooks/read-enrich.js +0 -11
- package/dist/hooks/read-enrich.js.map +0 -1
- package/dist/hooks/write-guard.d.ts +0 -6
- package/dist/hooks/write-guard.js +0 -11
- package/dist/hooks/write-guard.js.map +0 -1
- package/dist/init/phases/12-strip.d.ts +0 -10
- package/dist/init/phases/12-strip.js +0 -88
- package/dist/init/phases/12-strip.js.map +0 -1
- package/dist/mcp/tools/attention-serve.d.ts +0 -23
- package/dist/mcp/tools/attention-serve.js +0 -84
- package/dist/mcp/tools/attention-serve.js.map +0 -1
- package/dist/mcp/tools/attention-wait.d.ts +0 -18
- package/dist/mcp/tools/attention-wait.js +0 -84
- package/dist/mcp/tools/attention-wait.js.map +0 -1
- package/dist/mcp/tools/bulk-accept-attention.d.ts +0 -22
- package/dist/mcp/tools/bulk-accept-attention.js +0 -84
- package/dist/mcp/tools/bulk-accept-attention.js.map +0 -1
- package/dist/sensors/attestation.d.ts +0 -44
- package/dist/sensors/attestation.js +0 -262
- package/dist/sensors/attestation.js.map +0 -1
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export { getDiff, diffHasGlobMatch, filterDiffByGlobs } from "./diff.js";
|
|
1
|
+
export type { DiffEntry, ProjectGlobs, SensorFinding, SensorLanguage, SensorResult, SensorSweepResult, StubCatalog, StubPattern, } from "./types.js";
|
|
2
|
+
export { getDiff, getStagedDiff, getRangeDiff, diffHasGlobMatch, filterDiffByGlobs, } from "./diff.js";
|
|
3
3
|
export { loadStubCatalog, parseStubCatalog, loadSensorRegistry } from "./catalog.js";
|
|
4
4
|
export type { SensorRegistry, SensorRegistryEntry } from "./catalog.js";
|
|
5
5
|
export { detectStubMatches, runStubCatalog, detectLanguage } from "./stub-catalog.js";
|
|
6
6
|
export type { StubMatch } from "./stub-catalog.js";
|
|
7
|
-
export { extractAttestation, runAttestationCrossCheck, } from "./attestation.js";
|
|
8
7
|
export { runRouteHandlerNonEmpty, runDtoNoFakeFields, } from "./structural.js";
|
|
9
8
|
export { loadAcceptedDecisions, decisionsInScope, listMirrorFiles, runDecisionAssertions, } from "./decisions.js";
|
|
10
9
|
export { formatRemediation } from "./remediation.js";
|
|
11
10
|
export type { RemediationOptions } from "./remediation.js";
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
11
|
+
export { runSensorsOnDiff, loadProjectGlobs } from "./runner.js";
|
|
12
|
+
export type { RunSensorsOnDiffArgs } from "./runner.js";
|
package/dist/sensors/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export { getDiff, diffHasGlobMatch, filterDiffByGlobs } from "./diff.js";
|
|
1
|
+
export { getDiff, getStagedDiff, getRangeDiff, diffHasGlobMatch, filterDiffByGlobs, } from "./diff.js";
|
|
2
2
|
export { loadStubCatalog, parseStubCatalog, loadSensorRegistry } from "./catalog.js";
|
|
3
3
|
export { detectStubMatches, runStubCatalog, detectLanguage } from "./stub-catalog.js";
|
|
4
|
-
export { extractAttestation, runAttestationCrossCheck, } from "./attestation.js";
|
|
5
4
|
export { runRouteHandlerNonEmpty, runDtoNoFakeFields, } from "./structural.js";
|
|
6
5
|
export { loadAcceptedDecisions, decisionsInScope, listMirrorFiles, runDecisionAssertions, } from "./decisions.js";
|
|
7
6
|
export { formatRemediation } from "./remediation.js";
|
|
8
|
-
export {
|
|
7
|
+
export { runSensorsOnDiff, loadProjectGlobs } from "./runner.js";
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sensors/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sensors/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/sensors/runner.d.ts
CHANGED
|
@@ -1,44 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sensor
|
|
2
|
+
* Sensor sweep — the live enforcement entry point.
|
|
3
3
|
*
|
|
4
|
-
* Composes
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Composes the sensors that actually have teeth into one diff-scoped sweep:
|
|
5
|
+
* - Layer A — stub-pattern catalog (mechanical debt regex)
|
|
6
|
+
* - Layer C — generic structural sensors (route handlers, DTOs)
|
|
7
|
+
* - decision-assertions — "was the in-scope DEC honored?"
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Runs at the real gates: pre-commit (staged diff), CI (`--diff` range), and
|
|
10
|
+
* advisory at the Stop hook (working-tree diff). The diff + repoRoot are the
|
|
11
|
+
* only inputs — there is no mirror checkout or orchestrator runtime.
|
|
12
|
+
*
|
|
13
|
+
* Layer-B attestation cross-check was removed: it depended on an
|
|
14
|
+
* agent-emitted attestation block that no production path produced, so it
|
|
15
|
+
* never ran. Project-specific "proposed sensors" were likewise never wired
|
|
16
|
+
* to an executor and have been dropped.
|
|
12
17
|
*/
|
|
13
|
-
import type {
|
|
14
|
-
export interface
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
attempt: number;
|
|
29
|
-
/** Max attempts the orchestrator will allow. */
|
|
30
|
-
maxAttempts: number;
|
|
31
|
-
/**
|
|
32
|
-
* Optional pre-extracted attestation. Useful for tests / smokes that
|
|
33
|
-
* inject the attestation directly without going through the assistant
|
|
34
|
-
* stream. When supplied, finalAssistantText is ignored for extraction.
|
|
35
|
-
*/
|
|
36
|
-
attestation?: Attestation;
|
|
18
|
+
import type { DiffEntry, ProjectGlobs, SensorLanguage, SensorSweepResult } from "./types.js";
|
|
19
|
+
export interface RunSensorsOnDiffArgs {
|
|
20
|
+
/** Repo root — decisions, stub catalog, and config are read from here. */
|
|
21
|
+
repoRoot: string;
|
|
22
|
+
/** Files changed in this diff, content already loaded. */
|
|
23
|
+
diff: DiffEntry[];
|
|
24
|
+
/** Languages to filter Layer A patterns. Omit = scan all known languages. */
|
|
25
|
+
languages?: SensorLanguage[];
|
|
26
|
+
/** Route/DTO globs. Omit = loaded from `.cairn/config.yaml`. */
|
|
27
|
+
projectGlobs?: ProjectGlobs;
|
|
28
|
+
/** Label for log lines (e.g. the gate name). */
|
|
29
|
+
runId?: string;
|
|
30
|
+
/** Retry context for the remediation prompt. Defaults to a single 1/1 pass. */
|
|
31
|
+
attempt?: number;
|
|
32
|
+
maxAttempts?: number;
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
|
-
* Run
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* - remediation prompt body for the next retry (empty string on success)
|
|
35
|
+
* Run the live sensor sweep over a diff. Returns per-sensor results, the
|
|
36
|
+
* aggregate `ok` (false on any hard failure), and a remediation prompt body
|
|
37
|
+
* the caller can surface to the agent.
|
|
43
38
|
*/
|
|
44
|
-
export declare function
|
|
39
|
+
export declare function runSensorsOnDiff(args: RunSensorsOnDiffArgs): Promise<SensorSweepResult>;
|
|
40
|
+
/** Read route/DTO/high-stakes globs from `.cairn/config.yaml`. */
|
|
41
|
+
export declare function loadProjectGlobs(repoRoot: string): ProjectGlobs;
|
package/dist/sensors/runner.js
CHANGED
|
@@ -1,78 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sensor
|
|
2
|
+
* Sensor sweep — the live enforcement entry point.
|
|
3
3
|
*
|
|
4
|
-
* Composes
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Composes the sensors that actually have teeth into one diff-scoped sweep:
|
|
5
|
+
* - Layer A — stub-pattern catalog (mechanical debt regex)
|
|
6
|
+
* - Layer C — generic structural sensors (route handlers, DTOs)
|
|
7
|
+
* - decision-assertions — "was the in-scope DEC honored?"
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Runs at the real gates: pre-commit (staged diff), CI (`--diff` range), and
|
|
10
|
+
* advisory at the Stop hook (working-tree diff). The diff + repoRoot are the
|
|
11
|
+
* only inputs — there is no mirror checkout or orchestrator runtime.
|
|
12
|
+
*
|
|
13
|
+
* Layer-B attestation cross-check was removed: it depended on an
|
|
14
|
+
* agent-emitted attestation block that no production path produced, so it
|
|
15
|
+
* never ran. Project-specific "proposed sensors" were likewise never wired
|
|
16
|
+
* to an executor and have been dropped.
|
|
12
17
|
*/
|
|
13
18
|
import { logger } from "../logger.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { getDiff } from "./diff.js";
|
|
19
|
+
import { loadCairnConfig } from "@isaacriehm/cairn-state";
|
|
20
|
+
import { decisionsInScope, loadAcceptedDecisions, runDecisionAssertions, } from "./decisions.js";
|
|
17
21
|
import { loadStubCatalog } from "./catalog.js";
|
|
18
22
|
import { formatRemediation } from "./remediation.js";
|
|
19
23
|
import { runStubCatalog } from "./stub-catalog.js";
|
|
20
24
|
import { runDtoNoFakeFields, runRouteHandlerNonEmpty } from "./structural.js";
|
|
21
25
|
const log = logger("sensors.runner");
|
|
22
26
|
/**
|
|
23
|
-
* Run
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* - remediation prompt body for the next retry (empty string on success)
|
|
27
|
+
* Run the live sensor sweep over a diff. Returns per-sensor results, the
|
|
28
|
+
* aggregate `ok` (false on any hard failure), and a remediation prompt body
|
|
29
|
+
* the caller can surface to the agent.
|
|
27
30
|
*/
|
|
28
|
-
export async function
|
|
31
|
+
export async function runSensorsOnDiff(args) {
|
|
29
32
|
const startedAt = Date.now();
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
+
const { repoRoot, diff } = args;
|
|
34
|
+
const projectGlobs = args.projectGlobs ?? loadProjectGlobs(repoRoot);
|
|
35
|
+
const stubCatalog = loadStubCatalog(repoRoot);
|
|
36
|
+
const acceptedDecisions = loadAcceptedDecisions(repoRoot);
|
|
33
37
|
const inScope = decisionsInScope(acceptedDecisions, diff);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
diff,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
results.push(runAttestationCrossCheck({
|
|
44
|
-
attestation,
|
|
45
|
-
diff,
|
|
46
|
-
stubCatalog,
|
|
47
|
-
ignoreGlobs: [".cairn/runs/active/**", ".cairn/inbox/processed/**"],
|
|
48
|
-
}));
|
|
49
|
-
// Layer C — generic structural sensors.
|
|
50
|
-
results.push(runRouteHandlerNonEmpty({
|
|
51
|
-
diff,
|
|
52
|
-
globs: args.projectGlobs.route_handler_globs,
|
|
53
|
-
}));
|
|
54
|
-
results.push(runDtoNoFakeFields({
|
|
55
|
-
diff,
|
|
56
|
-
globs: args.projectGlobs.dto_globs,
|
|
57
|
-
}));
|
|
58
|
-
// Decision-assertions.
|
|
59
|
-
results.push(runDecisionAssertions({
|
|
60
|
-
mirrorPath: args.mirrorPath,
|
|
61
|
-
diff,
|
|
62
|
-
decisions: inScope,
|
|
63
|
-
}));
|
|
38
|
+
const results = [
|
|
39
|
+
// Layer A — stub-pattern catalog.
|
|
40
|
+
runStubCatalog({ diff, catalog: stubCatalog, languages: args.languages }),
|
|
41
|
+
// Layer C — generic structural sensors.
|
|
42
|
+
runRouteHandlerNonEmpty({ diff, globs: projectGlobs.route_handler_globs }),
|
|
43
|
+
runDtoNoFakeFields({ diff, globs: projectGlobs.dto_globs }),
|
|
44
|
+
// Decision-assertions — the core value prop.
|
|
45
|
+
runDecisionAssertions({ mirrorPath: repoRoot, diff, decisions: inScope }),
|
|
46
|
+
];
|
|
64
47
|
const hard_failures = results.filter((r) => !r.ok).length;
|
|
65
48
|
const soft_findings = results.reduce((n, r) => n + r.findings.filter((f) => f.severity === "soft").length, 0);
|
|
66
49
|
const ok = hard_failures === 0;
|
|
67
50
|
const remediation_prompt = ok
|
|
68
51
|
? ""
|
|
69
52
|
: formatRemediation(results, {
|
|
70
|
-
attempt: args.attempt,
|
|
71
|
-
maxAttempts: args.maxAttempts,
|
|
53
|
+
attempt: args.attempt ?? 1,
|
|
54
|
+
maxAttempts: args.maxAttempts ?? 1,
|
|
72
55
|
});
|
|
73
56
|
log.info({
|
|
74
|
-
run_id: args.runId,
|
|
75
|
-
attempt: args.attempt,
|
|
57
|
+
run_id: args.runId ?? "sensor-sweep",
|
|
76
58
|
ok,
|
|
77
59
|
hard_failures,
|
|
78
60
|
soft_findings,
|
|
@@ -92,4 +74,32 @@ export async function runSensors(args) {
|
|
|
92
74
|
duration_ms: Date.now() - startedAt,
|
|
93
75
|
};
|
|
94
76
|
}
|
|
77
|
+
/** Read route/DTO/high-stakes globs from `.cairn/config.yaml`. */
|
|
78
|
+
export function loadProjectGlobs(repoRoot) {
|
|
79
|
+
const cfg = loadCairnConfig(repoRoot);
|
|
80
|
+
const out = {};
|
|
81
|
+
const asStrings = (v) => Array.isArray(v) ? v.filter((x) => typeof x === "string") : undefined;
|
|
82
|
+
const pg = cfg["project_globs"];
|
|
83
|
+
if (typeof pg === "object" && pg !== null) {
|
|
84
|
+
const p = pg;
|
|
85
|
+
const rh = asStrings(p["route_handler_globs"]);
|
|
86
|
+
if (rh)
|
|
87
|
+
out.route_handler_globs = rh;
|
|
88
|
+
const dto = asStrings(p["dto_globs"]);
|
|
89
|
+
if (dto)
|
|
90
|
+
out.dto_globs = dto;
|
|
91
|
+
const gen = asStrings(p["generator_source_globs"]);
|
|
92
|
+
if (gen)
|
|
93
|
+
out.generator_source_globs = gen;
|
|
94
|
+
const hs = asStrings(p["high_stakes_globs"]);
|
|
95
|
+
if (hs)
|
|
96
|
+
out.high_stakes_globs = hs;
|
|
97
|
+
}
|
|
98
|
+
if (out.high_stakes_globs === undefined) {
|
|
99
|
+
const topHs = asStrings(cfg["high_stakes_globs"]);
|
|
100
|
+
if (topHs)
|
|
101
|
+
out.high_stakes_globs = topHs;
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
}
|
|
95
105
|
//# sourceMappingURL=runner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/sensors/runner.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3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G,CAAC,iBAAiB,GAAG,EAAE,CAAC;IACrC,CAAC;IACD,IAAI,GAAG,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAClD,IAAI,KAAK;YAAE,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
* Layer A mechanical stub-pattern catalog. Catalog grows additively via /oops dialog.
|
|
9
9
|
*/
|
|
10
10
|
import type { DiffEntry, SensorLanguage, SensorResult, StubCatalog } from "./types.js";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Detect sensor language from extension via the shared `languages.ts` profile
|
|
13
|
+
* table (single source of truth). Returns undefined for binaries / unknown.
|
|
14
|
+
*/
|
|
12
15
|
export declare function detectLanguage(path: string): SensorLanguage | undefined;
|
|
13
16
|
/** A single stub-pattern regex match found inside the diff. */
|
|
14
17
|
export interface StubMatch {
|
|
@@ -32,9 +35,9 @@ export declare function detectStubMatches(args: {
|
|
|
32
35
|
languages: readonly SensorLanguage[] | undefined;
|
|
33
36
|
}): StubMatch[];
|
|
34
37
|
/** Convert a character offset within `text` to a 1-based line number. */
|
|
35
|
-
/** Run the Layer A sensor against a diff. */
|
|
38
|
+
/** Run the Layer A sensor against a diff. `languages: undefined` = all. */
|
|
36
39
|
export declare function runStubCatalog(args: {
|
|
37
40
|
diff: DiffEntry[];
|
|
38
41
|
catalog: StubCatalog;
|
|
39
|
-
languages: readonly SensorLanguage[];
|
|
42
|
+
languages: readonly SensorLanguage[] | undefined;
|
|
40
43
|
}): SensorResult;
|
|
@@ -7,26 +7,14 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Layer A mechanical stub-pattern catalog. Catalog grows additively via /oops dialog.
|
|
9
9
|
*/
|
|
10
|
-
import { lineOf, matchAnyGlob } from "@isaacriehm/cairn-state";
|
|
10
|
+
import { lineOf, matchAnyGlob, sensorLangForFile } from "@isaacriehm/cairn-state";
|
|
11
11
|
const SENSOR_ID = "stub-pattern-catalog";
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Detect sensor language from extension via the shared `languages.ts` profile
|
|
14
|
+
* table (single source of truth). Returns undefined for binaries / unknown.
|
|
15
|
+
*/
|
|
13
16
|
export function detectLanguage(path) {
|
|
14
|
-
|
|
15
|
-
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".cts") || lower.endsWith(".mts"))
|
|
16
|
-
return "typescript";
|
|
17
|
-
if (lower.endsWith(".js") || lower.endsWith(".jsx") || lower.endsWith(".cjs") || lower.endsWith(".mjs"))
|
|
18
|
-
return "javascript";
|
|
19
|
-
if (lower.endsWith(".py"))
|
|
20
|
-
return "python";
|
|
21
|
-
if (lower.endsWith(".rb"))
|
|
22
|
-
return "ruby";
|
|
23
|
-
if (lower.endsWith(".go"))
|
|
24
|
-
return "go";
|
|
25
|
-
if (lower.endsWith(".rs"))
|
|
26
|
-
return "rust";
|
|
27
|
-
if (lower.endsWith(".sql"))
|
|
28
|
-
return "sql";
|
|
29
|
-
return undefined;
|
|
17
|
+
return sensorLangForFile(path);
|
|
30
18
|
}
|
|
31
19
|
/**
|
|
32
20
|
* Walk the diff and emit a match for every regex hit on lines that were
|
|
@@ -98,7 +86,7 @@ export function detectStubMatches(args) {
|
|
|
98
86
|
return out;
|
|
99
87
|
}
|
|
100
88
|
/** Convert a character offset within `text` to a 1-based line number. */
|
|
101
|
-
/** Run the Layer A sensor against a diff. */
|
|
89
|
+
/** Run the Layer A sensor against a diff. `languages: undefined` = all. */
|
|
102
90
|
export function runStubCatalog(args) {
|
|
103
91
|
const startedAt = Date.now();
|
|
104
92
|
const matches = detectStubMatches({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-catalog.js","sourceRoot":"","sources":["../../src/sensors/stub-cat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,CAAC;IACJ,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC;IACxD,OAAO;QACL,SAAS,EAAE,SAAS;QACpB,EAAE;QACF,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;QACnC,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/sensors/types.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sensor types —
|
|
2
|
+
* Sensor types — honest-agent invariants stack.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
* `
|
|
7
|
-
* builds a remediation prompt from any findings, and either passes the run
|
|
8
|
-
* through or feeds the prompt back to the agent for retry.
|
|
9
|
-
*
|
|
10
|
-
* Sensors follow the remediation-prompt pattern: failure messages are consumed by the agent on retry.
|
|
4
|
+
* Each sensor reads a diff (+ decisions + project globs) and emits
|
|
5
|
+
* `SensorFinding[]`. The sweep runner collects every sensor's `SensorResult`,
|
|
6
|
+
* aggregates `ok`, and builds a remediation prompt from any hard findings.
|
|
11
7
|
*/
|
|
12
|
-
import type { DecisionFrontmatter } from "@isaacriehm/cairn-state";
|
|
13
8
|
/** A single file changed in this run. */
|
|
14
9
|
export interface DiffEntry {
|
|
15
10
|
/** Repo-relative path. */
|
|
@@ -22,8 +17,13 @@ export interface DiffEntry {
|
|
|
22
17
|
/** Original path when status === "renamed". */
|
|
23
18
|
fromPath?: string;
|
|
24
19
|
}
|
|
25
|
-
/**
|
|
26
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Language tag used to filter Layer A patterns + AST assertions. OPEN string
|
|
22
|
+
* equal to a `languages.ts` profile id — the registry is the single source,
|
|
23
|
+
* so a new language is filterable just by living in the table. Common values:
|
|
24
|
+
* typescript, javascript, python, ruby, go, rust, sql.
|
|
25
|
+
*/
|
|
26
|
+
export type SensorLanguage = string;
|
|
27
27
|
/** One pattern entry from .cairn/config/stub-patterns.yaml. */
|
|
28
28
|
export interface StubPattern {
|
|
29
29
|
id: string;
|
|
@@ -56,30 +56,6 @@ export interface StubCatalog {
|
|
|
56
56
|
version: number;
|
|
57
57
|
patterns: StubPattern[];
|
|
58
58
|
}
|
|
59
|
-
/** YAML block the agent emits at end of turn. */
|
|
60
|
-
export interface AttestationDelivered {
|
|
61
|
-
symbol: string;
|
|
62
|
-
path?: string;
|
|
63
|
-
behavior: "full" | "partial" | "scaffolded";
|
|
64
|
-
sensors_passed?: string[];
|
|
65
|
-
}
|
|
66
|
-
export interface AttestationDeferred {
|
|
67
|
-
symbol: string;
|
|
68
|
-
reason: string;
|
|
69
|
-
}
|
|
70
|
-
export interface Attestation {
|
|
71
|
-
delivered: AttestationDelivered[];
|
|
72
|
-
deferred: AttestationDeferred[];
|
|
73
|
-
known_limitations: string[];
|
|
74
|
-
todos_introduced: number;
|
|
75
|
-
stubs_introduced: number;
|
|
76
|
-
files_touched: string[];
|
|
77
|
-
/** Set when the agent could not proceed; runner reports it as soft finding. */
|
|
78
|
-
blocked_by?: {
|
|
79
|
-
reason: string;
|
|
80
|
-
needed_from_operator?: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
59
|
/**
|
|
84
60
|
* Project-extension block resolved from workflow.md `<project>:` extension.
|
|
85
61
|
* Sensors that trigger on `glob_keys` look up the matching key here.
|
|
@@ -93,26 +69,6 @@ export interface ProjectGlobs {
|
|
|
93
69
|
off_limits?: string[];
|
|
94
70
|
[key: string]: string[] | undefined;
|
|
95
71
|
}
|
|
96
|
-
export interface SensorInput {
|
|
97
|
-
/** Absolute path to the mirror checkout. */
|
|
98
|
-
mirrorPath: string;
|
|
99
|
-
/** origin/main SHA pinned at workspace prep. */
|
|
100
|
-
shaPin: string;
|
|
101
|
-
/** Files changed in this run, content already loaded. */
|
|
102
|
-
changedFiles: DiffEntry[];
|
|
103
|
-
/** Parsed attestation; undefined if the agent emitted none (Layer B fails). */
|
|
104
|
-
attestation: Attestation | undefined;
|
|
105
|
-
/** Decisions accepted in scope of this diff. Already filtered. */
|
|
106
|
-
decisionsInScope: DecisionFrontmatter[];
|
|
107
|
-
/** Layer A catalog. */
|
|
108
|
-
stubCatalog: StubCatalog;
|
|
109
|
-
/** Stack profile language list — pattern filtering. */
|
|
110
|
-
languages: SensorLanguage[];
|
|
111
|
-
/** Project-extension globs. */
|
|
112
|
-
projectGlobs: ProjectGlobs;
|
|
113
|
-
/** Run id used in log lines. */
|
|
114
|
-
runId: string;
|
|
115
|
-
}
|
|
116
72
|
export interface SensorFinding {
|
|
117
73
|
/** id from sensors.yaml — e.g., "stub-pattern-catalog". */
|
|
118
74
|
sensor_id: string;
|
package/dist/sensors/types.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sensor types —
|
|
2
|
+
* Sensor types — honest-agent invariants stack.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
* `
|
|
7
|
-
* builds a remediation prompt from any findings, and either passes the run
|
|
8
|
-
* through or feeds the prompt back to the agent for retry.
|
|
9
|
-
*
|
|
10
|
-
* Sensors follow the remediation-prompt pattern: failure messages are consumed by the agent on retry.
|
|
4
|
+
* Each sensor reads a diff (+ decisions + project globs) and emits
|
|
5
|
+
* `SensorFinding[]`. The sweep runner collects every sensor's `SensorResult`,
|
|
6
|
+
* aggregates `ok`, and builds a remediation prompt from any hard findings.
|
|
11
7
|
*/
|
|
12
8
|
export {};
|
|
13
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sensors/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sensors/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|