switchboard-cli 0.1.0-alpha.2 → 0.1.0-alpha.4
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/calibration/ledger/baselines/baseline-2026-04-09.yaml +1 -1
- package/calibration/ledger/history.yaml +0 -18
- package/package.json +5 -25
- package/src/autoagent/boundary-check.spec.ts +77 -0
- package/src/autoagent/boundary-check.ts +102 -0
- package/src/autoagent/loop.ts +327 -0
- package/src/autoagent/results.spec.ts +73 -0
- package/src/autoagent/results.ts +68 -0
- package/src/autoagent/runner.spec.ts +20 -0
- package/src/autoagent/runner.ts +92 -0
- package/src/autoagent/types.ts +64 -0
- package/src/commands/autoagent.ts +108 -0
- package/src/commands/receipt.ts +33 -2
- package/src/index.ts +4 -0
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/diffs/adv-a0c9e2bfb0d6.yaml +0 -9
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/diffs/blind-3e892f3a89ee.yaml +0 -9
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/diffs/blind-958b2f9e6816.yaml +0 -9
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/manifest.yaml +0 -8
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/seeds/adv-a0c9e2bfb0d6.yaml +0 -7
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/seeds/blind-3e892f3a89ee.yaml +0 -8
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/seeds/blind-958b2f9e6816.yaml +0 -8
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/summary.yaml +0 -10
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/traces/adv-a0c9e2bfb0d6.yaml +0 -141
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/traces/blind-3e892f3a89ee.yaml +0 -147
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/traces/blind-958b2f9e6816.yaml +0 -147
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-a/adv-a0c9e2bfb0d6.yaml +0 -24
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-a/blind-3e892f3a89ee.yaml +0 -23
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-a/blind-958b2f9e6816.yaml +0 -25
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-b/adv-a0c9e2bfb0d6.yaml +0 -31
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-b/blind-3e892f3a89ee.yaml +0 -32
- package/calibration/ledger/runs/2026-04-09T10-02-57-143Z/verdicts-b/blind-958b2f9e6816.yaml +0 -32
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/adv-056e52eb6d09.yaml +0 -9
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/diffs/blind-aa04e10023e9.yaml +0 -9
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/escalations/esc-2bd30ef5717a30b3.yaml +0 -15
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/manifest.yaml +0 -8
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/adv-056e52eb6d09.yaml +0 -7
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/seeds/blind-aa04e10023e9.yaml +0 -8
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/summary.yaml +0 -10
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/adv-056e52eb6d09.yaml +0 -141
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/traces/blind-aa04e10023e9.yaml +0 -146
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/adv-056e52eb6d09.yaml +0 -24
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-a/blind-aa04e10023e9.yaml +0 -24
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/adv-056e52eb6d09.yaml +0 -31
- package/calibration/ledger/runs/2026-04-09T10-11-28-692Z/verdicts-b/blind-aa04e10023e9.yaml +0 -32
- package/node_modules/@switchboard/core/package.json +0 -20
- package/node_modules/@switchboard/core/src/activation.ts +0 -285
- package/node_modules/@switchboard/core/src/audited-receipt.ts +0 -403
- package/node_modules/@switchboard/core/src/budget-ledger.ts +0 -223
- package/node_modules/@switchboard/core/src/build-map.ts +0 -327
- package/node_modules/@switchboard/core/src/canonical-delta.ts +0 -754
- package/node_modules/@switchboard/core/src/canonical-pack.ts +0 -400
- package/node_modules/@switchboard/core/src/canonical.ts +0 -248
- package/node_modules/@switchboard/core/src/claim-spread.ts +0 -219
- package/node_modules/@switchboard/core/src/classifier.ts +0 -207
- package/node_modules/@switchboard/core/src/claude-executor.ts +0 -37
- package/node_modules/@switchboard/core/src/codex-audit.ts +0 -301
- package/node_modules/@switchboard/core/src/codex-executor.ts +0 -22
- package/node_modules/@switchboard/core/src/compiler-adapter.ts +0 -284
- package/node_modules/@switchboard/core/src/compiler.ts +0 -183
- package/node_modules/@switchboard/core/src/dispatch-formatter.ts +0 -348
- package/node_modules/@switchboard/core/src/dispatch-receipt.ts +0 -135
- package/node_modules/@switchboard/core/src/dossier.ts +0 -229
- package/node_modules/@switchboard/core/src/eval-scope.ts +0 -208
- package/node_modules/@switchboard/core/src/evaluation-lane.ts +0 -584
- package/node_modules/@switchboard/core/src/execution-trace.ts +0 -455
- package/node_modules/@switchboard/core/src/gate-state.ts +0 -296
- package/node_modules/@switchboard/core/src/gates.ts +0 -198
- package/node_modules/@switchboard/core/src/governance-envelope.ts +0 -317
- package/node_modules/@switchboard/core/src/handoff-v2.ts +0 -221
- package/node_modules/@switchboard/core/src/handoff-visibility.ts +0 -204
- package/node_modules/@switchboard/core/src/handoff.ts +0 -87
- package/node_modules/@switchboard/core/src/harness-compiler.ts +0 -246
- package/node_modules/@switchboard/core/src/index.ts +0 -57
- package/node_modules/@switchboard/core/src/ingest.ts +0 -128
- package/node_modules/@switchboard/core/src/launch-block-payload.ts +0 -51
- package/node_modules/@switchboard/core/src/ledger.ts +0 -313
- package/node_modules/@switchboard/core/src/live-event-bus.ts +0 -37
- package/node_modules/@switchboard/core/src/live-event.ts +0 -238
- package/node_modules/@switchboard/core/src/lock-readiness.ts +0 -242
- package/node_modules/@switchboard/core/src/loop-compiler.ts +0 -152
- package/node_modules/@switchboard/core/src/loop-validator.ts +0 -55
- package/node_modules/@switchboard/core/src/meta-harness.ts +0 -411
- package/node_modules/@switchboard/core/src/overflow-manifest.ts +0 -220
- package/node_modules/@switchboard/core/src/packet-integrity.ts +0 -302
- package/node_modules/@switchboard/core/src/parallel-conflict.ts +0 -268
- package/node_modules/@switchboard/core/src/preflight.ts +0 -181
- package/node_modules/@switchboard/core/src/pressure-assessment.ts +0 -265
- package/node_modules/@switchboard/core/src/product-objects.ts +0 -99
- package/node_modules/@switchboard/core/src/project-charter.ts +0 -193
- package/node_modules/@switchboard/core/src/proof-capture.ts +0 -319
- package/node_modules/@switchboard/core/src/provider-registry.ts +0 -163
- package/node_modules/@switchboard/core/src/receipt-v2.ts +0 -904
- package/node_modules/@switchboard/core/src/reconcile-matrix.ts +0 -154
- package/node_modules/@switchboard/core/src/reconcile-v2.ts +0 -272
- package/node_modules/@switchboard/core/src/reconcile.ts +0 -450
- package/node_modules/@switchboard/core/src/return-normalizer.ts +0 -226
- package/node_modules/@switchboard/core/src/router.ts +0 -207
- package/node_modules/@switchboard/core/src/routing-v2.ts +0 -214
- package/node_modules/@switchboard/core/src/run-snapshot.ts +0 -405
- package/node_modules/@switchboard/core/src/surface-playbooks.ts +0 -36
- package/node_modules/@switchboard/core/src/surface-profiles.ts +0 -166
- package/node_modules/@switchboard/core/src/synthesis-provider.ts +0 -1114
- package/node_modules/@switchboard/core/src/types.ts +0 -3054
- package/node_modules/@switchboard/projections/package.json +0 -21
- package/node_modules/@switchboard/projections/src/claude/index.ts +0 -164
- package/node_modules/@switchboard/projections/src/index.ts +0 -160
- package/node_modules/yaml/LICENSE +0 -13
- package/node_modules/yaml/README.md +0 -172
- package/node_modules/yaml/bin.mjs +0 -11
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +0 -88
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +0 -43
- package/node_modules/yaml/browser/dist/compose/compose-node.js +0 -109
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +0 -86
- package/node_modules/yaml/browser/dist/compose/composer.js +0 -217
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +0 -115
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +0 -198
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +0 -49
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +0 -37
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +0 -207
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +0 -223
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +0 -146
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +0 -34
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +0 -26
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +0 -15
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +0 -13
- package/node_modules/yaml/browser/dist/doc/Document.js +0 -335
- package/node_modules/yaml/browser/dist/doc/anchors.js +0 -71
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +0 -55
- package/node_modules/yaml/browser/dist/doc/createNode.js +0 -88
- package/node_modules/yaml/browser/dist/doc/directives.js +0 -176
- package/node_modules/yaml/browser/dist/errors.js +0 -57
- package/node_modules/yaml/browser/dist/index.js +0 -17
- package/node_modules/yaml/browser/dist/log.js +0 -11
- package/node_modules/yaml/browser/dist/nodes/Alias.js +0 -114
- package/node_modules/yaml/browser/dist/nodes/Collection.js +0 -147
- package/node_modules/yaml/browser/dist/nodes/Node.js +0 -38
- package/node_modules/yaml/browser/dist/nodes/Pair.js +0 -36
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +0 -24
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +0 -144
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +0 -113
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +0 -63
- package/node_modules/yaml/browser/dist/nodes/identity.js +0 -36
- package/node_modules/yaml/browser/dist/nodes/toJS.js +0 -37
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +0 -214
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +0 -61
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +0 -97
- package/node_modules/yaml/browser/dist/parse/cst.js +0 -98
- package/node_modules/yaml/browser/dist/parse/lexer.js +0 -717
- package/node_modules/yaml/browser/dist/parse/line-counter.js +0 -39
- package/node_modules/yaml/browser/dist/parse/parser.js +0 -967
- package/node_modules/yaml/browser/dist/public-api.js +0 -102
- package/node_modules/yaml/browser/dist/schema/Schema.js +0 -37
- package/node_modules/yaml/browser/dist/schema/common/map.js +0 -17
- package/node_modules/yaml/browser/dist/schema/common/null.js +0 -15
- package/node_modules/yaml/browser/dist/schema/common/seq.js +0 -17
- package/node_modules/yaml/browser/dist/schema/common/string.js +0 -14
- package/node_modules/yaml/browser/dist/schema/core/bool.js +0 -19
- package/node_modules/yaml/browser/dist/schema/core/float.js +0 -43
- package/node_modules/yaml/browser/dist/schema/core/int.js +0 -38
- package/node_modules/yaml/browser/dist/schema/core/schema.js +0 -23
- package/node_modules/yaml/browser/dist/schema/json/schema.js +0 -62
- package/node_modules/yaml/browser/dist/schema/tags.js +0 -96
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +0 -58
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +0 -26
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +0 -46
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +0 -71
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +0 -64
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +0 -74
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +0 -78
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +0 -39
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +0 -93
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +0 -101
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +0 -146
- package/node_modules/yaml/browser/dist/stringify/stringify.js +0 -129
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +0 -153
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +0 -20
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +0 -85
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +0 -24
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +0 -150
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +0 -336
- package/node_modules/yaml/browser/dist/util.js +0 -11
- package/node_modules/yaml/browser/dist/visit.js +0 -233
- package/node_modules/yaml/browser/index.js +0 -5
- package/node_modules/yaml/browser/package.json +0 -3
- package/node_modules/yaml/dist/cli.d.ts +0 -8
- package/node_modules/yaml/dist/cli.mjs +0 -201
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +0 -11
- package/node_modules/yaml/dist/compose/compose-collection.js +0 -90
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +0 -7
- package/node_modules/yaml/dist/compose/compose-doc.js +0 -45
- package/node_modules/yaml/dist/compose/compose-node.d.ts +0 -29
- package/node_modules/yaml/dist/compose/compose-node.js +0 -112
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +0 -5
- package/node_modules/yaml/dist/compose/compose-scalar.js +0 -88
- package/node_modules/yaml/dist/compose/composer.d.ts +0 -63
- package/node_modules/yaml/dist/compose/composer.js +0 -222
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +0 -6
- package/node_modules/yaml/dist/compose/resolve-block-map.js +0 -117
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +0 -11
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +0 -200
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +0 -6
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +0 -51
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +0 -6
- package/node_modules/yaml/dist/compose/resolve-end.js +0 -39
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +0 -7
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +0 -209
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +0 -10
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +0 -225
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +0 -23
- package/node_modules/yaml/dist/compose/resolve-props.js +0 -148
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +0 -2
- package/node_modules/yaml/dist/compose/util-contains-newline.js +0 -36
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +0 -2
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +0 -28
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +0 -3
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +0 -17
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +0 -4
- package/node_modules/yaml/dist/compose/util-map-includes.js +0 -15
- package/node_modules/yaml/dist/doc/Document.d.ts +0 -141
- package/node_modules/yaml/dist/doc/Document.js +0 -337
- package/node_modules/yaml/dist/doc/anchors.d.ts +0 -24
- package/node_modules/yaml/dist/doc/anchors.js +0 -76
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +0 -9
- package/node_modules/yaml/dist/doc/applyReviver.js +0 -57
- package/node_modules/yaml/dist/doc/createNode.d.ts +0 -17
- package/node_modules/yaml/dist/doc/createNode.js +0 -90
- package/node_modules/yaml/dist/doc/directives.d.ts +0 -49
- package/node_modules/yaml/dist/doc/directives.js +0 -178
- package/node_modules/yaml/dist/errors.d.ts +0 -21
- package/node_modules/yaml/dist/errors.js +0 -62
- package/node_modules/yaml/dist/index.d.ts +0 -25
- package/node_modules/yaml/dist/index.js +0 -50
- package/node_modules/yaml/dist/log.d.ts +0 -3
- package/node_modules/yaml/dist/log.js +0 -19
- package/node_modules/yaml/dist/nodes/Alias.d.ts +0 -29
- package/node_modules/yaml/dist/nodes/Alias.js +0 -116
- package/node_modules/yaml/dist/nodes/Collection.d.ts +0 -73
- package/node_modules/yaml/dist/nodes/Collection.js +0 -151
- package/node_modules/yaml/dist/nodes/Node.d.ts +0 -53
- package/node_modules/yaml/dist/nodes/Node.js +0 -40
- package/node_modules/yaml/dist/nodes/Pair.d.ts +0 -22
- package/node_modules/yaml/dist/nodes/Pair.js +0 -39
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +0 -43
- package/node_modules/yaml/dist/nodes/Scalar.js +0 -27
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +0 -53
- package/node_modules/yaml/dist/nodes/YAMLMap.js +0 -147
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +0 -60
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +0 -115
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +0 -4
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +0 -65
- package/node_modules/yaml/dist/nodes/identity.d.ts +0 -23
- package/node_modules/yaml/dist/nodes/identity.js +0 -53
- package/node_modules/yaml/dist/nodes/toJS.d.ts +0 -29
- package/node_modules/yaml/dist/nodes/toJS.js +0 -39
- package/node_modules/yaml/dist/options.d.ts +0 -350
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +0 -64
- package/node_modules/yaml/dist/parse/cst-scalar.js +0 -218
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +0 -8
- package/node_modules/yaml/dist/parse/cst-stringify.js +0 -63
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +0 -39
- package/node_modules/yaml/dist/parse/cst-visit.js +0 -99
- package/node_modules/yaml/dist/parse/cst.d.ts +0 -109
- package/node_modules/yaml/dist/parse/cst.js +0 -112
- package/node_modules/yaml/dist/parse/lexer.d.ts +0 -87
- package/node_modules/yaml/dist/parse/lexer.js +0 -719
- package/node_modules/yaml/dist/parse/line-counter.d.ts +0 -22
- package/node_modules/yaml/dist/parse/line-counter.js +0 -41
- package/node_modules/yaml/dist/parse/parser.d.ts +0 -84
- package/node_modules/yaml/dist/parse/parser.js +0 -972
- package/node_modules/yaml/dist/public-api.d.ts +0 -44
- package/node_modules/yaml/dist/public-api.js +0 -107
- package/node_modules/yaml/dist/schema/Schema.d.ts +0 -17
- package/node_modules/yaml/dist/schema/Schema.js +0 -39
- package/node_modules/yaml/dist/schema/common/map.d.ts +0 -2
- package/node_modules/yaml/dist/schema/common/map.js +0 -19
- package/node_modules/yaml/dist/schema/common/null.d.ts +0 -4
- package/node_modules/yaml/dist/schema/common/null.js +0 -17
- package/node_modules/yaml/dist/schema/common/seq.d.ts +0 -2
- package/node_modules/yaml/dist/schema/common/seq.js +0 -19
- package/node_modules/yaml/dist/schema/common/string.d.ts +0 -2
- package/node_modules/yaml/dist/schema/common/string.js +0 -16
- package/node_modules/yaml/dist/schema/core/bool.d.ts +0 -4
- package/node_modules/yaml/dist/schema/core/bool.js +0 -21
- package/node_modules/yaml/dist/schema/core/float.d.ts +0 -4
- package/node_modules/yaml/dist/schema/core/float.js +0 -47
- package/node_modules/yaml/dist/schema/core/int.d.ts +0 -4
- package/node_modules/yaml/dist/schema/core/int.js +0 -42
- package/node_modules/yaml/dist/schema/core/schema.d.ts +0 -1
- package/node_modules/yaml/dist/schema/core/schema.js +0 -25
- package/node_modules/yaml/dist/schema/json/schema.d.ts +0 -2
- package/node_modules/yaml/dist/schema/json/schema.js +0 -64
- package/node_modules/yaml/dist/schema/json-schema.d.ts +0 -69
- package/node_modules/yaml/dist/schema/tags.d.ts +0 -48
- package/node_modules/yaml/dist/schema/tags.js +0 -99
- package/node_modules/yaml/dist/schema/types.d.ts +0 -92
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +0 -2
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +0 -70
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +0 -7
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +0 -29
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +0 -4
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +0 -50
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +0 -5
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +0 -76
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +0 -9
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +0 -68
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +0 -22
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +0 -77
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +0 -10
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +0 -82
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +0 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +0 -41
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +0 -28
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +0 -96
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +0 -6
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +0 -105
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +0 -34
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +0 -151
- package/node_modules/yaml/dist/stringify/stringify.d.ts +0 -21
- package/node_modules/yaml/dist/stringify/stringify.js +0 -132
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +0 -17
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +0 -155
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +0 -10
- package/node_modules/yaml/dist/stringify/stringifyComment.js +0 -24
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +0 -4
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +0 -87
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +0 -2
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +0 -26
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +0 -3
- package/node_modules/yaml/dist/stringify/stringifyPair.js +0 -152
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +0 -9
- package/node_modules/yaml/dist/stringify/stringifyString.js +0 -338
- package/node_modules/yaml/dist/test-events.d.ts +0 -4
- package/node_modules/yaml/dist/test-events.js +0 -134
- package/node_modules/yaml/dist/util.d.ts +0 -16
- package/node_modules/yaml/dist/util.js +0 -28
- package/node_modules/yaml/dist/visit.d.ts +0 -102
- package/node_modules/yaml/dist/visit.js +0 -236
- package/node_modules/yaml/package.json +0 -97
- package/node_modules/yaml/util.js +0 -2
- package/node_modules/zod/LICENSE +0 -21
- package/node_modules/zod/README.md +0 -208
- package/node_modules/zod/index.cjs +0 -33
- package/node_modules/zod/index.d.cts +0 -4
- package/node_modules/zod/index.d.ts +0 -4
- package/node_modules/zod/index.js +0 -4
- package/node_modules/zod/package.json +0 -118
- package/node_modules/zod/src/index.ts +0 -4
- package/node_modules/zod/src/v3/ZodError.ts +0 -330
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
- package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
- package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
- package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
- package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
- package/node_modules/zod/src/v3/errors.ts +0 -13
- package/node_modules/zod/src/v3/external.ts +0 -6
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
- package/node_modules/zod/src/v3/helpers/util.ts +0 -224
- package/node_modules/zod/src/v3/index.ts +0 -4
- package/node_modules/zod/src/v3/locales/en.ts +0 -124
- package/node_modules/zod/src/v3/standard-schema.ts +0 -113
- package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
- package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
- package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
- package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
- package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
- package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
- package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
- package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
- package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
- package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
- package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
- package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
- package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
- package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
- package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
- package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
- package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
- package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
- package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
- package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
- package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
- package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
- package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
- package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
- package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
- package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
- package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
- package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
- package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
- package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
- package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
- package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
- package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
- package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
- package/node_modules/zod/src/v3/types.ts +0 -5136
- package/node_modules/zod/src/v4/classic/checks.ts +0 -30
- package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
- package/node_modules/zod/src/v4/classic/compat.ts +0 -66
- package/node_modules/zod/src/v4/classic/errors.ts +0 -75
- package/node_modules/zod/src/v4/classic/external.ts +0 -50
- package/node_modules/zod/src/v4/classic/index.ts +0 -5
- package/node_modules/zod/src/v4/classic/iso.ts +0 -90
- package/node_modules/zod/src/v4/classic/parse.ts +0 -33
- package/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
- package/node_modules/zod/src/v4/core/api.ts +0 -1594
- package/node_modules/zod/src/v4/core/checks.ts +0 -1283
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/core.ts +0 -134
- package/node_modules/zod/src/v4/core/doc.ts +0 -44
- package/node_modules/zod/src/v4/core/errors.ts +0 -424
- package/node_modules/zod/src/v4/core/function.ts +0 -176
- package/node_modules/zod/src/v4/core/index.ts +0 -15
- package/node_modules/zod/src/v4/core/json-schema.ts +0 -143
- package/node_modules/zod/src/v4/core/parse.ts +0 -94
- package/node_modules/zod/src/v4/core/regexes.ts +0 -135
- package/node_modules/zod/src/v4/core/registries.ts +0 -96
- package/node_modules/zod/src/v4/core/schemas.ts +0 -3842
- package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
- package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
- package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
- package/node_modules/zod/src/v4/core/util.ts +0 -775
- package/node_modules/zod/src/v4/core/versions.ts +0 -5
- package/node_modules/zod/src/v4/core/zsf.ts +0 -323
- package/node_modules/zod/src/v4/index.ts +0 -4
- package/node_modules/zod/src/v4/locales/ar.ts +0 -125
- package/node_modules/zod/src/v4/locales/az.ts +0 -121
- package/node_modules/zod/src/v4/locales/be.ts +0 -184
- package/node_modules/zod/src/v4/locales/ca.ts +0 -127
- package/node_modules/zod/src/v4/locales/cs.ts +0 -142
- package/node_modules/zod/src/v4/locales/de.ts +0 -124
- package/node_modules/zod/src/v4/locales/en.ts +0 -127
- package/node_modules/zod/src/v4/locales/eo.ts +0 -125
- package/node_modules/zod/src/v4/locales/es.ts +0 -125
- package/node_modules/zod/src/v4/locales/fa.ts +0 -134
- package/node_modules/zod/src/v4/locales/fi.ts +0 -131
- package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
- package/node_modules/zod/src/v4/locales/fr.ts +0 -124
- package/node_modules/zod/src/v4/locales/he.ts +0 -125
- package/node_modules/zod/src/v4/locales/hu.ts +0 -126
- package/node_modules/zod/src/v4/locales/id.ts +0 -125
- package/node_modules/zod/src/v4/locales/index.ts +0 -39
- package/node_modules/zod/src/v4/locales/it.ts +0 -125
- package/node_modules/zod/src/v4/locales/ja.ts +0 -122
- package/node_modules/zod/src/v4/locales/kh.ts +0 -126
- package/node_modules/zod/src/v4/locales/ko.ts +0 -131
- package/node_modules/zod/src/v4/locales/mk.ts +0 -127
- package/node_modules/zod/src/v4/locales/ms.ts +0 -124
- package/node_modules/zod/src/v4/locales/nl.ts +0 -126
- package/node_modules/zod/src/v4/locales/no.ts +0 -124
- package/node_modules/zod/src/v4/locales/ota.ts +0 -125
- package/node_modules/zod/src/v4/locales/pl.ts +0 -126
- package/node_modules/zod/src/v4/locales/ps.ts +0 -133
- package/node_modules/zod/src/v4/locales/pt.ts +0 -123
- package/node_modules/zod/src/v4/locales/ru.ts +0 -184
- package/node_modules/zod/src/v4/locales/sl.ts +0 -126
- package/node_modules/zod/src/v4/locales/sv.ts +0 -127
- package/node_modules/zod/src/v4/locales/ta.ts +0 -125
- package/node_modules/zod/src/v4/locales/th.ts +0 -126
- package/node_modules/zod/src/v4/locales/tr.ts +0 -121
- package/node_modules/zod/src/v4/locales/ua.ts +0 -126
- package/node_modules/zod/src/v4/locales/ur.ts +0 -126
- package/node_modules/zod/src/v4/locales/vi.ts +0 -125
- package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
- package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
- package/node_modules/zod/src/v4/mini/checks.ts +0 -32
- package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
- package/node_modules/zod/src/v4/mini/external.ts +0 -40
- package/node_modules/zod/src/v4/mini/index.ts +0 -3
- package/node_modules/zod/src/v4/mini/iso.ts +0 -62
- package/node_modules/zod/src/v4/mini/parse.ts +0 -1
- package/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
- package/node_modules/zod/src/v4-mini/index.ts +0 -1
- package/node_modules/zod/v3/ZodError.cjs +0 -138
- package/node_modules/zod/v3/ZodError.d.cts +0 -164
- package/node_modules/zod/v3/ZodError.d.ts +0 -164
- package/node_modules/zod/v3/ZodError.js +0 -133
- package/node_modules/zod/v3/errors.cjs +0 -17
- package/node_modules/zod/v3/errors.d.cts +0 -5
- package/node_modules/zod/v3/errors.d.ts +0 -5
- package/node_modules/zod/v3/errors.js +0 -9
- package/node_modules/zod/v3/external.cjs +0 -22
- package/node_modules/zod/v3/external.d.cts +0 -6
- package/node_modules/zod/v3/external.d.ts +0 -6
- package/node_modules/zod/v3/external.js +0 -6
- package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
- package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
- package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
- package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
- package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
- package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
- package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
- package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
- package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
- package/node_modules/zod/v3/helpers/util.cjs +0 -137
- package/node_modules/zod/v3/helpers/util.d.cts +0 -85
- package/node_modules/zod/v3/helpers/util.d.ts +0 -85
- package/node_modules/zod/v3/helpers/util.js +0 -133
- package/node_modules/zod/v3/index.cjs +0 -33
- package/node_modules/zod/v3/index.d.cts +0 -4
- package/node_modules/zod/v3/index.d.ts +0 -4
- package/node_modules/zod/v3/index.js +0 -4
- package/node_modules/zod/v3/locales/en.cjs +0 -111
- package/node_modules/zod/v3/locales/en.d.cts +0 -3
- package/node_modules/zod/v3/locales/en.d.ts +0 -3
- package/node_modules/zod/v3/locales/en.js +0 -109
- package/node_modules/zod/v3/standard-schema.cjs +0 -2
- package/node_modules/zod/v3/standard-schema.d.cts +0 -102
- package/node_modules/zod/v3/standard-schema.d.ts +0 -102
- package/node_modules/zod/v3/standard-schema.js +0 -1
- package/node_modules/zod/v3/types.cjs +0 -3775
- package/node_modules/zod/v3/types.d.cts +0 -1031
- package/node_modules/zod/v3/types.d.ts +0 -1031
- package/node_modules/zod/v3/types.js +0 -3693
- package/node_modules/zod/v4/classic/checks.cjs +0 -32
- package/node_modules/zod/v4/classic/checks.d.cts +0 -1
- package/node_modules/zod/v4/classic/checks.d.ts +0 -1
- package/node_modules/zod/v4/classic/checks.js +0 -1
- package/node_modules/zod/v4/classic/coerce.cjs +0 -47
- package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
- package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
- package/node_modules/zod/v4/classic/coerce.js +0 -17
- package/node_modules/zod/v4/classic/compat.cjs +0 -57
- package/node_modules/zod/v4/classic/compat.d.cts +0 -46
- package/node_modules/zod/v4/classic/compat.d.ts +0 -46
- package/node_modules/zod/v4/classic/compat.js +0 -27
- package/node_modules/zod/v4/classic/errors.cjs +0 -67
- package/node_modules/zod/v4/classic/errors.d.cts +0 -30
- package/node_modules/zod/v4/classic/errors.d.ts +0 -30
- package/node_modules/zod/v4/classic/errors.js +0 -41
- package/node_modules/zod/v4/classic/external.cjs +0 -70
- package/node_modules/zod/v4/classic/external.d.cts +0 -13
- package/node_modules/zod/v4/classic/external.d.ts +0 -13
- package/node_modules/zod/v4/classic/external.js +0 -18
- package/node_modules/zod/v4/classic/index.cjs +0 -33
- package/node_modules/zod/v4/classic/index.d.cts +0 -4
- package/node_modules/zod/v4/classic/index.d.ts +0 -4
- package/node_modules/zod/v4/classic/index.js +0 -4
- package/node_modules/zod/v4/classic/iso.cjs +0 -60
- package/node_modules/zod/v4/classic/iso.d.cts +0 -22
- package/node_modules/zod/v4/classic/iso.d.ts +0 -22
- package/node_modules/zod/v4/classic/iso.js +0 -30
- package/node_modules/zod/v4/classic/parse.cjs +0 -32
- package/node_modules/zod/v4/classic/parse.d.cts +0 -23
- package/node_modules/zod/v4/classic/parse.d.ts +0 -23
- package/node_modules/zod/v4/classic/parse.js +0 -6
- package/node_modules/zod/v4/classic/schemas.cjs +0 -1109
- package/node_modules/zod/v4/classic/schemas.d.cts +0 -630
- package/node_modules/zod/v4/classic/schemas.d.ts +0 -630
- package/node_modules/zod/v4/classic/schemas.js +0 -1006
- package/node_modules/zod/v4/core/api.cjs +0 -1039
- package/node_modules/zod/v4/core/api.d.cts +0 -284
- package/node_modules/zod/v4/core/api.d.ts +0 -284
- package/node_modules/zod/v4/core/api.js +0 -906
- package/node_modules/zod/v4/core/checks.cjs +0 -591
- package/node_modules/zod/v4/core/checks.d.cts +0 -278
- package/node_modules/zod/v4/core/checks.d.ts +0 -278
- package/node_modules/zod/v4/core/checks.js +0 -565
- package/node_modules/zod/v4/core/core.cjs +0 -67
- package/node_modules/zod/v4/core/core.d.cts +0 -49
- package/node_modules/zod/v4/core/core.d.ts +0 -49
- package/node_modules/zod/v4/core/core.js +0 -61
- package/node_modules/zod/v4/core/doc.cjs +0 -39
- package/node_modules/zod/v4/core/doc.d.cts +0 -14
- package/node_modules/zod/v4/core/doc.d.ts +0 -14
- package/node_modules/zod/v4/core/doc.js +0 -35
- package/node_modules/zod/v4/core/errors.cjs +0 -226
- package/node_modules/zod/v4/core/errors.d.cts +0 -208
- package/node_modules/zod/v4/core/errors.d.ts +0 -208
- package/node_modules/zod/v4/core/errors.js +0 -195
- package/node_modules/zod/v4/core/function.cjs +0 -102
- package/node_modules/zod/v4/core/function.d.cts +0 -52
- package/node_modules/zod/v4/core/function.d.ts +0 -52
- package/node_modules/zod/v4/core/function.js +0 -75
- package/node_modules/zod/v4/core/index.cjs +0 -44
- package/node_modules/zod/v4/core/index.d.cts +0 -15
- package/node_modules/zod/v4/core/index.d.ts +0 -15
- package/node_modules/zod/v4/core/index.js +0 -15
- package/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/node_modules/zod/v4/core/json-schema.d.cts +0 -87
- package/node_modules/zod/v4/core/json-schema.d.ts +0 -87
- package/node_modules/zod/v4/core/json-schema.js +0 -1
- package/node_modules/zod/v4/core/parse.cjs +0 -87
- package/node_modules/zod/v4/core/parse.d.cts +0 -25
- package/node_modules/zod/v4/core/parse.d.ts +0 -25
- package/node_modules/zod/v4/core/parse.js +0 -57
- package/node_modules/zod/v4/core/regexes.cjs +0 -103
- package/node_modules/zod/v4/core/regexes.d.cts +0 -62
- package/node_modules/zod/v4/core/regexes.d.ts +0 -62
- package/node_modules/zod/v4/core/regexes.js +0 -95
- package/node_modules/zod/v4/core/registries.cjs +0 -56
- package/node_modules/zod/v4/core/registries.d.cts +0 -35
- package/node_modules/zod/v4/core/registries.d.ts +0 -35
- package/node_modules/zod/v4/core/registries.js +0 -51
- package/node_modules/zod/v4/core/schemas.cjs +0 -1748
- package/node_modules/zod/v4/core/schemas.d.cts +0 -1041
- package/node_modules/zod/v4/core/schemas.d.ts +0 -1041
- package/node_modules/zod/v4/core/schemas.js +0 -1717
- package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
- package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
- package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
- package/node_modules/zod/v4/core/standard-schema.js +0 -1
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
- package/node_modules/zod/v4/core/to-json-schema.js +0 -849
- package/node_modules/zod/v4/core/util.cjs +0 -539
- package/node_modules/zod/v4/core/util.d.cts +0 -183
- package/node_modules/zod/v4/core/util.d.ts +0 -183
- package/node_modules/zod/v4/core/util.js +0 -493
- package/node_modules/zod/v4/core/versions.cjs +0 -8
- package/node_modules/zod/v4/core/versions.d.cts +0 -5
- package/node_modules/zod/v4/core/versions.d.ts +0 -5
- package/node_modules/zod/v4/core/versions.js +0 -5
- package/node_modules/zod/v4/index.cjs +0 -22
- package/node_modules/zod/v4/index.d.cts +0 -3
- package/node_modules/zod/v4/index.d.ts +0 -3
- package/node_modules/zod/v4/index.js +0 -3
- package/node_modules/zod/v4/locales/ar.cjs +0 -142
- package/node_modules/zod/v4/locales/ar.d.cts +0 -4
- package/node_modules/zod/v4/locales/ar.d.ts +0 -4
- package/node_modules/zod/v4/locales/ar.js +0 -116
- package/node_modules/zod/v4/locales/az.cjs +0 -141
- package/node_modules/zod/v4/locales/az.d.cts +0 -4
- package/node_modules/zod/v4/locales/az.d.ts +0 -4
- package/node_modules/zod/v4/locales/az.js +0 -115
- package/node_modules/zod/v4/locales/be.cjs +0 -190
- package/node_modules/zod/v4/locales/be.d.cts +0 -4
- package/node_modules/zod/v4/locales/be.d.ts +0 -4
- package/node_modules/zod/v4/locales/be.js +0 -164
- package/node_modules/zod/v4/locales/ca.cjs +0 -144
- package/node_modules/zod/v4/locales/ca.d.cts +0 -4
- package/node_modules/zod/v4/locales/ca.d.ts +0 -4
- package/node_modules/zod/v4/locales/ca.js +0 -118
- package/node_modules/zod/v4/locales/cs.cjs +0 -161
- package/node_modules/zod/v4/locales/cs.d.cts +0 -4
- package/node_modules/zod/v4/locales/cs.d.ts +0 -4
- package/node_modules/zod/v4/locales/cs.js +0 -135
- package/node_modules/zod/v4/locales/de.cjs +0 -142
- package/node_modules/zod/v4/locales/de.d.cts +0 -4
- package/node_modules/zod/v4/locales/de.d.ts +0 -4
- package/node_modules/zod/v4/locales/de.js +0 -116
- package/node_modules/zod/v4/locales/en.cjs +0 -145
- package/node_modules/zod/v4/locales/en.d.cts +0 -5
- package/node_modules/zod/v4/locales/en.d.ts +0 -5
- package/node_modules/zod/v4/locales/en.js +0 -117
- package/node_modules/zod/v4/locales/eo.cjs +0 -144
- package/node_modules/zod/v4/locales/eo.d.cts +0 -5
- package/node_modules/zod/v4/locales/eo.d.ts +0 -5
- package/node_modules/zod/v4/locales/eo.js +0 -116
- package/node_modules/zod/v4/locales/es.cjs +0 -143
- package/node_modules/zod/v4/locales/es.d.cts +0 -4
- package/node_modules/zod/v4/locales/es.d.ts +0 -4
- package/node_modules/zod/v4/locales/es.js +0 -117
- package/node_modules/zod/v4/locales/fa.cjs +0 -148
- package/node_modules/zod/v4/locales/fa.d.cts +0 -4
- package/node_modules/zod/v4/locales/fa.d.ts +0 -4
- package/node_modules/zod/v4/locales/fa.js +0 -122
- package/node_modules/zod/v4/locales/fi.cjs +0 -148
- package/node_modules/zod/v4/locales/fi.d.cts +0 -4
- package/node_modules/zod/v4/locales/fi.d.ts +0 -4
- package/node_modules/zod/v4/locales/fi.js +0 -122
- package/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
- package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr-CA.js +0 -117
- package/node_modules/zod/v4/locales/fr.cjs +0 -142
- package/node_modules/zod/v4/locales/fr.d.cts +0 -4
- package/node_modules/zod/v4/locales/fr.d.ts +0 -4
- package/node_modules/zod/v4/locales/fr.js +0 -116
- package/node_modules/zod/v4/locales/he.cjs +0 -143
- package/node_modules/zod/v4/locales/he.d.cts +0 -4
- package/node_modules/zod/v4/locales/he.d.ts +0 -4
- package/node_modules/zod/v4/locales/he.js +0 -117
- package/node_modules/zod/v4/locales/hu.cjs +0 -143
- package/node_modules/zod/v4/locales/hu.d.cts +0 -4
- package/node_modules/zod/v4/locales/hu.d.ts +0 -4
- package/node_modules/zod/v4/locales/hu.js +0 -117
- package/node_modules/zod/v4/locales/id.cjs +0 -142
- package/node_modules/zod/v4/locales/id.d.cts +0 -4
- package/node_modules/zod/v4/locales/id.d.ts +0 -4
- package/node_modules/zod/v4/locales/id.js +0 -116
- package/node_modules/zod/v4/locales/index.cjs +0 -84
- package/node_modules/zod/v4/locales/index.d.cts +0 -39
- package/node_modules/zod/v4/locales/index.d.ts +0 -39
- package/node_modules/zod/v4/locales/index.js +0 -39
- package/node_modules/zod/v4/locales/it.cjs +0 -143
- package/node_modules/zod/v4/locales/it.d.cts +0 -4
- package/node_modules/zod/v4/locales/it.d.ts +0 -4
- package/node_modules/zod/v4/locales/it.js +0 -117
- package/node_modules/zod/v4/locales/ja.cjs +0 -141
- package/node_modules/zod/v4/locales/ja.d.cts +0 -4
- package/node_modules/zod/v4/locales/ja.d.ts +0 -4
- package/node_modules/zod/v4/locales/ja.js +0 -115
- package/node_modules/zod/v4/locales/kh.cjs +0 -143
- package/node_modules/zod/v4/locales/kh.d.cts +0 -4
- package/node_modules/zod/v4/locales/kh.d.ts +0 -4
- package/node_modules/zod/v4/locales/kh.js +0 -117
- package/node_modules/zod/v4/locales/ko.cjs +0 -147
- package/node_modules/zod/v4/locales/ko.d.cts +0 -4
- package/node_modules/zod/v4/locales/ko.d.ts +0 -4
- package/node_modules/zod/v4/locales/ko.js +0 -121
- package/node_modules/zod/v4/locales/mk.cjs +0 -144
- package/node_modules/zod/v4/locales/mk.d.cts +0 -4
- package/node_modules/zod/v4/locales/mk.d.ts +0 -4
- package/node_modules/zod/v4/locales/mk.js +0 -118
- package/node_modules/zod/v4/locales/ms.cjs +0 -142
- package/node_modules/zod/v4/locales/ms.d.cts +0 -4
- package/node_modules/zod/v4/locales/ms.d.ts +0 -4
- package/node_modules/zod/v4/locales/ms.js +0 -116
- package/node_modules/zod/v4/locales/nl.cjs +0 -143
- package/node_modules/zod/v4/locales/nl.d.cts +0 -4
- package/node_modules/zod/v4/locales/nl.d.ts +0 -4
- package/node_modules/zod/v4/locales/nl.js +0 -117
- package/node_modules/zod/v4/locales/no.cjs +0 -142
- package/node_modules/zod/v4/locales/no.d.cts +0 -4
- package/node_modules/zod/v4/locales/no.d.ts +0 -4
- package/node_modules/zod/v4/locales/no.js +0 -116
- package/node_modules/zod/v4/locales/ota.cjs +0 -143
- package/node_modules/zod/v4/locales/ota.d.cts +0 -4
- package/node_modules/zod/v4/locales/ota.d.ts +0 -4
- package/node_modules/zod/v4/locales/ota.js +0 -117
- package/node_modules/zod/v4/locales/pl.cjs +0 -143
- package/node_modules/zod/v4/locales/pl.d.cts +0 -4
- package/node_modules/zod/v4/locales/pl.d.ts +0 -4
- package/node_modules/zod/v4/locales/pl.js +0 -117
- package/node_modules/zod/v4/locales/ps.cjs +0 -148
- package/node_modules/zod/v4/locales/ps.d.cts +0 -4
- package/node_modules/zod/v4/locales/ps.d.ts +0 -4
- package/node_modules/zod/v4/locales/ps.js +0 -122
- package/node_modules/zod/v4/locales/pt.cjs +0 -142
- package/node_modules/zod/v4/locales/pt.d.cts +0 -4
- package/node_modules/zod/v4/locales/pt.d.ts +0 -4
- package/node_modules/zod/v4/locales/pt.js +0 -116
- package/node_modules/zod/v4/locales/ru.cjs +0 -190
- package/node_modules/zod/v4/locales/ru.d.cts +0 -4
- package/node_modules/zod/v4/locales/ru.d.ts +0 -4
- package/node_modules/zod/v4/locales/ru.js +0 -164
- package/node_modules/zod/v4/locales/sl.cjs +0 -143
- package/node_modules/zod/v4/locales/sl.d.cts +0 -4
- package/node_modules/zod/v4/locales/sl.d.ts +0 -4
- package/node_modules/zod/v4/locales/sl.js +0 -117
- package/node_modules/zod/v4/locales/sv.cjs +0 -144
- package/node_modules/zod/v4/locales/sv.d.cts +0 -4
- package/node_modules/zod/v4/locales/sv.d.ts +0 -4
- package/node_modules/zod/v4/locales/sv.js +0 -118
- package/node_modules/zod/v4/locales/ta.cjs +0 -143
- package/node_modules/zod/v4/locales/ta.d.cts +0 -4
- package/node_modules/zod/v4/locales/ta.d.ts +0 -4
- package/node_modules/zod/v4/locales/ta.js +0 -117
- package/node_modules/zod/v4/locales/th.cjs +0 -143
- package/node_modules/zod/v4/locales/th.d.cts +0 -4
- package/node_modules/zod/v4/locales/th.d.ts +0 -4
- package/node_modules/zod/v4/locales/th.js +0 -117
- package/node_modules/zod/v4/locales/tr.cjs +0 -143
- package/node_modules/zod/v4/locales/tr.d.cts +0 -5
- package/node_modules/zod/v4/locales/tr.d.ts +0 -5
- package/node_modules/zod/v4/locales/tr.js +0 -115
- package/node_modules/zod/v4/locales/ua.cjs +0 -143
- package/node_modules/zod/v4/locales/ua.d.cts +0 -4
- package/node_modules/zod/v4/locales/ua.d.ts +0 -4
- package/node_modules/zod/v4/locales/ua.js +0 -117
- package/node_modules/zod/v4/locales/ur.cjs +0 -143
- package/node_modules/zod/v4/locales/ur.d.cts +0 -4
- package/node_modules/zod/v4/locales/ur.d.ts +0 -4
- package/node_modules/zod/v4/locales/ur.js +0 -117
- package/node_modules/zod/v4/locales/vi.cjs +0 -142
- package/node_modules/zod/v4/locales/vi.d.cts +0 -4
- package/node_modules/zod/v4/locales/vi.d.ts +0 -4
- package/node_modules/zod/v4/locales/vi.js +0 -116
- package/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
- package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-CN.js +0 -116
- package/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
- package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
- package/node_modules/zod/v4/locales/zh-TW.js +0 -117
- package/node_modules/zod/v4/mini/checks.cjs +0 -34
- package/node_modules/zod/v4/mini/checks.d.cts +0 -1
- package/node_modules/zod/v4/mini/checks.d.ts +0 -1
- package/node_modules/zod/v4/mini/checks.js +0 -1
- package/node_modules/zod/v4/mini/coerce.cjs +0 -47
- package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
- package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
- package/node_modules/zod/v4/mini/coerce.js +0 -17
- package/node_modules/zod/v4/mini/external.cjs +0 -62
- package/node_modules/zod/v4/mini/external.d.cts +0 -11
- package/node_modules/zod/v4/mini/external.d.ts +0 -11
- package/node_modules/zod/v4/mini/external.js +0 -13
- package/node_modules/zod/v4/mini/index.cjs +0 -32
- package/node_modules/zod/v4/mini/index.d.cts +0 -3
- package/node_modules/zod/v4/mini/index.d.ts +0 -3
- package/node_modules/zod/v4/mini/index.js +0 -3
- package/node_modules/zod/v4/mini/iso.cjs +0 -60
- package/node_modules/zod/v4/mini/iso.d.cts +0 -22
- package/node_modules/zod/v4/mini/iso.d.ts +0 -22
- package/node_modules/zod/v4/mini/iso.js +0 -30
- package/node_modules/zod/v4/mini/parse.cjs +0 -8
- package/node_modules/zod/v4/mini/parse.d.cts +0 -1
- package/node_modules/zod/v4/mini/parse.d.ts +0 -1
- package/node_modules/zod/v4/mini/parse.js +0 -1
- package/node_modules/zod/v4/mini/schemas.cjs +0 -839
- package/node_modules/zod/v4/mini/schemas.d.cts +0 -356
- package/node_modules/zod/v4/mini/schemas.d.ts +0 -356
- package/node_modules/zod/v4/mini/schemas.js +0 -732
- package/node_modules/zod/v4-mini/index.cjs +0 -17
- package/node_modules/zod/v4-mini/index.d.cts +0 -1
- package/node_modules/zod/v4-mini/index.d.ts +0 -1
- package/node_modules/zod/v4-mini/index.js +0 -1
|
@@ -1,1114 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ActivationInput,
|
|
3
|
-
FollowUpQuestion,
|
|
4
|
-
InferredChip,
|
|
5
|
-
IntakeAnalysis,
|
|
6
|
-
ResearchAngle,
|
|
7
|
-
ResearchClassification,
|
|
8
|
-
RoutingResult,
|
|
9
|
-
SynthesizedSeed,
|
|
10
|
-
} from "./types";
|
|
11
|
-
import {
|
|
12
|
-
intakeAnalysisSchema,
|
|
13
|
-
researchClassificationSchema,
|
|
14
|
-
synthesizedSeedSchema,
|
|
15
|
-
} from "./types";
|
|
16
|
-
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
// Interface — exactly 3 methods, no more.
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
export interface SynthesisProvider {
|
|
22
|
-
extractSeed(input: ActivationInput): SynthesizedSeed;
|
|
23
|
-
classifyResearchAngles(seed: SynthesizedSeed): ResearchClassification;
|
|
24
|
-
generateBrief(
|
|
25
|
-
input: ActivationInput,
|
|
26
|
-
seed: SynthesizedSeed,
|
|
27
|
-
route: RoutingResult,
|
|
28
|
-
): string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
// Helpers
|
|
33
|
-
// ---------------------------------------------------------------------------
|
|
34
|
-
|
|
35
|
-
function compact(text: string) {
|
|
36
|
-
return text.replace(/\s+/g, " ").trim();
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function truncate(text: string, limit = 180) {
|
|
40
|
-
const c = compact(text);
|
|
41
|
-
return c.length <= limit ? c : `${c.slice(0, limit - 1).trimEnd()}…`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function sentence(text: string) {
|
|
45
|
-
return (
|
|
46
|
-
text
|
|
47
|
-
.split(/[\n.!?]/)
|
|
48
|
-
.map((p) => compact(p))
|
|
49
|
-
.find(Boolean) ?? truncate(text, 120)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function titleCase(text: string) {
|
|
54
|
-
return text
|
|
55
|
-
.split(/\s+/)
|
|
56
|
-
.filter(Boolean)
|
|
57
|
-
.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
58
|
-
.join(" ");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function slugify(value: string) {
|
|
62
|
-
return value
|
|
63
|
-
.toLowerCase()
|
|
64
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
65
|
-
.replace(/^-+|-+$/g, "")
|
|
66
|
-
.slice(0, 50);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
|
-
// Problem / solution split
|
|
71
|
-
// ---------------------------------------------------------------------------
|
|
72
|
-
|
|
73
|
-
const SOLUTION_MARKERS_FOR_SPLIT = [
|
|
74
|
-
" that helps ", " that turns ", " that converts ", " that takes ",
|
|
75
|
-
" which helps ", " which turns ",
|
|
76
|
-
" it turns ", " it helps ", " it takes ", " it converts ",
|
|
77
|
-
" to help ", " designed to ", " built to ", " meant to ",
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
function splitProblemSolution(raw: string): { problem: string; solution: string } {
|
|
81
|
-
const normalized = compact(raw);
|
|
82
|
-
const lowerNorm = normalized.toLowerCase();
|
|
83
|
-
|
|
84
|
-
// Strategy 1: Find explicit pain sentences in the full text
|
|
85
|
-
// Look for "Right now..." or "The problem is..." deeper in the input
|
|
86
|
-
const sentences = raw.split(/(?<=[.!?\n])\s+/).map((s) => compact(s)).filter((s) => s.length > 15);
|
|
87
|
-
const painSentences: string[] = [];
|
|
88
|
-
const solutionSentences: string[] = [];
|
|
89
|
-
|
|
90
|
-
for (const s of sentences) {
|
|
91
|
-
const lower = s.toLowerCase();
|
|
92
|
-
const isPain =
|
|
93
|
-
/^right now\b/i.test(s) ||
|
|
94
|
-
/\bhard to\b/i.test(lower) ||
|
|
95
|
-
/\beverywhere\b/i.test(lower) ||
|
|
96
|
-
/\bforgetting\b/i.test(lower) ||
|
|
97
|
-
/\bpain\b/i.test(lower) ||
|
|
98
|
-
/\bstruggle\b/i.test(lower) ||
|
|
99
|
-
/\bmanually\b/i.test(lower) ||
|
|
100
|
-
/\bproblem isn'?t\b/i.test(lower) ||
|
|
101
|
-
/\bthe problem\b/i.test(lower) ||
|
|
102
|
-
// Feature-extension markers
|
|
103
|
-
/\bcurrently only\b/i.test(lower) ||
|
|
104
|
-
/\bcurrently supports?\b/i.test(lower) ||
|
|
105
|
-
/\bwe have a\b.*\bthat\b/i.test(lower) ||
|
|
106
|
-
/\bdoesn'?t (?:support|have|include)\b/i.test(lower) ||
|
|
107
|
-
// Narrative pain markers
|
|
108
|
-
/\bkeep getting\b/i.test(lower) ||
|
|
109
|
-
/\bover and over\b/i.test(lower) ||
|
|
110
|
-
/\binstead of\b/i.test(lower) ||
|
|
111
|
-
/\bchasing\b/i.test(lower) ||
|
|
112
|
-
/\bwasting time\b/i.test(lower) ||
|
|
113
|
-
/\bfrustrat/i.test(lower) ||
|
|
114
|
-
/\btoo much time\b/i.test(lower) ||
|
|
115
|
-
/\bkeep having to\b/i.test(lower) ||
|
|
116
|
-
/\bscattered\b/i.test(lower) ||
|
|
117
|
-
/\bno single\b/i.test(lower) ||
|
|
118
|
-
/\bno way to\b/i.test(lower);
|
|
119
|
-
|
|
120
|
-
const isSolution =
|
|
121
|
-
/\bshould\b/i.test(lower) ||
|
|
122
|
-
/\bthe product\b/i.test(lower) ||
|
|
123
|
-
/\bi think\b/i.test(lower) ||
|
|
124
|
-
/\bif i had to imagine\b/i.test(lower) ||
|
|
125
|
-
/\bthe core outcome\b/i.test(lower) ||
|
|
126
|
-
// Feature-extension solution markers
|
|
127
|
-
/\bi need to add\b/i.test(lower) ||
|
|
128
|
-
/\badd a\b/i.test(lower) ||
|
|
129
|
-
/\bthe .+ should\b/i.test(lower) ||
|
|
130
|
-
/\bpreferences?\s+should\b/i.test(lower) ||
|
|
131
|
-
// Narrative solution markers
|
|
132
|
-
/\bi want to build\b/i.test(lower) ||
|
|
133
|
-
/\bi need a tool\b/i.test(lower) ||
|
|
134
|
-
/\bi want (?:a|something)\b/i.test(lower) ||
|
|
135
|
-
/\bshould feel\b/i.test(lower) ||
|
|
136
|
-
/\bmy team gets\b/i.test(lower) ||
|
|
137
|
-
/\bclients? (?:fill|complete|submit|answer)\b/i.test(lower) ||
|
|
138
|
-
/\bsystem (?:generates?|creates?|produces?)\b/i.test(lower);
|
|
139
|
-
|
|
140
|
-
// "I want to build..." is always solution, even if it also contains pain markers
|
|
141
|
-
if (isSolution && /\bi want to build\b/i.test(lower)) {
|
|
142
|
-
solutionSentences.push(s);
|
|
143
|
-
} else if (isPain) {
|
|
144
|
-
painSentences.push(s);
|
|
145
|
-
} else if (isSolution) {
|
|
146
|
-
solutionSentences.push(s);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (painSentences.length > 0) {
|
|
151
|
-
const problem = painSentences.slice(0, 2).join(" ");
|
|
152
|
-
const solution = solutionSentences.length > 0
|
|
153
|
-
? solutionSentences.slice(0, 2).join(" ")
|
|
154
|
-
: extractCoreSolution(normalized);
|
|
155
|
-
return {
|
|
156
|
-
problem: truncate(problem, 300),
|
|
157
|
-
solution: truncate(solution, 300),
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Strategy 2: Structural split on "that helps/turns..." in the first sentence
|
|
162
|
-
for (const marker of SOLUTION_MARKERS_FOR_SPLIT) {
|
|
163
|
-
const idx = lowerNorm.indexOf(marker);
|
|
164
|
-
if (idx > 15) {
|
|
165
|
-
const problem = normalized.slice(0, idx).trim();
|
|
166
|
-
const solution = normalized.slice(idx).trim();
|
|
167
|
-
if (problem.length > 10 && solution.length > 10) {
|
|
168
|
-
return { problem, solution };
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return { problem: normalized, solution: "Needs further shaping." };
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function extractCoreSolution(text: string): string {
|
|
177
|
-
// Look for "The product should..." or "The core outcome..."
|
|
178
|
-
const match = text.match(
|
|
179
|
-
/(?:the product should|the core outcome[^:]*:|if i had to imagine v1[^:]*:)\s*(.{20,250})/i,
|
|
180
|
-
);
|
|
181
|
-
if (match?.[1]) return compact(match[1]);
|
|
182
|
-
|
|
183
|
-
// Look for narrative solution: "I want to build a [thing] where [flow]"
|
|
184
|
-
const narrativeMatch = text.match(
|
|
185
|
-
/i want to build\s+(.{15,250}?)(?:\.\s|$)/i,
|
|
186
|
-
);
|
|
187
|
-
if (narrativeMatch?.[1]) return compact(narrativeMatch[1]);
|
|
188
|
-
|
|
189
|
-
// Look for feature-extension: "I need to add [feature]"
|
|
190
|
-
const addMatch = text.match(
|
|
191
|
-
/i need to add\s+(.{15,250}?)(?:\.\s|$)/i,
|
|
192
|
-
);
|
|
193
|
-
if (addMatch?.[1]) return compact(addMatch[1]);
|
|
194
|
-
|
|
195
|
-
// Look for "I need a tool that..."
|
|
196
|
-
const needMatch = text.match(
|
|
197
|
-
/i need\s+(.{15,200}?)(?:\.\s|$)/i,
|
|
198
|
-
);
|
|
199
|
-
if (needMatch?.[1]) return compact(needMatch[1]);
|
|
200
|
-
|
|
201
|
-
// Look for declarative tool/feature descriptions: "A [tool/app/system] that/for..."
|
|
202
|
-
const declarativeMatch = text.match(
|
|
203
|
-
/\ba\s+(?:cli\s+)?(?:tool|app|system|feature|page|component|service|module|script)\s+(?:that|for|which)\s+(.{15,250}?)(?:\.\s|$)/i,
|
|
204
|
-
);
|
|
205
|
-
if (declarativeMatch?.[1]) return compact(declarativeMatch[1]);
|
|
206
|
-
|
|
207
|
-
// Fall back to the first sentence's solution clause
|
|
208
|
-
const solutionMatch = text.match(/(?:that helps?|that turns?|which helps?)\s+(.{20,200})/i);
|
|
209
|
-
if (solutionMatch?.[1]) return compact(solutionMatch[1]);
|
|
210
|
-
|
|
211
|
-
// Fall back: if what_do_you_want_next starts with "implement" or "build", use it
|
|
212
|
-
const implMatch = text.match(/\b(?:implement|build)\s+(.{15,200}?)(?:\.\s|$)/i);
|
|
213
|
-
if (implMatch?.[1]) return compact(implMatch[1]);
|
|
214
|
-
|
|
215
|
-
return "Needs further shaping.";
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// ---------------------------------------------------------------------------
|
|
219
|
-
// Target user extraction
|
|
220
|
-
// ---------------------------------------------------------------------------
|
|
221
|
-
|
|
222
|
-
const USER_PATTERNS = [
|
|
223
|
-
/\btarget\s+user(?:\s+is)?[:\s]+([^.,;!?\n]{4,80})/i,
|
|
224
|
-
/\bfor\s+([^.,;!?\n]{4,60}?)(?:\s+(?:that|who|which|shipping|building|working|using|running))/i,
|
|
225
|
-
/\btargeting\s+([^.,;!?\n]{4,60})/i,
|
|
226
|
-
/\baimed at\s+([^.,;!?\n]{4,60})/i,
|
|
227
|
-
/\bfor\s+([^.,;!?\n]{4,60})/i,
|
|
228
|
-
];
|
|
229
|
-
|
|
230
|
-
// Words that indicate the match is an action/purpose, not a user segment
|
|
231
|
-
const NON_USER_MARKERS = [
|
|
232
|
-
"managing", "building", "creating", "making", "doing", "getting",
|
|
233
|
-
"tracking", "handling", "processing", "running", "stuff", "things",
|
|
234
|
-
"better", "faster", "easier", "more",
|
|
235
|
-
];
|
|
236
|
-
|
|
237
|
-
export const GENERIC_USER_FALLBACK = "Solo builders shipping software.";
|
|
238
|
-
|
|
239
|
-
function extractTargetUser(raw: string): { user: string; explicit: boolean } {
|
|
240
|
-
for (const pattern of USER_PATTERNS) {
|
|
241
|
-
const match = raw.match(pattern);
|
|
242
|
-
if (match?.[1]) {
|
|
243
|
-
const candidate = compact(match[1]);
|
|
244
|
-
const candidateWords = candidate.toLowerCase().split(/\s+/);
|
|
245
|
-
|
|
246
|
-
// Reject if the first word looks like a verb/action, not a user type
|
|
247
|
-
if (candidateWords[0] && NON_USER_MARKERS.includes(candidateWords[0])) continue;
|
|
248
|
-
|
|
249
|
-
if (candidateWords.length >= 2 && candidate.length > 5) {
|
|
250
|
-
return { user: candidate, explicit: true };
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return { user: GENERIC_USER_FALLBACK, explicit: false };
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// ---------------------------------------------------------------------------
|
|
258
|
-
// Non-goal inference
|
|
259
|
-
// ---------------------------------------------------------------------------
|
|
260
|
-
|
|
261
|
-
const ADJACENCY_MAP: Record<string, string> = {
|
|
262
|
-
route: "Not a general-purpose workflow engine or DAG builder.",
|
|
263
|
-
compil: "Not a code generation or transpilation tool.",
|
|
264
|
-
handoff: "Not a project management or ticketing system.",
|
|
265
|
-
return: "Not an observability or logging platform.",
|
|
266
|
-
brief: "Not a document or wiki editor.",
|
|
267
|
-
dispatch: "Not a task queue or job scheduler.",
|
|
268
|
-
autonom: "Not an autonomous agent platform or LLM gateway.",
|
|
269
|
-
chat: "Not a chat wrapper or conversational interface.",
|
|
270
|
-
deploy: "Not a CI/CD pipeline or deployment platform.",
|
|
271
|
-
team: "Not a team collaboration or communication tool.",
|
|
272
|
-
analytic: "Not an analytics dashboard or reporting tool.",
|
|
273
|
-
plugin: "Not a plugin marketplace or extension system.",
|
|
274
|
-
review: "Not a code review tool or pull request manager.",
|
|
275
|
-
pipeline: "Not a data pipeline or ETL framework.",
|
|
276
|
-
manage: "Not a generic management console or admin panel.",
|
|
277
|
-
marketplace: "Not a marketplace or commerce platform.",
|
|
278
|
-
collaborat: "Not a real-time collaboration tool.",
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
const PRODUCT_GUARDRAIL_LINE_SET = new Set<string>(Object.values(ADJACENCY_MAP));
|
|
282
|
-
const GENERIC_MINIMUM_NON_GOALS = [
|
|
283
|
-
"Not a generic chat wrapper or prompt management product.",
|
|
284
|
-
"Not an autonomous agent platform.",
|
|
285
|
-
] as const;
|
|
286
|
-
|
|
287
|
-
/** True when a boundary line is a product-level guardrail (keyword map or generic minimum), not user-authored scope. */
|
|
288
|
-
export function isProductLevelGuardrailBoundary(line: string): boolean {
|
|
289
|
-
const t = compact(line);
|
|
290
|
-
if (!t) return false;
|
|
291
|
-
if ((GENERIC_MINIMUM_NON_GOALS as readonly string[]).includes(t)) return true;
|
|
292
|
-
return PRODUCT_GUARDRAIL_LINE_SET.has(t);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const EXPLICIT_NON_GOAL_PATTERNS = [
|
|
296
|
-
/i do (?:NOT|not) want (?:this to become |it to be |to build )?([^.]+?)(?:\.|$)/gim,
|
|
297
|
-
/i (?:also )?do (?:NOT|not) want ([^.]+?)(?:\.|$)/gim,
|
|
298
|
-
/(?:^|\.\s+)no\s+([^.]{6,60}?)\s+in v1\b/gi,
|
|
299
|
-
/should (?:NOT|not) (?:be|become|feel) ([^.]+?)(?:\.|$)/gim,
|
|
300
|
-
];
|
|
301
|
-
|
|
302
|
-
function extractExplicitNonGoals(text: string): string[] {
|
|
303
|
-
const goals: string[] = [];
|
|
304
|
-
const combined = `${text}`;
|
|
305
|
-
|
|
306
|
-
for (const pattern of EXPLICIT_NON_GOAL_PATTERNS) {
|
|
307
|
-
pattern.lastIndex = 0;
|
|
308
|
-
let match: RegExpExecArray | null;
|
|
309
|
-
while ((match = pattern.exec(combined)) !== null) {
|
|
310
|
-
if (!match[1]) continue;
|
|
311
|
-
const candidate = compact(match[1]);
|
|
312
|
-
if (candidate.length > 5 && candidate.length < 120) {
|
|
313
|
-
// Normalize to "Not..." phrasing
|
|
314
|
-
const normalized = candidate.startsWith("not ")
|
|
315
|
-
? candidate.charAt(0).toUpperCase() + candidate.slice(1)
|
|
316
|
-
: `Not ${candidate.charAt(0).toLowerCase()}${candidate.slice(1)}`;
|
|
317
|
-
// Remove trailing "in V1" if present
|
|
318
|
-
const cleaned = normalized.replace(/\s+in v1$/i, "").trim();
|
|
319
|
-
const final = cleaned.endsWith(".") ? cleaned : `${cleaned}.`;
|
|
320
|
-
|
|
321
|
-
// Deduplicate: skip if any existing goal shares 60%+ keywords
|
|
322
|
-
const finalWords = new Set(compact(final).toLowerCase().split(/\s+/).filter((w) => w.length > 3));
|
|
323
|
-
const isDupe = goals.some((existing) => {
|
|
324
|
-
const existingWords = new Set(compact(existing).toLowerCase().split(/\s+/).filter((w) => w.length > 3));
|
|
325
|
-
let overlap = 0;
|
|
326
|
-
for (const w of finalWords) { if (existingWords.has(w)) overlap++; }
|
|
327
|
-
return finalWords.size > 0 && overlap / finalWords.size >= 0.6;
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
if (!isDupe) {
|
|
331
|
-
goals.push(final);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
return goals;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function inferNonGoals(raw: string, solution: string, constraints: string): string[] {
|
|
341
|
-
// Step 1: Extract explicit non-goals from user's own words
|
|
342
|
-
const explicit = extractExplicitNonGoals(`${raw}\n${constraints}`);
|
|
343
|
-
|
|
344
|
-
// Step 2: Supplement with inferred non-goals from adjacency map (only if explicit list is thin)
|
|
345
|
-
const combined = `${raw} ${solution} ${constraints}`.toLowerCase();
|
|
346
|
-
const inferred: string[] = [];
|
|
347
|
-
|
|
348
|
-
// Only add keyword guardrails when the idea has not already supplied competing boundaries.
|
|
349
|
-
if (explicit.length < 2) {
|
|
350
|
-
for (const [keyword, nonGoal] of Object.entries(ADJACENCY_MAP)) {
|
|
351
|
-
if (combined.includes(keyword) && !explicit.some((e) => e.toLowerCase().includes(keyword))) {
|
|
352
|
-
inferred.push(nonGoal);
|
|
353
|
-
if (explicit.length + inferred.length >= 5) break;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
const all = [...explicit, ...inferred];
|
|
359
|
-
|
|
360
|
-
if (all.length < 2) {
|
|
361
|
-
all.push("Not a generic chat wrapper or prompt management product.");
|
|
362
|
-
all.push("Not an autonomous agent platform.");
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return all.slice(0, 7);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
// ---------------------------------------------------------------------------
|
|
369
|
-
// Missing inputs detection — split into lock-blocking vs cautions
|
|
370
|
-
// ---------------------------------------------------------------------------
|
|
371
|
-
|
|
372
|
-
export type IntakeGapBuckets = {
|
|
373
|
-
/** Must be resolved before the record can be locked (activation blocked in UI). */
|
|
374
|
-
blocking: string[];
|
|
375
|
-
/** Important but non-blocking until lock. */
|
|
376
|
-
cautions: string[];
|
|
377
|
-
/** Combined list (blocking first) for seed confidence scoring. */
|
|
378
|
-
combined: string[];
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
function collectIntakeGaps(input: ActivationInput, seed: Partial<SynthesizedSeed>): IntakeGapBuckets {
|
|
382
|
-
const blocking: string[] = [];
|
|
383
|
-
const cautions: string[] = [];
|
|
384
|
-
|
|
385
|
-
if (!seed.target_user || seed.target_user === GENERIC_USER_FALLBACK) {
|
|
386
|
-
blocking.push("Target user is not on record — name who this is for before locking.");
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
if (seed.proposed_solution === "Needs further shaping.") {
|
|
390
|
-
blocking.push("No clear change or solution approach — describe what actually ships in this slice.");
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
if (!compact(input.constraints)) {
|
|
394
|
-
cautions.push("No extra constraints stated — add boundaries if V1 should refuse certain directions.");
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (compact(input.what_do_you_want_next).split(/\s+/).length < 4) {
|
|
398
|
-
cautions.push("First outcome is vague — tighten “what should happen first” when you can.");
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
const wordCount = compact(input.raw_idea).split(/\s+/).length;
|
|
402
|
-
if (wordCount < 8) {
|
|
403
|
-
blocking.push("The idea is too thin to compile — add enough detail to define the problem and slice.");
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
const affirmativeText = input.raw_idea
|
|
407
|
-
.replace(/I do (?:NOT|not) want[^.]*\./g, "")
|
|
408
|
-
.replace(/I (?:also )?do (?:NOT|not) want[^.]*\./g, "")
|
|
409
|
-
.replace(/I care[^.]*\./g, "");
|
|
410
|
-
const segments = affirmativeText.split(/,\s*|\band\b/i).map((s) => compact(s));
|
|
411
|
-
const capabilitySegments = segments.filter(
|
|
412
|
-
(s) => s.length > 10 && /\b(management|collaboration|review|pipeline|dashboard|marketplace|analytics|deploy|monitor|tracking|automation)\b/i.test(s),
|
|
413
|
-
);
|
|
414
|
-
if (capabilitySegments.length >= 3) {
|
|
415
|
-
cautions.push(
|
|
416
|
-
"The idea lists many features — pick one wedge capability so the record is not a wishlist.",
|
|
417
|
-
);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
const combined = [...blocking, ...cautions];
|
|
421
|
-
return { blocking, cautions, combined };
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// ---------------------------------------------------------------------------
|
|
425
|
-
// Confidence scoring
|
|
426
|
-
// ---------------------------------------------------------------------------
|
|
427
|
-
|
|
428
|
-
function scoreConfidence(blocking: string[], cautions: string[] = []): SynthesizedSeed["confidence"] {
|
|
429
|
-
const total = blocking.length + cautions.length;
|
|
430
|
-
if (blocking.length >= 2) return "low";
|
|
431
|
-
if (blocking.length >= 1) return "medium";
|
|
432
|
-
if (total === 0) return "high";
|
|
433
|
-
if (total === 1) return "high";
|
|
434
|
-
if (total <= 2) return "medium";
|
|
435
|
-
return "low";
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
// ---------------------------------------------------------------------------
|
|
439
|
-
// Title derivation (improved from original)
|
|
440
|
-
// ---------------------------------------------------------------------------
|
|
441
|
-
|
|
442
|
-
function deriveTitle(raw: string): string {
|
|
443
|
-
const normalized = compact(raw);
|
|
444
|
-
|
|
445
|
-
// Strategy 1: Look for "turn X into Y" — the product's core transformation
|
|
446
|
-
const transformMatch = normalized.match(
|
|
447
|
-
/(?:helps?\s+)?turn\w*\s+(.{5,40}?)\s+into\s+(.{5,40}?)(?:\.|,|\s+fast|\s+quick|$)/i,
|
|
448
|
-
);
|
|
449
|
-
if (transformMatch?.[1] && transformMatch[2]) {
|
|
450
|
-
const x = compact(transformMatch[1]).replace(/^messy\s+/i, "").replace(/[^\w\s-]/g, " ");
|
|
451
|
-
const y = compact(transformMatch[2]).replace(/^a\s+/i, "").replace(/[^\w\s-]/g, " ");
|
|
452
|
-
const combined = `${x} To ${y}`;
|
|
453
|
-
const w = combined.split(/\s+/).filter(Boolean).slice(0, 5);
|
|
454
|
-
if (w.length >= 3) return titleCase(w.join(" "));
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// Strategy 1b: Look for "that helps/turns [concept]" without "into"
|
|
458
|
-
const conceptMatch = normalized.match(
|
|
459
|
-
/(?:that|which)\s+(?:helps?\s+)?(?:turn|convert|transform|ingest|cluster|compile|route|dispatch|generate|validate|manage|track|organize|build|create)\w*\s+(.{8,50}?)(?:\s+into\b|\s+from\b|\s+across\b|\.|,|$)/i,
|
|
460
|
-
);
|
|
461
|
-
if (conceptMatch?.[1]) {
|
|
462
|
-
const concept = conceptMatch[1].replace(/[^\w\s-]/g, " ").trim();
|
|
463
|
-
const w = concept.split(/\s+/).filter(Boolean).slice(0, 5);
|
|
464
|
-
if (w.length >= 2) return titleCase(w.join(" "));
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// Strategy 2: Narrative-style — "I want to build a [adj] [noun] where [purpose]"
|
|
468
|
-
// Extract the purpose/action, not just the noun
|
|
469
|
-
const narrativeBuildMatch = normalized.match(
|
|
470
|
-
/(?:build|create|make)\s+(?:a\s+)?(?:\w+\s+){0,3}(?:tool|app|system|platform|product)\s+(?:where|that|so|for)\s+(.{10,60}?)(?:\s*,|\s+and\s+the|\s+the system|\.|$)/i,
|
|
471
|
-
);
|
|
472
|
-
if (narrativeBuildMatch?.[1]) {
|
|
473
|
-
const purpose = compact(narrativeBuildMatch[1])
|
|
474
|
-
.replace(/^(?:new\s+)?(?:clients?|users?|people)\s+/i, "")
|
|
475
|
-
.replace(/[^\w\s-]/g, " ");
|
|
476
|
-
const w = purpose.split(/\s+/).filter(Boolean).slice(0, 5);
|
|
477
|
-
if (w.length >= 2) return titleCase(w.join(" "));
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// Strategy 2b: Look for "a [noun] for [user] that..." — declarative style
|
|
481
|
-
const nounMatch = normalized.match(
|
|
482
|
-
/\ba\s+([\w-]+(?:\s+[\w-]+){0,3})\s+(?:for|that|which)\b/i,
|
|
483
|
-
);
|
|
484
|
-
if (nounMatch?.[1]) {
|
|
485
|
-
const noun = nounMatch[1].trim();
|
|
486
|
-
const GENERIC = ["tool", "app", "thing", "product", "platform", "system"];
|
|
487
|
-
if (!GENERIC.includes(noun.toLowerCase())) {
|
|
488
|
-
return titleCase(noun);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
// Strategy 3: Look for the core outcome phrase — "turn X into Y"
|
|
493
|
-
const outcomeMatch = normalized.match(
|
|
494
|
-
/turn\w*\s+(.{5,30}?)\s+into\s+(.{5,40}?)(?:\.|,|$)/i,
|
|
495
|
-
);
|
|
496
|
-
if (outcomeMatch) {
|
|
497
|
-
const w = compact(`${outcomeMatch[1]} to ${outcomeMatch[2]}`)
|
|
498
|
-
.replace(/[^\w\s-]/g, " ")
|
|
499
|
-
.split(/\s+/)
|
|
500
|
-
.filter(Boolean)
|
|
501
|
-
.slice(0, 6);
|
|
502
|
-
if (w.length >= 3) return titleCase(w.join(" "));
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// Strategy 4: Fall back to stripping boilerplate and taking what's left
|
|
506
|
-
const cleaned = sentence(normalized)
|
|
507
|
-
.replace(/^(i want to build|build|create|make)\s+/i, "")
|
|
508
|
-
.replace(/^(an?\s+(?:tool|app|platform|product|system)\s+(?:for|that)\s+)/i, "")
|
|
509
|
-
.replace(/[^\w\s-]/g, " ");
|
|
510
|
-
|
|
511
|
-
const w = cleaned.split(/\s+/).filter(Boolean).slice(0, 6);
|
|
512
|
-
return titleCase(w.join(" ")) || "New Project";
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
// ---------------------------------------------------------------------------
|
|
516
|
-
// V1 outcome derivation — extract from raw idea, not from operator intent
|
|
517
|
-
// ---------------------------------------------------------------------------
|
|
518
|
-
|
|
519
|
-
const V1_OUTCOME_PATTERNS = [
|
|
520
|
-
/the core outcome I want is[:\s]*(.{15,200})/i,
|
|
521
|
-
/if I had to imagine V1[^:]*:[:\s]*(.{15,250})/i,
|
|
522
|
-
/V1[,:]?\s*(?:should|would|could|maybe)\s+(.{15,200})/i,
|
|
523
|
-
/the real (?:win|value|outcome) (?:is|would be)[:\s]*(.{15,200})/i,
|
|
524
|
-
/I want (?:something|a product|it) (?:that|to)\s+(.{15,150})/i,
|
|
525
|
-
// Feature-extension: "I need to add [feature]"
|
|
526
|
-
/I need to add\s+(.{15,200})/i,
|
|
527
|
-
// Narrative outcome: "my team gets [good thing] instead of [bad thing]"
|
|
528
|
-
/(?:my team|we|I)\s+(?:get|gets|receive|receives)\s+(.{15,150})/i,
|
|
529
|
-
// Narrative outcome: "instead of [bad], [good]"
|
|
530
|
-
/instead of\s+.{10,60}?,\s*(.{15,150})/i,
|
|
531
|
-
// Narrative outcome: "so that [outcome]" or "so [someone] can [outcome]"
|
|
532
|
-
/so (?:that |I |we |my team )(?:can )?(.{15,150})/i,
|
|
533
|
-
];
|
|
534
|
-
|
|
535
|
-
function deriveV1Outcome(raw: string, solution: string): string {
|
|
536
|
-
// Strategy 1: Find explicit outcome statements in the raw idea
|
|
537
|
-
for (const pattern of V1_OUTCOME_PATTERNS) {
|
|
538
|
-
const match = raw.match(pattern);
|
|
539
|
-
if (match?.[1]) {
|
|
540
|
-
const candidate = compact(match[1]);
|
|
541
|
-
// Take up to first period or newline
|
|
542
|
-
const trimmed = candidate.split(/[.\n]/).map((p) => compact(p)).find((p) => p.length > 10);
|
|
543
|
-
if (trimmed && trimmed.length > 15) {
|
|
544
|
-
return truncate(trimmed, 220);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
// Strategy 2: Use the first sentence of the proposed solution
|
|
550
|
-
if (solution && solution !== "Needs further shaping.") {
|
|
551
|
-
const firstSol = solution.split(/[.\n]/).map((p) => compact(p)).find((p) => p.length > 15);
|
|
552
|
-
if (firstSol) return truncate(firstSol, 220);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// Strategy 3: Fall back to the one-liner
|
|
556
|
-
return truncate(deriveOneLiner(raw), 220);
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
// ---------------------------------------------------------------------------
|
|
560
|
-
// First build slice derivation — the product's actual first slice
|
|
561
|
-
// ---------------------------------------------------------------------------
|
|
562
|
-
|
|
563
|
-
function deriveFirstBuildSlice(raw: string, solution: string): string {
|
|
564
|
-
// Look for "If I had to imagine V1" sections with bullet lists
|
|
565
|
-
const v1Match = raw.match(/if I had to imagine V1[^:]*:[\s\n]*((?:[-•]\s*.+[\n]?)+)/i);
|
|
566
|
-
if (v1Match?.[1]) {
|
|
567
|
-
const bullets = v1Match[1]
|
|
568
|
-
.split("\n")
|
|
569
|
-
.map((l) => l.replace(/^[-•]\s*/, "").trim())
|
|
570
|
-
.filter((l) => l.length > 5);
|
|
571
|
-
if (bullets.length >= 2) {
|
|
572
|
-
return bullets.join(". ") + ".";
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// Fall back to the core solution description
|
|
577
|
-
if (solution && solution !== "Needs further shaping.") {
|
|
578
|
-
return truncate(solution, 300);
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
return "Define and implement the narrowest slice that proves the core value proposition.";
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
// ---------------------------------------------------------------------------
|
|
585
|
-
// Open questions extraction — preserve the user's explicit uncertainties
|
|
586
|
-
// ---------------------------------------------------------------------------
|
|
587
|
-
|
|
588
|
-
const UNCERTAINTY_PATTERNS = [
|
|
589
|
-
/I'?m not sure (?:yet|about|whether|if)[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
|
|
590
|
-
/I don'?t know (?:yet|whether|if)[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
|
|
591
|
-
/open questions?[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
|
|
592
|
-
/not sure[:\s]*\n?((?:[-•]\s*.+[\n]?)+)/i,
|
|
593
|
-
];
|
|
594
|
-
|
|
595
|
-
function extractOpenQuestions(raw: string): string[] {
|
|
596
|
-
for (const pattern of UNCERTAINTY_PATTERNS) {
|
|
597
|
-
const match = raw.match(pattern);
|
|
598
|
-
if (match?.[1]) {
|
|
599
|
-
const bullets = match[1]
|
|
600
|
-
.split("\n")
|
|
601
|
-
.map((l) => l.replace(/^[-•]\s*/, "").trim())
|
|
602
|
-
.filter((l) => l.length > 8);
|
|
603
|
-
if (bullets.length >= 1) {
|
|
604
|
-
return bullets.slice(0, 5);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
return [];
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
// ---------------------------------------------------------------------------
|
|
612
|
-
// One-liner derivation
|
|
613
|
-
// ---------------------------------------------------------------------------
|
|
614
|
-
|
|
615
|
-
function deriveOneLiner(raw: string): string {
|
|
616
|
-
const normalized = compact(raw);
|
|
617
|
-
|
|
618
|
-
// Strip "I want to build" prefix and clean up
|
|
619
|
-
const stripped = normalized
|
|
620
|
-
.replace(/^i want to build\s+/i, "")
|
|
621
|
-
.replace(/^i('?m| am) building\s+/i, "")
|
|
622
|
-
.replace(/^build\s+/i, "");
|
|
623
|
-
|
|
624
|
-
// Take the first sentence of the stripped version
|
|
625
|
-
const first = stripped.split(/[.\n!?]/).map((p) => compact(p)).find((p) => p.length > 10);
|
|
626
|
-
return truncate(first ?? stripped, 160);
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
// ---------------------------------------------------------------------------
|
|
630
|
-
// Task-type detection — product idea vs implementation request
|
|
631
|
-
// ---------------------------------------------------------------------------
|
|
632
|
-
|
|
633
|
-
import type { TaskType } from "./types";
|
|
634
|
-
|
|
635
|
-
function detectTaskType(raw: string, repoExists: boolean): TaskType {
|
|
636
|
-
const lower = compact(raw);
|
|
637
|
-
|
|
638
|
-
// Strong implementation signals
|
|
639
|
-
const implSignals = [
|
|
640
|
-
/\bwe have a\b.*\bapp\b/i,
|
|
641
|
-
/\bexisting\b.*\b(?:repo|codebase|app|project|page|component)\b/i,
|
|
642
|
-
/\bcurrently (?:only )?supports?\b/i,
|
|
643
|
-
/\bi need to add\b/i,
|
|
644
|
-
/\badd a\b.*\b(?:layout|panel|page|section|feature|endpoint|route)\b/i,
|
|
645
|
-
/\brefactor\b/i,
|
|
646
|
-
/\bmigrate\b/i,
|
|
647
|
-
/\bthe current\b.*\b(?:page|component|module|file|code)\b/i,
|
|
648
|
-
/\bsrc\/\b/i,
|
|
649
|
-
/\b\.tsx?\b/i,
|
|
650
|
-
/\bpackage\.json\b/i,
|
|
651
|
-
];
|
|
652
|
-
|
|
653
|
-
// Strong product-idea signals
|
|
654
|
-
const productSignals = [
|
|
655
|
-
/\bi want to build a (?:tool|product|app|platform)\b/i,
|
|
656
|
-
/\bthe product should\b/i,
|
|
657
|
-
/\bif i had to imagine v1\b/i,
|
|
658
|
-
/\bthe core outcome i want\b/i,
|
|
659
|
-
/\bwho it is for\b/i,
|
|
660
|
-
/\btarget user\b/i,
|
|
661
|
-
/\bv1 promise\b/i,
|
|
662
|
-
];
|
|
663
|
-
|
|
664
|
-
const implCount = implSignals.filter((p) => p.test(lower)).length;
|
|
665
|
-
const productCount = productSignals.filter((p) => p.test(lower)).length;
|
|
666
|
-
|
|
667
|
-
// Repo exists is a strong implementation signal — repo-bound work is implementation
|
|
668
|
-
// unless there are truly NO implementation signals AND strong product signals
|
|
669
|
-
if (repoExists && implCount >= 1) return "implementation-request";
|
|
670
|
-
if (implCount >= 2) return "implementation-request";
|
|
671
|
-
|
|
672
|
-
// Product-idea only wins when repo is NOT present, or when impl signals are zero
|
|
673
|
-
if (productCount >= 2 && !repoExists) return "product-idea";
|
|
674
|
-
if (productCount >= 2 && implCount === 0 && repoExists) return "product-idea";
|
|
675
|
-
|
|
676
|
-
// Repo tie-breaker: any impl signal with repo → implementation
|
|
677
|
-
if (repoExists && implCount > 0) return "implementation-request";
|
|
678
|
-
if (productCount > implCount) return "product-idea";
|
|
679
|
-
|
|
680
|
-
// Repo-present with no other signals defaults to implementation
|
|
681
|
-
if (repoExists) return "implementation-request";
|
|
682
|
-
|
|
683
|
-
return "unknown";
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
// ---------------------------------------------------------------------------
|
|
687
|
-
// LocalSynthesisProvider
|
|
688
|
-
// ---------------------------------------------------------------------------
|
|
689
|
-
|
|
690
|
-
export class LocalSynthesisProvider implements SynthesisProvider {
|
|
691
|
-
extractSeed(input: ActivationInput): SynthesizedSeed {
|
|
692
|
-
let { problem, solution } = splitProblemSolution(input.raw_idea);
|
|
693
|
-
|
|
694
|
-
// If raw_idea didn't yield a solution, try what_do_you_want_next
|
|
695
|
-
if (solution === "Needs further shaping." && input.what_do_you_want_next) {
|
|
696
|
-
const fromNext = extractCoreSolution(`${input.raw_idea} ${input.what_do_you_want_next}`);
|
|
697
|
-
if (fromNext !== "Needs further shaping.") {
|
|
698
|
-
solution = fromNext;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
const { user } = extractTargetUser(`${input.raw_idea} ${input.what_do_you_want_next ?? ""} ${input.constraints ?? ""}`);
|
|
703
|
-
const title = deriveTitle(input.raw_idea);
|
|
704
|
-
const nonGoals = inferNonGoals(input.raw_idea, solution, input.constraints);
|
|
705
|
-
const oneLiner = deriveOneLiner(input.raw_idea);
|
|
706
|
-
const v1Outcome = deriveV1Outcome(input.raw_idea, solution);
|
|
707
|
-
const openQuestions = extractOpenQuestions(input.raw_idea);
|
|
708
|
-
const firstBuildSlice = deriveFirstBuildSlice(input.raw_idea, solution);
|
|
709
|
-
|
|
710
|
-
const partial = {
|
|
711
|
-
title,
|
|
712
|
-
one_liner: oneLiner,
|
|
713
|
-
problem: truncate(problem, 240),
|
|
714
|
-
proposed_solution: truncate(solution, 240),
|
|
715
|
-
target_user: user,
|
|
716
|
-
v1_outcome: v1Outcome,
|
|
717
|
-
non_goals: nonGoals,
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
const gaps = collectIntakeGaps(input, partial);
|
|
721
|
-
const missingInputs = gaps.blocking;
|
|
722
|
-
const confidence = scoreConfidence(gaps.blocking, gaps.cautions);
|
|
723
|
-
|
|
724
|
-
const taskType = detectTaskType(input.raw_idea, input.repo_exists);
|
|
725
|
-
|
|
726
|
-
return synthesizedSeedSchema.parse({
|
|
727
|
-
...partial,
|
|
728
|
-
missing_inputs: missingInputs,
|
|
729
|
-
open_questions: openQuestions,
|
|
730
|
-
first_build_slice: firstBuildSlice,
|
|
731
|
-
confidence,
|
|
732
|
-
task_type: taskType,
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
classifyResearchAngles(seed: SynthesizedSeed): ResearchClassification {
|
|
737
|
-
if (seed.confidence === "high" && seed.missing_inputs.length === 0) {
|
|
738
|
-
return researchClassificationSchema.parse({
|
|
739
|
-
angles: [],
|
|
740
|
-
research_needed: false,
|
|
741
|
-
summary: "Seed is strong enough to proceed without additional research.",
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
const angles: ResearchAngle[] = [];
|
|
746
|
-
|
|
747
|
-
if (seed.target_user === GENERIC_USER_FALLBACK) {
|
|
748
|
-
angles.push({
|
|
749
|
-
category: "user-validation",
|
|
750
|
-
question: "Who exactly will use this and what is their current workflow?",
|
|
751
|
-
why_it_matters: "A generic target user leads to generic solutions that serve no one well.",
|
|
752
|
-
priority: "blocking",
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
if (seed.proposed_solution === "Needs further shaping.") {
|
|
757
|
-
angles.push({
|
|
758
|
-
category: "technical-feasibility",
|
|
759
|
-
question: "What is the simplest technical approach that solves the core problem?",
|
|
760
|
-
why_it_matters: "Without a clear solution approach, the build brief cannot be execution-ready.",
|
|
761
|
-
priority: "blocking",
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
// Check for domain-specific terms that might need research
|
|
766
|
-
const domainTerms = seed.problem.match(
|
|
767
|
-
/\b(compliance|regulatory|medical|financial|legal|security|encryption|protocol)\b/i,
|
|
768
|
-
);
|
|
769
|
-
if (domainTerms) {
|
|
770
|
-
angles.push({
|
|
771
|
-
category: "domain-knowledge",
|
|
772
|
-
question: `What domain constraints apply to ${domainTerms[0].toLowerCase()} in this context?`,
|
|
773
|
-
why_it_matters: "Domain-specific requirements can fundamentally reshape the solution.",
|
|
774
|
-
priority: "strengthening",
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
// Check if the idea mentions patterns that could benefit from competitive research
|
|
779
|
-
const hasCompetitiveSignal = seed.missing_inputs.some(
|
|
780
|
-
(m) => m.includes("many features") || m.includes("single capability"),
|
|
781
|
-
);
|
|
782
|
-
if (hasCompetitiveSignal && angles.length < 3) {
|
|
783
|
-
angles.push({
|
|
784
|
-
category: "competitive-landscape",
|
|
785
|
-
question: "What existing tools partially solve this and where do they fall short?",
|
|
786
|
-
why_it_matters: "Understanding the landscape prevents building what already exists.",
|
|
787
|
-
priority: "strengthening",
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
return researchClassificationSchema.parse({
|
|
792
|
-
angles: angles.slice(0, 3),
|
|
793
|
-
research_needed: angles.length > 0,
|
|
794
|
-
summary:
|
|
795
|
-
angles.length === 0
|
|
796
|
-
? "Seed is strong enough to proceed without additional research."
|
|
797
|
-
: `${angles.length} research angle${angles.length > 1 ? "s" : ""} identified before proceeding.`,
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
generateBrief(
|
|
802
|
-
input: ActivationInput,
|
|
803
|
-
seed: SynthesizedSeed,
|
|
804
|
-
route: RoutingResult,
|
|
805
|
-
): string {
|
|
806
|
-
const constraintsLine = compact(input.constraints)
|
|
807
|
-
? `Constraints to respect: ${truncate(input.constraints, 180)}.`
|
|
808
|
-
: "No extra constraints were supplied beyond keeping V1 narrow and coherent.";
|
|
809
|
-
|
|
810
|
-
// Combine missing inputs (structural gaps) with open questions (user's explicit uncertainties)
|
|
811
|
-
const allQuestions = [...seed.missing_inputs, ...seed.open_questions];
|
|
812
|
-
const openQuestions =
|
|
813
|
-
allQuestions.length > 0
|
|
814
|
-
? allQuestions.map((q) => `- ${q}`).join("\n")
|
|
815
|
-
: "- None identified.";
|
|
816
|
-
|
|
817
|
-
const nonGoals = seed.non_goals.map((g) => `- ${g}`).join("\n");
|
|
818
|
-
const firstSlice = deriveFirstBuildSlice(input.raw_idea, seed.proposed_solution);
|
|
819
|
-
|
|
820
|
-
return `# SB_SPEC
|
|
821
|
-
|
|
822
|
-
## What this product is
|
|
823
|
-
|
|
824
|
-
${seed.one_liner}
|
|
825
|
-
|
|
826
|
-
## Who it is for
|
|
827
|
-
|
|
828
|
-
${seed.target_user}
|
|
829
|
-
|
|
830
|
-
## The problem
|
|
831
|
-
|
|
832
|
-
${seed.problem}
|
|
833
|
-
|
|
834
|
-
## The proposed solution
|
|
835
|
-
|
|
836
|
-
${seed.proposed_solution}
|
|
837
|
-
|
|
838
|
-
## V1 promise
|
|
839
|
-
|
|
840
|
-
${seed.v1_outcome}
|
|
841
|
-
|
|
842
|
-
## Scope in
|
|
843
|
-
|
|
844
|
-
- ${firstSlice}
|
|
845
|
-
- Keep the primary artifact aligned with the current product definition.
|
|
846
|
-
- Touch only files and artifacts that directly support the first build slice.
|
|
847
|
-
|
|
848
|
-
## Scope out
|
|
849
|
-
|
|
850
|
-
${nonGoals}
|
|
851
|
-
|
|
852
|
-
## First build slice
|
|
853
|
-
|
|
854
|
-
${firstSlice}
|
|
855
|
-
|
|
856
|
-
${constraintsLine}
|
|
857
|
-
|
|
858
|
-
## Acceptance criteria
|
|
859
|
-
|
|
860
|
-
- The product seed is valid and reflects the user's actual problem, target user, and desired outcome.
|
|
861
|
-
- The primary artifact is execution-ready for the first build slice.
|
|
862
|
-
- The next recommended surface is explicit, deterministic, and accompanied by a return condition.
|
|
863
|
-
- The first handoff can be launched as one SBX bundle.
|
|
864
|
-
|
|
865
|
-
## Open questions
|
|
866
|
-
|
|
867
|
-
${openQuestions}
|
|
868
|
-
|
|
869
|
-
## What must not change
|
|
870
|
-
|
|
871
|
-
These boundaries anchor original intent and must survive every handoff:
|
|
872
|
-
${nonGoals}
|
|
873
|
-
|
|
874
|
-
## Key risks / unknowns
|
|
875
|
-
|
|
876
|
-
- Is the seed strong enough to drive execution without further shaping? (confidence: ${seed.confidence})
|
|
877
|
-
- ${route.return_condition}
|
|
878
|
-
`;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
// ---------------------------------------------------------------------------
|
|
883
|
-
// Intake analysis — infer chips + follow-ups from raw input
|
|
884
|
-
// ---------------------------------------------------------------------------
|
|
885
|
-
|
|
886
|
-
const BOUNDARY_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
|
|
887
|
-
{ pattern: /\bno\s+billing\b/i, id: "no-billing", label: "No billing" },
|
|
888
|
-
{ pattern: /\bno\s+subscriptions?\b/i, id: "no-subscriptions", label: "No subscriptions" },
|
|
889
|
-
{ pattern: /\bno\s+admin\b/i, id: "no-admin", label: "No admin panel" },
|
|
890
|
-
{ pattern: /\bno\s+team\b/i, id: "no-team", label: "No team features" },
|
|
891
|
-
{ pattern: /\bno\s+(?:multi-?)?workspace\b/i, id: "no-workspace", label: "No multi-workspace" },
|
|
892
|
-
{ pattern: /\bno\s+(?:CRM|crm)\b/i, id: "no-crm", label: "No CRM" },
|
|
893
|
-
{ pattern: /\bno\s+project management\b/i, id: "no-pm", label: "No project management" },
|
|
894
|
-
{ pattern: /\bpersonal\s+(?:settings|account)\s+only\b/i, id: "personal-only", label: "Personal settings only" },
|
|
895
|
-
{ pattern: /\bno\s+(?:deep\s+)?(?:jira|slack|hubspot)\s+integrations?\b/i, id: "no-integrations", label: "No deep integrations" },
|
|
896
|
-
{ pattern: /\bno\s+(?:client|user)\s+(?:accounts?|login)\b/i, id: "no-client-accounts", label: "No client accounts" },
|
|
897
|
-
{ pattern: /\bno\s+(?:meeting\s+)?transcription\b/i, id: "no-transcription", label: "No transcription" },
|
|
898
|
-
{ pattern: /\bno\s+(?:client|team)\s+permissions?\b/i, id: "no-permissions", label: "No permissions system" },
|
|
899
|
-
{ pattern: /\bkeep\s+(?:it\s+)?(?:simple|lightweight|minimal)\b/i, id: "keep-simple", label: "Keep it simple" },
|
|
900
|
-
{ pattern: /\bmanual\s+curation\b/i, id: "manual-curation", label: "Manual curation in the loop" },
|
|
901
|
-
{ pattern: /\bpreserve\s+(?:user\s+)?(?:voice|language)\b/i, id: "preserve-voice", label: "Preserve user voice" },
|
|
902
|
-
{ pattern: /\bnot\s+(?:a\s+)?(?:giant\s+)?enterprise\b|\bno\s+enterprise\b/i, id: "no-enterprise", label: "No enterprise features" },
|
|
903
|
-
{ pattern: /\bno(?:t want)?\s+(?:a\s+)?(?:generic\s+)?dashboard\b/i, id: "no-dashboard", label: "No generic dashboard" },
|
|
904
|
-
{ pattern: /\bno\s+analytics\b/i, id: "no-analytics", label: "No analytics" },
|
|
905
|
-
{ pattern: /\bsingle.?page\b/i, id: "single-page", label: "Single-page app" },
|
|
906
|
-
];
|
|
907
|
-
|
|
908
|
-
const SYSTEM_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
|
|
909
|
-
{ pattern: /\bsupabase\b/i, id: "supabase", label: "Supabase" },
|
|
910
|
-
{ pattern: /\bauth\s+context\b|\bexisting\s+auth\b/i, id: "auth-context", label: "Auth context" },
|
|
911
|
-
{ pattern: /\bnew\s+\w+(?:_\w+)*\s+table\b|\bnew\s+(?:table|schema)\b/i, id: "new-db-table", label: "New database table" },
|
|
912
|
-
{ pattern: /\bexisting\s+(?:\w+\s+)?table\b/i, id: "existing-db", label: "Existing database" },
|
|
913
|
-
{ pattern: /\bavatar\s+upload\b|\bfile\s+upload\b|\bimage\s+upload\b/i, id: "upload", label: "File/image upload" },
|
|
914
|
-
{ pattern: /\bAPI\s+route\b|\bendpoint\b/i, id: "api-route", label: "API route" },
|
|
915
|
-
{ pattern: /\b\/\w+\b.*page\b|\bpage\s+at\s+\//i, id: "ui-page", label: "UI page/route" },
|
|
916
|
-
{ pattern: /\bserver\s+(?:actions?|components?)\b/i, id: "server-actions", label: "Server actions" },
|
|
917
|
-
{ pattern: /\bmiddleware\b/i, id: "middleware", label: "Middleware" },
|
|
918
|
-
{ pattern: /\bnotion\b/i, id: "notion", label: "Notion" },
|
|
919
|
-
{ pattern: /\bCSV\b/i, id: "csv", label: "CSV import/export" },
|
|
920
|
-
{ pattern: /\bNext\.?js\b/i, id: "nextjs", label: "Next.js" },
|
|
921
|
-
{ pattern: /\btailwind\b/i, id: "tailwind", label: "Tailwind CSS" },
|
|
922
|
-
{ pattern: /\bclaude\b|\bai\s+(?:api|call|prompt)\b|\bllm\b/i, id: "ai-api", label: "AI/LLM API" },
|
|
923
|
-
];
|
|
924
|
-
|
|
925
|
-
const SOURCE_PATTERNS: { pattern: RegExp; id: string; label: string }[] = [
|
|
926
|
-
{ pattern: /\bcall\s+(?:notes?|transcripts?)\b/i, id: "call-notes", label: "Call notes" },
|
|
927
|
-
{ pattern: /\bsupport\s+tickets?\b/i, id: "tickets", label: "Support tickets" },
|
|
928
|
-
{ pattern: /\bscreenshots?\b/i, id: "screenshots", label: "Screenshots" },
|
|
929
|
-
{ pattern: /\bvoice\s+(?:notes?|memos?)\b/i, id: "voice-notes", label: "Voice notes" },
|
|
930
|
-
{ pattern: /\bnotion\s+docs?\b/i, id: "notion-docs", label: "Notion docs" },
|
|
931
|
-
{ pattern: /\bslack\s+messages?\b/i, id: "slack-msgs", label: "Slack messages" },
|
|
932
|
-
{ pattern: /\bexisting\s+(?:code|repo)\b/i, id: "existing-code", label: "Existing codebase" },
|
|
933
|
-
{ pattern: /\bfigma\b/i, id: "figma", label: "Figma designs" },
|
|
934
|
-
{ pattern: /\bbrief\b|\bPRD\b|\bspec\b/i, id: "brief", label: "Existing brief/spec" },
|
|
935
|
-
];
|
|
936
|
-
|
|
937
|
-
function inferChips(raw: string, constraints: string): InferredChip[] {
|
|
938
|
-
const combined = `${raw}\n${constraints}`;
|
|
939
|
-
const chips: InferredChip[] = [];
|
|
940
|
-
|
|
941
|
-
for (const { pattern, id, label } of BOUNDARY_PATTERNS) {
|
|
942
|
-
if (pattern.test(combined)) {
|
|
943
|
-
chips.push({ id, label, category: "boundary", selected: true, inferred_from: pattern.source });
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
for (const { pattern, id, label } of SYSTEM_PATTERNS) {
|
|
948
|
-
if (pattern.test(combined)) {
|
|
949
|
-
chips.push({ id, label, category: "system", selected: true, inferred_from: pattern.source });
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
for (const { pattern, id, label } of SOURCE_PATTERNS) {
|
|
954
|
-
if (pattern.test(combined)) {
|
|
955
|
-
chips.push({ id, label, category: "source", selected: true, inferred_from: pattern.source });
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
return chips;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
function inferFollowUps(
|
|
963
|
-
seed: SynthesizedSeed,
|
|
964
|
-
chips: InferredChip[],
|
|
965
|
-
): FollowUpQuestion[] {
|
|
966
|
-
const questions: FollowUpQuestion[] = [];
|
|
967
|
-
|
|
968
|
-
// Budget: 0 for high confidence, 1 for medium, 1-2 for low
|
|
969
|
-
const budget = seed.confidence === "high" ? 0 : seed.confidence === "medium" ? 1 : 2;
|
|
970
|
-
if (budget === 0) return [];
|
|
971
|
-
|
|
972
|
-
// Check for new DB table without confirmation
|
|
973
|
-
const hasNewTable = chips.some((c) => c.id === "new-db-table");
|
|
974
|
-
const hasUpload = chips.some((c) => c.id === "upload");
|
|
975
|
-
|
|
976
|
-
if (hasNewTable && seed.confidence !== "high" && questions.length < budget) {
|
|
977
|
-
questions.push({
|
|
978
|
-
question: "Should creating the new database table be part of this scope?",
|
|
979
|
-
why: "Database changes affect migration and deployment.",
|
|
980
|
-
options: ["Yes, include migration", "No, assume table exists", "Not sure yet"],
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
if (hasUpload && seed.confidence !== "high" && questions.length < budget) {
|
|
985
|
-
questions.push({
|
|
986
|
-
question: "Should file upload use existing storage infrastructure?",
|
|
987
|
-
why: "Storage setup affects scope and complexity.",
|
|
988
|
-
options: ["Yes, reuse existing", "No, needs new setup", "Not sure yet"],
|
|
989
|
-
});
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
// Generic fallback for low confidence
|
|
993
|
-
if (seed.confidence === "low" && questions.length === 0 && budget > 0) {
|
|
994
|
-
if (seed.task_type === "implementation-request") {
|
|
995
|
-
questions.push({
|
|
996
|
-
question: "What is the single most important thing this change should accomplish?",
|
|
997
|
-
why: "Helps Switchboard choose the right scope and execution boundaries.",
|
|
998
|
-
});
|
|
999
|
-
} else {
|
|
1000
|
-
questions.push({
|
|
1001
|
-
question: "Who will use this first — and what will they do in the first session?",
|
|
1002
|
-
why: "Helps Switchboard determine the right V1 slice.",
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
return questions.slice(0, budget);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
function normRough(s: string): string {
|
|
1011
|
-
return compact(s)
|
|
1012
|
-
.toLowerCase()
|
|
1013
|
-
.replace(/[^a-z0-9\s]/g, " ")
|
|
1014
|
-
.replace(/\s+/g, " ")
|
|
1015
|
-
.trim();
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
function isSubstantiveDuplicate(candidate: string, refs: string[]): boolean {
|
|
1019
|
-
const c = normRough(candidate);
|
|
1020
|
-
if (c.length < 16) return false;
|
|
1021
|
-
for (const r of refs) {
|
|
1022
|
-
const br = normRough(r);
|
|
1023
|
-
if (!br) continue;
|
|
1024
|
-
if (c === br) return true;
|
|
1025
|
-
if (c.length >= 28 && br.length >= 28 && (c.includes(br) || br.includes(c))) return true;
|
|
1026
|
-
}
|
|
1027
|
-
return false;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
/** Drop preview fields that repeat the same substantive text as direction / problem / one-liner. */
|
|
1031
|
-
function buildDistinctActivationPreview(seed: SynthesizedSeed): IntakeAnalysis["activation_preview"] {
|
|
1032
|
-
const problem = seed.problem;
|
|
1033
|
-
const proposed_solution = seed.proposed_solution;
|
|
1034
|
-
let v1_outcome = seed.v1_outcome;
|
|
1035
|
-
let first_build_slice = seed.first_build_slice;
|
|
1036
|
-
|
|
1037
|
-
const refsForV1 = [proposed_solution, problem, seed.one_liner];
|
|
1038
|
-
if (isSubstantiveDuplicate(v1_outcome, refsForV1)) {
|
|
1039
|
-
v1_outcome = "";
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
const refsForSlice = [proposed_solution, v1_outcome || seed.v1_outcome, problem, seed.one_liner];
|
|
1043
|
-
if (isSubstantiveDuplicate(first_build_slice, refsForSlice)) {
|
|
1044
|
-
first_build_slice = "";
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
return {
|
|
1048
|
-
title: seed.title,
|
|
1049
|
-
one_liner: seed.one_liner,
|
|
1050
|
-
problem,
|
|
1051
|
-
proposed_solution,
|
|
1052
|
-
target_user: seed.target_user,
|
|
1053
|
-
v1_outcome,
|
|
1054
|
-
non_goals: seed.non_goals,
|
|
1055
|
-
first_build_slice,
|
|
1056
|
-
open_questions: seed.open_questions,
|
|
1057
|
-
missing_inputs: [],
|
|
1058
|
-
confidence: seed.confidence,
|
|
1059
|
-
task_type: seed.task_type,
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
export function analyzeIntake(
|
|
1064
|
-
rawIdea: string,
|
|
1065
|
-
constraints: string,
|
|
1066
|
-
repoExists: boolean,
|
|
1067
|
-
whatDoYouWantNext: string = "",
|
|
1068
|
-
operatorTargetUser?: string,
|
|
1069
|
-
): IntakeAnalysis {
|
|
1070
|
-
const taskType = detectTaskType(rawIdea, repoExists);
|
|
1071
|
-
const chips = inferChips(rawIdea, constraints);
|
|
1072
|
-
|
|
1073
|
-
const provider = new LocalSynthesisProvider();
|
|
1074
|
-
const activationInput: ActivationInput = {
|
|
1075
|
-
raw_idea: rawIdea,
|
|
1076
|
-
repo_exists: repoExists,
|
|
1077
|
-
what_do_you_want_next: whatDoYouWantNext.trim() || "—",
|
|
1078
|
-
constraints,
|
|
1079
|
-
};
|
|
1080
|
-
const seed = provider.extractSeed(activationInput);
|
|
1081
|
-
|
|
1082
|
-
const targetMeta = operatorTargetUser?.trim()
|
|
1083
|
-
? { user: operatorTargetUser.trim(), explicit: true }
|
|
1084
|
-
: extractTargetUser(rawIdea);
|
|
1085
|
-
const gaps = collectIntakeGaps(activationInput, seed);
|
|
1086
|
-
|
|
1087
|
-
const followUps = inferFollowUps(seed, chips);
|
|
1088
|
-
|
|
1089
|
-
const blocked = gaps.blocking.length > 0;
|
|
1090
|
-
const confidenceNote = blocked
|
|
1091
|
-
? "Lock blocked — the draft record is missing required fields."
|
|
1092
|
-
: seed.confidence === "high"
|
|
1093
|
-
? "Minimum lock criteria met — review the charter, then write the opening record."
|
|
1094
|
-
: seed.confidence === "medium"
|
|
1095
|
-
? "Shaped enough to lock if you accept the cautions below."
|
|
1096
|
-
: "Thin signal — cautions and open items are explicit; lock only if you accept the risk.";
|
|
1097
|
-
|
|
1098
|
-
const activation_preview = buildDistinctActivationPreview(seed);
|
|
1099
|
-
|
|
1100
|
-
return intakeAnalysisSchema.parse({
|
|
1101
|
-
task_type: taskType,
|
|
1102
|
-
chips,
|
|
1103
|
-
follow_ups: followUps,
|
|
1104
|
-
confidence_note: confidenceNote,
|
|
1105
|
-
activation_preview,
|
|
1106
|
-
target_user_on_record: targetMeta.explicit,
|
|
1107
|
-
activation_state: blocked ? "blocked_by_missing_evidence" : "ready_to_lock",
|
|
1108
|
-
lock_blocking_requirements: gaps.blocking,
|
|
1109
|
-
lock_cautions: gaps.cautions,
|
|
1110
|
-
lock_tracked_open: seed.open_questions,
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
export { slugify };
|