@flowctl/core 0.0.0-stage → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +30 -2
- package/THIRD_PARTY_NOTICES.md +31 -0
- package/dist/browser/cdp.d.ts +15 -0
- package/dist/browser/cdp.js +38 -0
- package/dist/browser/destructive.d.ts +34 -0
- package/dist/browser/destructive.js +127 -0
- package/dist/browser/executor.d.ts +54 -0
- package/dist/browser/executor.js +132 -0
- package/dist/browser/index.d.ts +8 -0
- package/dist/browser/index.js +8 -0
- package/dist/browser/locator.d.ts +10 -0
- package/dist/browser/locator.js +16 -0
- package/dist/browser/overlay.d.ts +26 -0
- package/dist/browser/overlay.js +78 -0
- package/dist/browser/page-text.d.ts +12 -0
- package/dist/browser/page-text.js +58 -0
- package/dist/browser/recorder.d.ts +44 -0
- package/dist/browser/recorder.js +81 -0
- package/dist/browser/scope.d.ts +57 -0
- package/dist/browser/scope.js +131 -0
- package/dist/browser/secret-fill.d.ts +15 -0
- package/dist/browser/secret-fill.js +65 -0
- package/dist/browser/snapshot-script.d.ts +14 -0
- package/dist/browser/snapshot-script.js +116 -0
- package/dist/browser/snapshot.d.ts +87 -0
- package/dist/browser/snapshot.js +123 -0
- package/dist/config/ceilings.d.ts +19 -0
- package/dist/config/ceilings.js +31 -0
- package/dist/config/effective.d.ts +35 -0
- package/dist/config/effective.js +132 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/config/index.js +11 -0
- package/dist/config/target-schema.d.ts +42 -0
- package/dist/config/target-schema.js +52 -0
- package/dist/config/target.d.ts +41 -0
- package/dist/config/target.js +143 -0
- package/dist/config.d.ts +114 -0
- package/dist/config.js +129 -0
- package/dist/derive/conflicts.d.ts +62 -0
- package/dist/derive/conflicts.js +164 -0
- package/dist/derive/contract/consistency.d.ts +17 -0
- package/dist/derive/contract/consistency.js +193 -0
- package/dist/derive/contract/emit.d.ts +51 -0
- package/dist/derive/contract/emit.js +77 -0
- package/dist/derive/contract/extract.d.ts +23 -0
- package/dist/derive/contract/extract.js +169 -0
- package/dist/derive/contract/html.d.ts +15 -0
- package/dist/derive/contract/html.js +188 -0
- package/dist/derive/contract/i18n.d.ts +11 -0
- package/dist/derive/contract/i18n.js +42 -0
- package/dist/derive/contract/index.d.ts +19 -0
- package/dist/derive/contract/index.js +19 -0
- package/dist/derive/contract/joi.d.ts +10 -0
- package/dist/derive/contract/joi.js +122 -0
- package/dist/derive/contract/js-args.d.ts +32 -0
- package/dist/derive/contract/js-args.js +42 -0
- package/dist/derive/contract/js-chain.d.ts +50 -0
- package/dist/derive/contract/js-chain.js +64 -0
- package/dist/derive/contract/js-lex.d.ts +18 -0
- package/dist/derive/contract/js-lex.js +137 -0
- package/dist/derive/contract/js-literals.d.ts +32 -0
- package/dist/derive/contract/js-literals.js +133 -0
- package/dist/derive/contract/js-parser.d.ts +45 -0
- package/dist/derive/contract/js-parser.js +234 -0
- package/dist/derive/contract/load.d.ts +45 -0
- package/dist/derive/contract/load.js +79 -0
- package/dist/derive/contract/numbers.d.ts +10 -0
- package/dist/derive/contract/numbers.js +19 -0
- package/dist/derive/contract/openapi-ref.d.ts +43 -0
- package/dist/derive/contract/openapi-ref.js +85 -0
- package/dist/derive/contract/openapi.d.ts +32 -0
- package/dist/derive/contract/openapi.js +202 -0
- package/dist/derive/contract/read.d.ts +20 -0
- package/dist/derive/contract/read.js +57 -0
- package/dist/derive/contract/ref.d.ts +36 -0
- package/dist/derive/contract/ref.js +67 -0
- package/dist/derive/contract/safe-data.d.ts +59 -0
- package/dist/derive/contract/safe-data.js +199 -0
- package/dist/derive/contract/types.d.ts +98 -0
- package/dist/derive/contract/types.js +31 -0
- package/dist/derive/contract/validators.d.ts +28 -0
- package/dist/derive/contract/validators.js +67 -0
- package/dist/derive/contract/zod.d.ts +11 -0
- package/dist/derive/contract/zod.js +137 -0
- package/dist/derive/draft/draft.d.ts +23 -0
- package/dist/derive/draft/draft.js +132 -0
- package/dist/derive/draft/ground.d.ts +21 -0
- package/dist/derive/draft/ground.js +79 -0
- package/dist/derive/draft/index.d.ts +8 -0
- package/dist/derive/draft/index.js +8 -0
- package/dist/derive/draft/lint.d.ts +51 -0
- package/dist/derive/draft/lint.js +79 -0
- package/dist/derive/draft/plan.d.ts +48 -0
- package/dist/derive/draft/plan.js +168 -0
- package/dist/derive/draft/pointer.d.ts +10 -0
- package/dist/derive/draft/pointer.js +32 -0
- package/dist/derive/draft/render.d.ts +41 -0
- package/dist/derive/draft/render.js +110 -0
- package/dist/derive/draft/types.d.ts +96 -0
- package/dist/derive/draft/types.js +57 -0
- package/dist/derive/draft/verbs.d.ts +49 -0
- package/dist/derive/draft/verbs.js +116 -0
- package/dist/derive/escape.d.ts +26 -0
- package/dist/derive/escape.js +50 -0
- package/dist/derive/index.d.ts +18 -0
- package/dist/derive/index.js +18 -0
- package/dist/derive/invariants/define.d.ts +18 -0
- package/dist/derive/invariants/define.js +48 -0
- package/dist/derive/invariants/evidence.d.ts +625 -0
- package/dist/derive/invariants/evidence.js +83 -0
- package/dist/derive/invariants/index.d.ts +9 -0
- package/dist/derive/invariants/index.js +9 -0
- package/dist/derive/invariants/params.d.ts +274 -0
- package/dist/derive/invariants/params.js +83 -0
- package/dist/derive/invariants/registry.d.ts +11 -0
- package/dist/derive/invariants/registry.js +27 -0
- package/dist/derive/invariants/resolve.d.ts +16 -0
- package/dist/derive/invariants/resolve.js +40 -0
- package/dist/derive/invariants/steps.d.ts +21 -0
- package/dist/derive/invariants/steps.js +31 -0
- package/dist/derive/invariants/templates/behaviour.d.ts +9 -0
- package/dist/derive/invariants/templates/behaviour.js +98 -0
- package/dist/derive/invariants/templates/crud.d.ts +9 -0
- package/dist/derive/invariants/templates/crud.js +72 -0
- package/dist/derive/invariants/templates/free.d.ts +2 -0
- package/dist/derive/invariants/templates/free.js +29 -0
- package/dist/derive/invariants/types.d.ts +67 -0
- package/dist/derive/invariants/types.js +16 -0
- package/dist/derive/match/evidence.d.ts +17 -0
- package/dist/derive/match/evidence.js +121 -0
- package/dist/derive/match/index.d.ts +7 -0
- package/dist/derive/match/index.js +6 -0
- package/dist/derive/match/match.d.ts +15 -0
- package/dist/derive/match/match.js +108 -0
- package/dist/derive/match/order.d.ts +13 -0
- package/dist/derive/match/order.js +48 -0
- package/dist/derive/match/sources.d.ts +39 -0
- package/dist/derive/match/sources.js +73 -0
- package/dist/derive/match/text.d.ts +15 -0
- package/dist/derive/match/text.js +20 -0
- package/dist/derive/match/types.d.ts +133 -0
- package/dist/derive/match/types.js +1 -0
- package/dist/derive/review/approve-steps.d.ts +41 -0
- package/dist/derive/review/approve-steps.js +75 -0
- package/dist/derive/review/approve.d.ts +53 -0
- package/dist/derive/review/approve.js +109 -0
- package/dist/derive/review/baseline.d.ts +47 -0
- package/dist/derive/review/baseline.js +73 -0
- package/dist/derive/review/confirm-replay.d.ts +33 -0
- package/dist/derive/review/confirm-replay.js +55 -0
- package/dist/derive/review/index.d.ts +13 -0
- package/dist/derive/review/index.js +12 -0
- package/dist/derive/review/prune.d.ts +28 -0
- package/dist/derive/review/prune.js +29 -0
- package/dist/derive/review/revision.d.ts +12 -0
- package/dist/derive/review/revision.js +15 -0
- package/dist/derive/review/screen.d.ts +24 -0
- package/dist/derive/review/screen.js +109 -0
- package/dist/derive/review/types.d.ts +56 -0
- package/dist/derive/review/types.js +1 -0
- package/dist/explore/act.d.ts +56 -0
- package/dist/explore/act.js +156 -0
- package/dist/explore/decisions.d.ts +21 -0
- package/dist/explore/decisions.js +40 -0
- package/dist/explore/exploration.d.ts +93 -0
- package/dist/explore/exploration.js +246 -0
- package/dist/explore/guard.d.ts +40 -0
- package/dist/explore/guard.js +94 -0
- package/dist/explore/heal.d.ts +23 -0
- package/dist/explore/heal.js +80 -0
- package/dist/explore/index.d.ts +6 -0
- package/dist/explore/index.js +5 -0
- package/dist/explore/loop.d.ts +47 -0
- package/dist/explore/loop.js +102 -0
- package/dist/explore/page-text.d.ts +21 -0
- package/dist/explore/page-text.js +36 -0
- package/dist/explore/policy.d.ts +30 -0
- package/dist/explore/policy.js +52 -0
- package/dist/explore/request.d.ts +24 -0
- package/dist/explore/request.js +55 -0
- package/dist/explore/run-view.d.ts +24 -0
- package/dist/explore/run-view.js +59 -0
- package/dist/explore/types.d.ts +61 -0
- package/dist/explore/types.js +1 -0
- package/dist/explore/validate.d.ts +25 -0
- package/dist/explore/validate.js +122 -0
- package/dist/flow/index.d.ts +5 -0
- package/dist/flow/index.js +5 -0
- package/dist/flow/schema.d.ts +715 -0
- package/dist/flow/schema.js +150 -0
- package/dist/flow/source-ref.d.ts +44 -0
- package/dist/flow/source-ref.js +69 -0
- package/dist/flow/steps.d.ts +33 -0
- package/dist/flow/steps.js +198 -0
- package/dist/flow/store.d.ts +55 -0
- package/dist/flow/store.js +145 -0
- package/dist/flow/templates.d.ts +67 -0
- package/dist/flow/templates.js +167 -0
- package/dist/foundation/errors.d.ts +24 -0
- package/dist/foundation/errors.js +30 -0
- package/dist/foundation/fixtures.d.ts +28 -0
- package/dist/foundation/fixtures.js +100 -0
- package/dist/foundation/hosts.d.ts +5 -0
- package/dist/foundation/hosts.js +18 -0
- package/dist/foundation/index.d.ts +12 -0
- package/dist/foundation/index.js +12 -0
- package/dist/foundation/invisible.d.ts +8 -0
- package/dist/foundation/invisible.js +8 -0
- package/dist/foundation/names.d.ts +24 -0
- package/dist/foundation/names.js +66 -0
- package/dist/foundation/provenance.d.ts +10 -0
- package/dist/foundation/provenance.js +14 -0
- package/dist/foundation/safe-fs.d.ts +45 -0
- package/dist/foundation/safe-fs.js +136 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +15 -0
- package/dist/login.d.ts +23 -0
- package/dist/login.js +58 -0
- package/dist/observe/budget.d.ts +33 -0
- package/dist/observe/budget.js +44 -0
- package/dist/observe/capture.d.ts +32 -0
- package/dist/observe/capture.js +81 -0
- package/dist/observe/checks/index.d.ts +6 -0
- package/dist/observe/checks/index.js +6 -0
- package/dist/observe/checks/rules.d.ts +19 -0
- package/dist/observe/checks/rules.js +104 -0
- package/dist/observe/checks/schema.d.ts +160 -0
- package/dist/observe/checks/schema.js +77 -0
- package/dist/observe/crawl.d.ts +60 -0
- package/dist/observe/crawl.js +149 -0
- package/dist/observe/index.d.ts +10 -0
- package/dist/observe/index.js +10 -0
- package/dist/observe/links.d.ts +47 -0
- package/dist/observe/links.js +74 -0
- package/dist/observe/output.d.ts +31 -0
- package/dist/observe/output.js +67 -0
- package/dist/observe/page-script.d.ts +12 -0
- package/dist/observe/page-script.js +75 -0
- package/dist/observe/read-page.d.ts +22 -0
- package/dist/observe/read-page.js +108 -0
- package/dist/observe/schema.d.ts +529 -0
- package/dist/observe/schema.js +104 -0
- package/dist/observe/summary.d.ts +31 -0
- package/dist/observe/summary.js +32 -0
- package/dist/observe/walk.d.ts +31 -0
- package/dist/observe/walk.js +153 -0
- package/dist/provenance/approval-state.d.ts +29 -0
- package/dist/provenance/approval-state.js +50 -0
- package/dist/provenance/approvals-file.d.ts +38 -0
- package/dist/provenance/approvals-file.js +64 -0
- package/dist/provenance/baseline.d.ts +20 -0
- package/dist/provenance/baseline.js +20 -0
- package/dist/provenance/errors.d.ts +12 -0
- package/dist/provenance/errors.js +13 -0
- package/dist/provenance/flow-hash.d.ts +14 -0
- package/dist/provenance/flow-hash.js +19 -0
- package/dist/provenance/hand-written.d.ts +68 -0
- package/dist/provenance/hand-written.js +128 -0
- package/dist/provenance/index.d.ts +16 -0
- package/dist/provenance/index.js +16 -0
- package/dist/provenance/label.d.ts +28 -0
- package/dist/provenance/label.js +99 -0
- package/dist/provenance/payload.d.ts +18 -0
- package/dist/provenance/payload.js +69 -0
- package/dist/provenance/record.d.ts +79 -0
- package/dist/provenance/record.js +55 -0
- package/dist/provenance/required-revision.d.ts +16 -0
- package/dist/provenance/required-revision.js +12 -0
- package/dist/provenance/state.d.ts +30 -0
- package/dist/provenance/state.js +47 -0
- package/dist/provenance/verify.d.ts +48 -0
- package/dist/provenance/verify.js +137 -0
- package/dist/reconcile/classify/classify.d.ts +13 -0
- package/dist/reconcile/classify/classify.js +87 -0
- package/dist/reconcile/classify/index.d.ts +9 -0
- package/dist/reconcile/classify/index.js +9 -0
- package/dist/reconcile/classify/near.d.ts +39 -0
- package/dist/reconcile/classify/near.js +79 -0
- package/dist/reconcile/classify/run-rules.d.ts +14 -0
- package/dist/reconcile/classify/run-rules.js +94 -0
- package/dist/reconcile/classify/spec-rules.d.ts +34 -0
- package/dist/reconcile/classify/spec-rules.js +186 -0
- package/dist/reconcile/classify/strings.d.ts +25 -0
- package/dist/reconcile/classify/strings.js +104 -0
- package/dist/reconcile/classify/subject.d.ts +50 -0
- package/dist/reconcile/classify/subject.js +144 -0
- package/dist/reconcile/classify/types.d.ts +100 -0
- package/dist/reconcile/classify/types.js +26 -0
- package/dist/reconcile/code/build.d.ts +40 -0
- package/dist/reconcile/code/build.js +141 -0
- package/dist/reconcile/code/file-routes.d.ts +26 -0
- package/dist/reconcile/code/file-routes.js +89 -0
- package/dist/reconcile/code/files.d.ts +32 -0
- package/dist/reconcile/code/files.js +50 -0
- package/dist/reconcile/code/index.d.ts +18 -0
- package/dist/reconcile/code/index.js +18 -0
- package/dist/reconcile/code/json.d.ts +14 -0
- package/dist/reconcile/code/json.js +141 -0
- package/dist/reconcile/code/labels.d.ts +17 -0
- package/dist/reconcile/code/labels.js +50 -0
- package/dist/reconcile/code/lexer.d.ts +24 -0
- package/dist/reconcile/code/lexer.js +142 -0
- package/dist/reconcile/code/literals.d.ts +26 -0
- package/dist/reconcile/code/literals.js +131 -0
- package/dist/reconcile/code/lookup.d.ts +51 -0
- package/dist/reconcile/code/lookup.js +96 -0
- package/dist/reconcile/code/messages.d.ts +13 -0
- package/dist/reconcile/code/messages.js +115 -0
- package/dist/reconcile/code/route-match.d.ts +34 -0
- package/dist/reconcile/code/route-match.js +66 -0
- package/dist/reconcile/code/routes.d.ts +47 -0
- package/dist/reconcile/code/routes.js +60 -0
- package/dist/reconcile/code/source-routes.d.ts +31 -0
- package/dist/reconcile/code/source-routes.js +179 -0
- package/dist/reconcile/code/text.d.ts +32 -0
- package/dist/reconcile/code/text.js +50 -0
- package/dist/reconcile/code/types.d.ts +65 -0
- package/dist/reconcile/code/types.js +23 -0
- package/dist/reconcile/gaps/find.d.ts +46 -0
- package/dist/reconcile/gaps/find.js +174 -0
- package/dist/reconcile/gaps/index.d.ts +9 -0
- package/dist/reconcile/gaps/index.js +9 -0
- package/dist/reconcile/gaps/pages.d.ts +22 -0
- package/dist/reconcile/gaps/pages.js +29 -0
- package/dist/reconcile/gaps/schema.d.ts +206 -0
- package/dist/reconcile/gaps/schema.js +132 -0
- package/dist/reconcile/gaps/spec-gaps.d.ts +25 -0
- package/dist/reconcile/gaps/spec-gaps.js +84 -0
- package/dist/reconcile/gaps/write.d.ts +25 -0
- package/dist/reconcile/gaps/write.js +93 -0
- package/dist/reconcile/index.d.ts +14 -0
- package/dist/reconcile/index.js +14 -0
- package/dist/reconcile/project/index.d.ts +12 -0
- package/dist/reconcile/project/index.js +12 -0
- package/dist/reconcile/project/inputs.d.ts +46 -0
- package/dist/reconcile/project/inputs.js +141 -0
- package/dist/reconcile/project/out.d.ts +24 -0
- package/dist/reconcile/project/out.js +54 -0
- package/dist/reconcile/project/reconcile.d.ts +64 -0
- package/dist/reconcile/project/reconcile.js +98 -0
- package/dist/reconcile/project/run-json.d.ts +18 -0
- package/dist/reconcile/project/run-json.js +109 -0
- package/dist/replay.d.ts +61 -0
- package/dist/replay.js +164 -0
- package/dist/result.d.ts +143 -0
- package/dist/result.js +1 -0
- package/dist/run/bounds.d.ts +54 -0
- package/dist/run/bounds.js +66 -0
- package/dist/run/context-limits.d.ts +45 -0
- package/dist/run/context-limits.js +81 -0
- package/dist/run/deadline.d.ts +36 -0
- package/dist/run/deadline.js +63 -0
- package/dist/run/decision-log.d.ts +23 -0
- package/dist/run/decision-log.js +1 -0
- package/dist/run/env-inputs.d.ts +17 -0
- package/dist/run/env-inputs.js +42 -0
- package/dist/run/evidence.d.ts +92 -0
- package/dist/run/evidence.js +210 -0
- package/dist/run/final-shot.d.ts +8 -0
- package/dist/run/final-shot.js +14 -0
- package/dist/run/finish.d.ts +48 -0
- package/dist/run/finish.js +150 -0
- package/dist/run/frames.d.ts +25 -0
- package/dist/run/frames.js +57 -0
- package/dist/run/guards.d.ts +34 -0
- package/dist/run/guards.js +98 -0
- package/dist/run/hooks.d.ts +30 -0
- package/dist/run/hooks.js +42 -0
- package/dist/run/index.d.ts +16 -0
- package/dist/run/index.js +16 -0
- package/dist/run/late-artefact.d.ts +16 -0
- package/dist/run/late-artefact.js +43 -0
- package/dist/run/ledger/cleanup-run.d.ts +46 -0
- package/dist/run/ledger/cleanup-run.js +183 -0
- package/dist/run/ledger/cleanup.d.ts +43 -0
- package/dist/run/ledger/cleanup.js +100 -0
- package/dist/run/ledger/context.d.ts +15 -0
- package/dist/run/ledger/context.js +42 -0
- package/dist/run/ledger/create.d.ts +19 -0
- package/dist/run/ledger/create.js +104 -0
- package/dist/run/ledger/id-of.d.ts +20 -0
- package/dist/run/ledger/id-of.js +52 -0
- package/dist/run/ledger/index.d.ts +15 -0
- package/dist/run/ledger/index.js +15 -0
- package/dist/run/ledger/plan-add.d.ts +69 -0
- package/dist/run/ledger/plan-add.js +144 -0
- package/dist/run/ledger/recorded.d.ts +17 -0
- package/dist/run/ledger/recorded.js +50 -0
- package/dist/run/ledger/run-ledger.d.ts +103 -0
- package/dist/run/ledger/run-ledger.js +210 -0
- package/dist/run/ledger/scan.d.ts +43 -0
- package/dist/run/ledger/scan.js +104 -0
- package/dist/run/ledger/seen.d.ts +42 -0
- package/dist/run/ledger/seen.js +64 -0
- package/dist/run/metrics.d.ts +10 -0
- package/dist/run/metrics.js +28 -0
- package/dist/run/net-entry.d.ts +23 -0
- package/dist/run/net-entry.js +25 -0
- package/dist/run/options.d.ts +36 -0
- package/dist/run/options.js +8 -0
- package/dist/run/outcome.d.ts +15 -0
- package/dist/run/outcome.js +26 -0
- package/dist/run/prepare.d.ts +29 -0
- package/dist/run/prepare.js +42 -0
- package/dist/run/profiles.d.ts +83 -0
- package/dist/run/profiles.js +205 -0
- package/dist/run/prune-runs.d.ts +7 -0
- package/dist/run/prune-runs.js +23 -0
- package/dist/run/redact.d.ts +23 -0
- package/dist/run/redact.js +110 -0
- package/dist/run/redirect-hold.d.ts +65 -0
- package/dist/run/redirect-hold.js +156 -0
- package/dist/run/request-guard.d.ts +113 -0
- package/dist/run/request-guard.js +242 -0
- package/dist/run/scope-for.d.ts +14 -0
- package/dist/run/scope-for.js +32 -0
- package/dist/run/scope-guard.d.ts +102 -0
- package/dist/run/scope-guard.js +215 -0
- package/dist/run/session-state.d.ts +27 -0
- package/dist/run/session-state.js +56 -0
- package/dist/run/session.d.ts +128 -0
- package/dist/run/session.js +239 -0
- package/dist/run/verifier.d.ts +34 -0
- package/dist/run/verifier.js +182 -0
- package/dist/run/video.d.ts +43 -0
- package/dist/run/video.js +129 -0
- package/dist/safe-fs.d.ts +1 -0
- package/dist/safe-fs.js +1 -0
- package/dist/save.d.ts +44 -0
- package/dist/save.js +85 -0
- package/dist/spec/index.d.ts +10 -0
- package/dist/spec/index.js +10 -0
- package/dist/spec/markdown/front-matter.d.ts +38 -0
- package/dist/spec/markdown/front-matter.js +80 -0
- package/dist/spec/markdown/index.d.ts +8 -0
- package/dist/spec/markdown/index.js +8 -0
- package/dist/spec/markdown/parse.d.ts +15 -0
- package/dist/spec/markdown/parse.js +166 -0
- package/dist/spec/markdown/provider.d.ts +35 -0
- package/dist/spec/markdown/provider.js +144 -0
- package/dist/spec/registry.d.ts +74 -0
- package/dist/spec/registry.js +91 -0
- package/dist/spec/schema.d.ts +78 -0
- package/dist/spec/schema.js +73 -0
- package/dist/spec/text.d.ts +54 -0
- package/dist/spec/text.js +123 -0
- package/dist/system1/client.d.ts +54 -0
- package/dist/system1/client.js +58 -0
- package/dist/system1/index.d.ts +3 -0
- package/dist/system1/index.js +3 -0
- package/dist/system1/jev.d.ts +46 -0
- package/dist/system1/jev.js +181 -0
- package/dist/system1/prompts.d.ts +15 -0
- package/dist/system1/prompts.js +45 -0
- package/dist/system1/protocol.d.ts +70 -0
- package/dist/system1/protocol.js +184 -0
- package/dist/system1/wire.d.ts +37 -0
- package/dist/system1/wire.js +148 -0
- package/dist/trust/admin.d.ts +69 -0
- package/dist/trust/admin.js +111 -0
- package/dist/trust/anchor-file.d.ts +19 -0
- package/dist/trust/anchor-file.js +89 -0
- package/dist/trust/anchor-io.d.ts +67 -0
- package/dist/trust/anchor-io.js +231 -0
- package/dist/trust/anchor.d.ts +56 -0
- package/dist/trust/anchor.js +79 -0
- package/dist/trust/canonical.d.ts +14 -0
- package/dist/trust/canonical.js +54 -0
- package/dist/trust/closure/digest.d.ts +25 -0
- package/dist/trust/closure/digest.js +37 -0
- package/dist/trust/closure/files.d.ts +75 -0
- package/dist/trust/closure/files.js +181 -0
- package/dist/trust/closure/index.d.ts +11 -0
- package/dist/trust/closure/index.js +10 -0
- package/dist/trust/closure/judge.d.ts +23 -0
- package/dist/trust/closure/judge.js +82 -0
- package/dist/trust/closure/lexer.d.ts +36 -0
- package/dist/trust/closure/lexer.js +209 -0
- package/dist/trust/closure/net.d.ts +12 -0
- package/dist/trust/closure/net.js +129 -0
- package/dist/trust/closure/parse.d.ts +18 -0
- package/dist/trust/closure/parse.js +67 -0
- package/dist/trust/closure/paths.d.ts +63 -0
- package/dist/trust/closure/paths.js +129 -0
- package/dist/trust/closure/types.d.ts +78 -0
- package/dist/trust/closure/types.js +15 -0
- package/dist/trust/closure/utilities.d.ts +13 -0
- package/dist/trust/closure/utilities.js +157 -0
- package/dist/trust/closure/walk.d.ts +29 -0
- package/dist/trust/closure/walk.js +148 -0
- package/dist/trust/commands.d.ts +136 -0
- package/dist/trust/commands.js +79 -0
- package/dist/trust/confirm/body.d.ts +33 -0
- package/dist/trust/confirm/body.js +228 -0
- package/dist/trust/confirm/derive.d.ts +77 -0
- package/dist/trust/confirm/derive.js +196 -0
- package/dist/trust/confirm/digest.d.ts +59 -0
- package/dist/trust/confirm/digest.js +103 -0
- package/dist/trust/confirm/display.d.ts +11 -0
- package/dist/trust/confirm/display.js +24 -0
- package/dist/trust/confirm/entry.d.ts +62 -0
- package/dist/trust/confirm/entry.js +193 -0
- package/dist/trust/confirm/grammar.d.ts +62 -0
- package/dist/trust/confirm/grammar.js +102 -0
- package/dist/trust/confirm/index.d.ts +17 -0
- package/dist/trust/confirm/index.js +17 -0
- package/dist/trust/confirm/match.d.ts +48 -0
- package/dist/trust/confirm/match.js +187 -0
- package/dist/trust/confirm/rules.d.ts +37 -0
- package/dist/trust/confirm/rules.js +180 -0
- package/dist/trust/confirm/schema.d.ts +137 -0
- package/dist/trust/confirm/schema.js +76 -0
- package/dist/trust/consent/entry.d.ts +95 -0
- package/dist/trust/consent/entry.js +148 -0
- package/dist/trust/consent/env.d.ts +34 -0
- package/dist/trust/consent/env.js +130 -0
- package/dist/trust/consent/index.d.ts +10 -0
- package/dist/trust/consent/index.js +10 -0
- package/dist/trust/contain/index.d.ts +12 -0
- package/dist/trust/contain/index.js +12 -0
- package/dist/trust/contain/read.d.ts +21 -0
- package/dist/trust/contain/read.js +100 -0
- package/dist/trust/contain/root.d.ts +72 -0
- package/dist/trust/contain/root.js +120 -0
- package/dist/trust/contain/walk.d.ts +68 -0
- package/dist/trust/contain/walk.js +149 -0
- package/dist/trust/env-origins.d.ts +24 -0
- package/dist/trust/env-origins.js +71 -0
- package/dist/trust/env-vars.d.ts +45 -0
- package/dist/trust/env-vars.js +71 -0
- package/dist/trust/envs.d.ts +68 -0
- package/dist/trust/envs.js +136 -0
- package/dist/trust/errors.d.ts +24 -0
- package/dist/trust/errors.js +17 -0
- package/dist/trust/hookrun/env.d.ts +27 -0
- package/dist/trust/hookrun/env.js +82 -0
- package/dist/trust/hookrun/index.d.ts +10 -0
- package/dist/trust/hookrun/index.js +10 -0
- package/dist/trust/hookrun/runner.d.ts +50 -0
- package/dist/trust/hookrun/runner.js +115 -0
- package/dist/trust/hookrun/snapshot.d.ts +37 -0
- package/dist/trust/hookrun/snapshot.js +101 -0
- package/dist/trust/hookrun/spawn.d.ts +14 -0
- package/dist/trust/hookrun/spawn.js +55 -0
- package/dist/trust/identity.d.ts +20 -0
- package/dist/trust/identity.js +116 -0
- package/dist/trust/index.d.ts +52 -0
- package/dist/trust/index.js +51 -0
- package/dist/trust/init.d.ts +80 -0
- package/dist/trust/init.js +157 -0
- package/dist/trust/key-file.d.ts +50 -0
- package/dist/trust/key-file.js +158 -0
- package/dist/trust/keys-commit.d.ts +7 -0
- package/dist/trust/keys-commit.js +21 -0
- package/dist/trust/keys-crypto.d.ts +37 -0
- package/dist/trust/keys-crypto.js +56 -0
- package/dist/trust/keys-load.d.ts +12 -0
- package/dist/trust/keys-load.js +82 -0
- package/dist/trust/keys-path.d.ts +23 -0
- package/dist/trust/keys-path.js +65 -0
- package/dist/trust/keys-pub.d.ts +12 -0
- package/dist/trust/keys-pub.js +65 -0
- package/dist/trust/keys-schema.d.ts +115 -0
- package/dist/trust/keys-schema.js +160 -0
- package/dist/trust/keys-seal.d.ts +22 -0
- package/dist/trust/keys-seal.js +108 -0
- package/dist/trust/keys.d.ts +93 -0
- package/dist/trust/keys.js +176 -0
- package/dist/trust/ledger-file.d.ts +75 -0
- package/dist/trust/ledger-file.js +216 -0
- package/dist/trust/ledger-lines.d.ts +70 -0
- package/dist/trust/ledger-lines.js +122 -0
- package/dist/trust/ledger-lock.d.ts +41 -0
- package/dist/trust/ledger-lock.js +233 -0
- package/dist/trust/location.d.ts +32 -0
- package/dist/trust/location.js +75 -0
- package/dist/trust/log-read.d.ts +48 -0
- package/dist/trust/log-read.js +149 -0
- package/dist/trust/log.d.ts +91 -0
- package/dist/trust/log.js +111 -0
- package/dist/trust/owner-key.d.ts +37 -0
- package/dist/trust/owner-key.js +157 -0
- package/dist/trust/projects.d.ts +34 -0
- package/dist/trust/projects.js +101 -0
- package/dist/trust/registry.d.ts +34 -0
- package/dist/trust/registry.js +74 -0
- package/dist/trust/replace-abandon.d.ts +22 -0
- package/dist/trust/replace-abandon.js +98 -0
- package/dist/trust/replace.d.ts +53 -0
- package/dist/trust/replace.js +151 -0
- package/dist/trust/revision.d.ts +28 -0
- package/dist/trust/revision.js +57 -0
- package/dist/trust/rotate-recover.d.ts +54 -0
- package/dist/trust/rotate-recover.js +194 -0
- package/dist/trust/rotate-sign.d.ts +29 -0
- package/dist/trust/rotate-sign.js +131 -0
- package/dist/trust/rotate.d.ts +64 -0
- package/dist/trust/rotate.js +160 -0
- package/dist/trust/schema.d.ts +105 -0
- package/dist/trust/schema.js +127 -0
- package/dist/trust/settings.d.ts +51 -0
- package/dist/trust/settings.js +117 -0
- package/dist/trust/signing.d.ts +28 -0
- package/dist/trust/signing.js +39 -0
- package/dist/trust/store-fs.d.ts +34 -0
- package/dist/trust/store-fs.js +124 -0
- package/dist/trust/store.d.ts +84 -0
- package/dist/trust/store.js +186 -0
- package/dist/trust/system1.d.ts +50 -0
- package/dist/trust/system1.js +111 -0
- package/dist/trust/write.d.ts +49 -0
- package/dist/trust/write.js +127 -0
- package/package.json +31 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
flowctl
|
|
2
|
+
Copyright 2026 The flowctl Authors
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
It includes code adapted from jev-ultrafast (https://github.com/browser-use/jev-ultrafast, MIT,
|
|
7
|
+
Copyright (c) 2026 Browser Use) in packages/core/src/browser/snapshot-script.ts and
|
|
8
|
+
packages/core/src/system1/prompts.ts. The MIT licence text is in packages/core/THIRD_PARTY_NOTICES.md.
|
package/README.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @flowctl/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The flowctl engine: everything except the command line and the MCP transport.
|
|
4
|
+
|
|
5
|
+
- **Replay** a recorded flow with no model and decide the verdict from assertions (`replayFlow`, `replayMany`, `summarize`, `exitCodeFor`).
|
|
6
|
+
- **Explore** a new flow with a System 1 model driving the browser and the orchestrator stepping in on escalation (`Exploration`; the System 1 driver comes from `createDriver`, `System1Client.fromConfig` is its deprecated name), then **save** it after a confirming model-free replay (`saveExploration`).
|
|
7
|
+
- **Observe** an app (early): a read-only, breadth-first crawl that returns an `AppMap` and writes `appmap.json` into the run directory (`observe`), and its compact summary (`observeSummary`); `appMapPath` and `writeAppMap` check and write a copy inside the flows directory (ADR 0033).
|
|
8
|
+
- **Reconcile** a project's runs (early): `reconcileRun` classes a failed or errored run from its `run.json` (with an optional code folder, `AppMap` and markdown spec folder) and writes `classification.json` into its run directory (ADR 0036); `reconcileGaps` writes the coverage gaps between code, one crawl and the spec as `gaps.json` and `gaps.md` (ADR 0037); `GAP_KINDS` lists the kinds in report order. Advice, never a verdict.
|
|
9
|
+
- **Heal** a broken locator during replay with one System 1 question (opt-in).
|
|
10
|
+
- **Demo video** of a replay (`replayFlow(cfg, flow, { browser, video: true })`): one `video-<profile>.webm` per
|
|
11
|
+
profile with a step overlay that assertions cannot see (ADR 0032).
|
|
12
|
+
- **Wall-clock budget:** every `RunSession` stops at `target.budgets.wallClockMs` and ends `budget_exceeded`;
|
|
13
|
+
`run.signal` aborts with it (pass it to anything that can stop early).
|
|
14
|
+
- **Config, flows, login:** `loadConfig`, `findFlows`, `findFlowsWithErrors`, `loadFlow`, `login`.
|
|
15
|
+
- **Running a flow:** `RunSession` drives one run: profile contexts, `perform(step)`, `snapshot()`, `check()`, evidence and hooks, `finish()`. Replay and exploration are loops on top of it.
|
|
16
|
+
|
|
17
|
+
The interface is `src/index.ts`; nothing else is public. Result types are in `src/result.ts`.
|
|
18
|
+
|
|
19
|
+
## Tests
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun run test -- packages/core/test/flow.test.ts # one unit file
|
|
23
|
+
bun run test:browser -- packages/core/test/replay.browser.test.ts
|
|
24
|
+
bun run test:accuracy # seeded bugs
|
|
25
|
+
set -a; . spike/.env; set +a; bun run test:contract # real Jev, billed, opt-in; key from spike/.env
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Browser tests run against `@flowctl/fixture-app`; exploration tests use its scripted fake System 1.
|
|
29
|
+
|
|
30
|
+
`src/browser/snapshot-script.ts` and the prompts in `src/system1/prompts.ts` are adapted from jev-ultrafast (MIT);
|
|
31
|
+
see `THIRD_PARTY_NOTICES.md`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## jev-ultrafast
|
|
4
|
+
|
|
5
|
+
`src/browser/snapshot-script.ts` is a modified port of `jev_ultrafast/snapshot.js`, and the
|
|
6
|
+
decision prompts in `src/system1/prompts.ts` are adapted from `jev_ultrafast/questions.py`, from
|
|
7
|
+
https://github.com/browser-use/jev-ultrafast (commit 1231850a0bf1a0c0341fe408ef1668dbbfdfac46).
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
MIT License
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2026 Browser Use
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
SOFTWARE.
|
|
31
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CDPSession, Page } from 'playwright';
|
|
2
|
+
/**
|
|
3
|
+
* Runs `work` on the one CDP session flowctl keeps for `page`, opened on first use and detached when the page
|
|
4
|
+
* closes, so a read that runs often (a snapshot per exploration step, a page-text scan per create) does not open and
|
|
5
|
+
* close a session each time.
|
|
6
|
+
*
|
|
7
|
+
* @remarks Chromium only (CDP). A Playwright trace records the `newCDPSession` call (its result is the session, no
|
|
8
|
+
* page data) and none of the calls sent on the session: Playwright does not attribute them to the context. That is
|
|
9
|
+
* what keeps CDP reads out of a safe trace (ADR 0030 amendment 2026-11-12); the redaction suite
|
|
10
|
+
* (`test/redaction/`) checks it on every Playwright upgrade. When `work` throws (a protocol error: the target went
|
|
11
|
+
* away, a navigation destroyed the context), the session is dropped and detached, and the next call opens a new
|
|
12
|
+
* one.
|
|
13
|
+
* @throws whatever `work` or opening the session throws.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withPageSession<T>(page: Page, work: (cdp: CDPSession) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const sessions = new WeakMap();
|
|
2
|
+
/** Drops the cached session of `page` if it is still `s`, and detaches it. */
|
|
3
|
+
function drop(page, s) {
|
|
4
|
+
if (sessions.get(page) !== s)
|
|
5
|
+
return;
|
|
6
|
+
sessions.delete(page);
|
|
7
|
+
void s.then((cdp) => cdp.detach()).catch(() => undefined);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Runs `work` on the one CDP session flowctl keeps for `page`, opened on first use and detached when the page
|
|
11
|
+
* closes, so a read that runs often (a snapshot per exploration step, a page-text scan per create) does not open and
|
|
12
|
+
* close a session each time.
|
|
13
|
+
*
|
|
14
|
+
* @remarks Chromium only (CDP). A Playwright trace records the `newCDPSession` call (its result is the session, no
|
|
15
|
+
* page data) and none of the calls sent on the session: Playwright does not attribute them to the context. That is
|
|
16
|
+
* what keeps CDP reads out of a safe trace (ADR 0030 amendment 2026-11-12); the redaction suite
|
|
17
|
+
* (`test/redaction/`) checks it on every Playwright upgrade. When `work` throws (a protocol error: the target went
|
|
18
|
+
* away, a navigation destroyed the context), the session is dropped and detached, and the next call opens a new
|
|
19
|
+
* one.
|
|
20
|
+
* @throws whatever `work` or opening the session throws.
|
|
21
|
+
*/
|
|
22
|
+
export async function withPageSession(page, work) {
|
|
23
|
+
let s = sessions.get(page);
|
|
24
|
+
if (s === undefined) {
|
|
25
|
+
const opened = page.context().newCDPSession(page);
|
|
26
|
+
s = opened;
|
|
27
|
+
sessions.set(page, opened);
|
|
28
|
+
page.once('close', () => drop(page, opened));
|
|
29
|
+
}
|
|
30
|
+
const current = s;
|
|
31
|
+
try {
|
|
32
|
+
return await work(await current);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
drop(page, current);
|
|
36
|
+
throw e;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Words that make an action control destructive (ADR 0024 section 5, interim matcher): it deletes, approves,
|
|
3
|
+
* rejects, pays or otherwise changes data that is not the run's own. Lowercase NFC; a multi-word entry matches
|
|
4
|
+
* consecutive tokens. Creating and saving are not listed: exploring a create flow on a shared env is the point.
|
|
5
|
+
*
|
|
6
|
+
* @remarks Both Vietnamese tone placements are listed (`xoá` and `xóa`). `huỷ`/`hủy` and `đặt lại`/`reset` are
|
|
7
|
+
* not listed, because they label every dialog's close button and every filter's reset button.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DESTRUCTIVE_WORDS: readonly string[];
|
|
10
|
+
/**
|
|
11
|
+
* Phrases that contain a destructive word but name the run's own action or a label, not a destructive one:
|
|
12
|
+
* submitting one's own request for approval, an approver field, a status, a search keyword. Their tokens are
|
|
13
|
+
* removed before matching.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SAFE_PHRASES: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The destructive word `label` contains as whole tokens (so "Resend" is not "send", and "Xoá?" is "xoá"), once
|
|
18
|
+
* the {@link SAFE_PHRASES} are removed; or `undefined`.
|
|
19
|
+
*
|
|
20
|
+
* @param extra the repo's `target.destructiveWords`, matched like the core list; they only add words.
|
|
21
|
+
*/
|
|
22
|
+
export declare function destructiveWord(label: string, extra?: readonly string[]): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Why a request looks destructive, or `undefined` (ADR 0024 section 5, request layer, interim): any `DELETE`, and
|
|
25
|
+
* any request whose path, decoded to a fixed point, holds a destructive word as whole tokens, including a
|
|
26
|
+
* side-effecting `GET` (`/items/12/delete`). `HEAD` and `OPTIONS` never are. The query string is not read.
|
|
27
|
+
*
|
|
28
|
+
* @param extra the repo's `target.destructiveWords`.
|
|
29
|
+
* @returns the method (`DELETE`), the matched word, or `unreadable URL` for a URL that does not parse.
|
|
30
|
+
* @remarks Interim: the ADR's stored `destructiveConfirm` entries and the run ledger, which authorise a write on a
|
|
31
|
+
* record the run created, are not built yet, so a plain create or update (`POST /items`, `PUT /items/12`) passes,
|
|
32
|
+
* as the label guard lets "Lưu" and "Tạo" pass.
|
|
33
|
+
*/
|
|
34
|
+
export declare function destructiveRequest(method: string, url: string, extra?: readonly string[]): string | undefined;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Words that make an action control destructive (ADR 0024 section 5, interim matcher): it deletes, approves,
|
|
3
|
+
* rejects, pays or otherwise changes data that is not the run's own. Lowercase NFC; a multi-word entry matches
|
|
4
|
+
* consecutive tokens. Creating and saving are not listed: exploring a create flow on a shared env is the point.
|
|
5
|
+
*
|
|
6
|
+
* @remarks Both Vietnamese tone placements are listed (`xoá` and `xóa`). `huỷ`/`hủy` and `đặt lại`/`reset` are
|
|
7
|
+
* not listed, because they label every dialog's close button and every filter's reset button.
|
|
8
|
+
*/
|
|
9
|
+
export const DESTRUCTIVE_WORDS = [
|
|
10
|
+
'delete',
|
|
11
|
+
'remove',
|
|
12
|
+
'destroy',
|
|
13
|
+
'purge',
|
|
14
|
+
'erase',
|
|
15
|
+
'wipe',
|
|
16
|
+
'revoke',
|
|
17
|
+
'approve',
|
|
18
|
+
'reject',
|
|
19
|
+
'decline',
|
|
20
|
+
'terminate',
|
|
21
|
+
'deactivate',
|
|
22
|
+
'disable',
|
|
23
|
+
'archive',
|
|
24
|
+
'pay',
|
|
25
|
+
'refund',
|
|
26
|
+
'transfer',
|
|
27
|
+
'void',
|
|
28
|
+
'xoá',
|
|
29
|
+
'xóa',
|
|
30
|
+
'duyệt',
|
|
31
|
+
'từ chối',
|
|
32
|
+
'khoá',
|
|
33
|
+
'khóa',
|
|
34
|
+
'vô hiệu',
|
|
35
|
+
'thanh toán',
|
|
36
|
+
'chuyển khoản',
|
|
37
|
+
'hoàn tiền',
|
|
38
|
+
'thu hồi',
|
|
39
|
+
'chấm dứt',
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Phrases that contain a destructive word but name the run's own action or a label, not a destructive one:
|
|
43
|
+
* submitting one's own request for approval, an approver field, a status, a search keyword. Their tokens are
|
|
44
|
+
* removed before matching.
|
|
45
|
+
*/
|
|
46
|
+
export const SAFE_PHRASES = [
|
|
47
|
+
'gửi duyệt',
|
|
48
|
+
'gửi phê duyệt',
|
|
49
|
+
'trình duyệt',
|
|
50
|
+
'người duyệt',
|
|
51
|
+
'người phê duyệt',
|
|
52
|
+
'chờ duyệt',
|
|
53
|
+
'chờ phê duyệt',
|
|
54
|
+
'đã duyệt',
|
|
55
|
+
'từ khoá',
|
|
56
|
+
'từ khóa',
|
|
57
|
+
];
|
|
58
|
+
/** Tokens of `text`: NFC, split on a lowercase-to-uppercase change and on anything that is not a letter or digit. */
|
|
59
|
+
const tokens = (text) => text
|
|
60
|
+
.normalize('NFC')
|
|
61
|
+
.replace(/([\p{Ll}\p{N}])(\p{Lu})/gu, '$1 $2')
|
|
62
|
+
.toLowerCase()
|
|
63
|
+
.split(/[^\p{L}\p{M}\p{N}]+/u)
|
|
64
|
+
.filter((t) => t !== '');
|
|
65
|
+
const WORDS = DESTRUCTIVE_WORDS.map(tokens);
|
|
66
|
+
const SAFE = SAFE_PHRASES.map(tokens);
|
|
67
|
+
const at = (t, w, i) => w.every((part, j) => t[i + j] === part);
|
|
68
|
+
/**
|
|
69
|
+
* The destructive word `label` contains as whole tokens (so "Resend" is not "send", and "Xoá?" is "xoá"), once
|
|
70
|
+
* the {@link SAFE_PHRASES} are removed; or `undefined`.
|
|
71
|
+
*
|
|
72
|
+
* @param extra the repo's `target.destructiveWords`, matched like the core list; they only add words.
|
|
73
|
+
*/
|
|
74
|
+
export function destructiveWord(label, extra = []) {
|
|
75
|
+
const t = tokens(label);
|
|
76
|
+
for (const s of SAFE)
|
|
77
|
+
for (let i = 0; i + s.length <= t.length; i++)
|
|
78
|
+
if (at(t, s, i))
|
|
79
|
+
t.splice(i, s.length, '');
|
|
80
|
+
for (const w of [...WORDS, ...extra.map(tokens).filter((x) => x.length > 0)])
|
|
81
|
+
for (let i = 0; i + w.length <= t.length; i++)
|
|
82
|
+
if (at(t, w, i))
|
|
83
|
+
return w.join(' ');
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
/** Decodes percent-escapes until the path stops changing (at most 4 rounds); a malformed escape stops decoding. */
|
|
87
|
+
const decoded = (path) => {
|
|
88
|
+
let p = path;
|
|
89
|
+
for (let i = 0; i < 4; i++) {
|
|
90
|
+
try {
|
|
91
|
+
const next = decodeURIComponent(p);
|
|
92
|
+
if (next === p)
|
|
93
|
+
return p;
|
|
94
|
+
p = next;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return p;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return p;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Why a request looks destructive, or `undefined` (ADR 0024 section 5, request layer, interim): any `DELETE`, and
|
|
104
|
+
* any request whose path, decoded to a fixed point, holds a destructive word as whole tokens, including a
|
|
105
|
+
* side-effecting `GET` (`/items/12/delete`). `HEAD` and `OPTIONS` never are. The query string is not read.
|
|
106
|
+
*
|
|
107
|
+
* @param extra the repo's `target.destructiveWords`.
|
|
108
|
+
* @returns the method (`DELETE`), the matched word, or `unreadable URL` for a URL that does not parse.
|
|
109
|
+
* @remarks Interim: the ADR's stored `destructiveConfirm` entries and the run ledger, which authorise a write on a
|
|
110
|
+
* record the run created, are not built yet, so a plain create or update (`POST /items`, `PUT /items/12`) passes,
|
|
111
|
+
* as the label guard lets "Lưu" and "Tạo" pass.
|
|
112
|
+
*/
|
|
113
|
+
export function destructiveRequest(method, url, extra = []) {
|
|
114
|
+
const m = method.toUpperCase();
|
|
115
|
+
if (m === 'HEAD' || m === 'OPTIONS')
|
|
116
|
+
return undefined;
|
|
117
|
+
if (m === 'DELETE')
|
|
118
|
+
return 'DELETE';
|
|
119
|
+
let path;
|
|
120
|
+
try {
|
|
121
|
+
path = new URL(url).pathname;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return 'unreadable URL';
|
|
125
|
+
}
|
|
126
|
+
return destructiveWord(decoded(path), extra);
|
|
127
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Locator, Page } from 'playwright';
|
|
2
|
+
import type { Loc, Step, TemplatedValue } from '../flow/index.js';
|
|
3
|
+
export { StepError } from '../foundation/index.js';
|
|
4
|
+
export type { StepErrorKind } from '../foundation/index.js';
|
|
5
|
+
export interface ExecOptions {
|
|
6
|
+
testIdAttribute: string;
|
|
7
|
+
/** How long to wait for a target to become visible. */
|
|
8
|
+
timeout: number;
|
|
9
|
+
/** The flows directory: `upload` files are read from its `fixtures/` folder (ADR 0024 section 1a). */
|
|
10
|
+
flowsRoot: string;
|
|
11
|
+
/** The run's secret input values: a `fill` of one is typed without leaving the value in the trace (ADR 0030). */
|
|
12
|
+
secrets?: readonly string[];
|
|
13
|
+
}
|
|
14
|
+
/** A step {@link perform} runs on a page: profile switches and navigation belong to the run. */
|
|
15
|
+
export type Performable = Exclude<Step, {
|
|
16
|
+
kind: 'as' | 'goto';
|
|
17
|
+
}>;
|
|
18
|
+
/** What an action needs to run on the active page of a run (`RunSession.ctx()`). */
|
|
19
|
+
export interface ActContext {
|
|
20
|
+
page: Page;
|
|
21
|
+
values: Record<string, string>;
|
|
22
|
+
exec: ExecOptions;
|
|
23
|
+
/** Values the run expanded from templates (the uid, templated inputs), so recorded names can be templated back. */
|
|
24
|
+
templated: TemplatedValue[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Narrows a locator to visible elements, so a hidden copy (a responsive layout's mobile twin) neither
|
|
28
|
+
* makes a match ambiguous nor hides the visible one.
|
|
29
|
+
*/
|
|
30
|
+
export declare const visibleOnly: (l: Locator) => Locator;
|
|
31
|
+
/**
|
|
32
|
+
* Waits for the target, then insists on exactly one visible match: replay never guesses between
|
|
33
|
+
* candidates.
|
|
34
|
+
*
|
|
35
|
+
* @throws {StepError} `not_found` when no visible element appears within `timeout`, `ambiguous`
|
|
36
|
+
* when more than one visible element matches.
|
|
37
|
+
*/
|
|
38
|
+
export declare function unique(page: Page, loc: Loc, o: Pick<ExecOptions, 'testIdAttribute' | 'timeout'>): Promise<Locator>;
|
|
39
|
+
/**
|
|
40
|
+
* Performs one recorded step on `page`, then waits for `domcontentloaded`.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* - Targets must match exactly one visible element ({@link unique}).
|
|
44
|
+
* - `fill` re-fills until the value survives a re-render (fields that re-mount or reformat).
|
|
45
|
+
* - `fill` on a `combobox` types key by key with a delay: search comboboxes often react to key
|
|
46
|
+
* events only and drop characters when text is inserted at once.
|
|
47
|
+
* - `select` uses the native option on `<select>`, otherwise opens the combobox and clicks the
|
|
48
|
+
* option named like the value (Radix-style).
|
|
49
|
+
* @throws {StepError} `not_found` / `ambiguous` for the target, `action_failed` for a missing input
|
|
50
|
+
* value or any Playwright failure (first line of its message).
|
|
51
|
+
* @throws {FlowError} for an `upload` path that is not a plain file under `fixtures/` in the flows directory.
|
|
52
|
+
* @see docs/adr/0009-locator-strategy.md
|
|
53
|
+
*/
|
|
54
|
+
export declare function perform(page: Page, step: Performable, values: Record<string, string>, o: ExecOptions): Promise<void>;
|