@zhivex-ai/harness 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -2
- package/README.md +17 -5
- package/SECURITY.md +1 -1
- package/SUPPORT.md +2 -2
- package/benchmarks/README.md +26 -0
- package/contracts/engine-api.json +1557 -0
- package/contracts/public-api.json +114 -0
- package/contracts/stable-api-signatures.json +17 -17
- package/dist/acp-cli.js +37 -1090
- package/dist/application/agenda.d.ts +10 -0
- package/dist/application/approval-review.d.ts +61 -0
- package/dist/application/assistant/automation/scheduler.d.ts +21 -0
- package/dist/application/assistant/automation/summary.d.ts +29 -0
- package/dist/application/assistant/automation/time.d.ts +10 -0
- package/dist/application/assistant/calendar/calendar.d.ts +238 -0
- package/dist/application/assistant/calendar/connection.d.ts +50 -0
- package/dist/application/assistant/calendar/create-event.d.ts +75 -0
- package/dist/application/assistant/calendar/environment.d.ts +2 -0
- package/dist/application/assistant/calendar/http.d.ts +6 -0
- package/dist/application/assistant/calendar/oauth.d.ts +68 -0
- package/dist/application/assistant/calendar/store.d.ts +11 -0
- package/dist/application/assistant/calendar/tools.d.ts +78 -0
- package/dist/application/assistant/client.d.ts +10 -0
- package/dist/application/assistant/config.d.ts +9 -0
- package/dist/application/assistant/contracts.d.ts +77 -0
- package/dist/application/assistant/daily/service.d.ts +181 -0
- package/dist/application/assistant/doctor.d.ts +22 -0
- package/dist/application/assistant/evaluation.d.ts +81 -0
- package/dist/application/assistant/host.d.ts +399 -0
- package/dist/application/assistant/integrations/google.d.ts +117 -0
- package/dist/application/assistant/integrations/public-web.d.ts +16 -0
- package/dist/application/assistant/managed/secrets.d.ts +10 -0
- package/dist/application/assistant/managed/setup-state.d.ts +346 -0
- package/dist/application/assistant/managed/setup.d.ts +492 -0
- package/dist/application/assistant/microsoft/connection.d.ts +73 -0
- package/dist/application/assistant/microsoft/tools.d.ts +78 -0
- package/dist/application/assistant/modules/calendar.d.ts +3 -0
- package/dist/application/assistant/modules/catalog.d.ts +38 -0
- package/dist/application/assistant/modules/daily.d.ts +5 -0
- package/dist/application/assistant/modules/github.d.ts +5 -0
- package/dist/application/assistant/modules/google.d.ts +3 -0
- package/dist/application/assistant/modules/mcp.d.ts +11 -0
- package/dist/application/assistant/modules/microsoft.d.ts +3 -0
- package/dist/application/assistant/modules/module.d.ts +224 -0
- package/dist/application/assistant/modules/tools.d.ts +11 -0
- package/dist/application/assistant/modules/web.d.ts +7 -0
- package/dist/application/assistant/private-directory.d.ts +3 -0
- package/dist/application/assistant/proactive/service.d.ts +142 -0
- package/dist/application/assistant/providers/openai-compatible.d.ts +66 -0
- package/dist/application/assistant/providers/provider.d.ts +141 -0
- package/dist/application/assistant/providers/web-citations.d.ts +2 -0
- package/dist/application/assistant/runtime.d.ts +16 -0
- package/dist/application/assistant/task-metrics.d.ts +304 -0
- package/dist/application/assistant/telegram/api.d.ts +47 -0
- package/dist/application/assistant/telegram/bridge.d.ts +69 -0
- package/dist/application/assistant/telegram/store.d.ts +10 -0
- package/dist/application/automation.d.ts +5 -0
- package/dist/application/calendar-review.d.ts +5 -0
- package/dist/application/checkpoint-review.d.ts +30 -0
- package/dist/application/client.d.ts +18 -0
- package/dist/application/code/context.d.ts +5 -0
- package/dist/application/code/delivery.d.ts +6 -0
- package/dist/application/code/git-delivery.d.ts +54 -0
- package/dist/application/code/github-git-transport.d.ts +15 -0
- package/dist/application/code/github-pr-transport.d.ts +6 -0
- package/dist/application/code/host.d.ts +25 -0
- package/dist/application/code/pr-delivery.d.ts +79 -0
- package/dist/application/code/projects.d.ts +90 -0
- package/dist/application/code/remote-delivery.d.ts +80 -0
- package/dist/application/code/repository.d.ts +9 -0
- package/dist/application/code/worktrees.d.ts +123 -0
- package/dist/application/contracts.d.ts +288 -0
- package/dist/application/coordinator-client.d.ts +33 -0
- package/dist/application/coordinator-discovery.d.ts +17 -0
- package/dist/application/coordinator-launcher.d.ts +2 -0
- package/dist/application/coordinator.d.ts +27 -0
- package/dist/application/credential-process.d.ts +13 -0
- package/dist/application/host.d.ts +7 -0
- package/dist/application/management.d.ts +68 -0
- package/dist/application/notes.d.ts +5 -0
- package/dist/application/offline-migration.d.ts +16 -0
- package/dist/application/personal-state.d.ts +5 -0
- package/dist/application/review-channel.d.ts +23 -0
- package/dist/application/review-tickets.d.ts +29 -0
- package/dist/application/runtime-binding.d.ts +4 -0
- package/dist/application-cli-wfh08g41.js +184 -0
- package/dist/application-cli-z3f9pvcf.js +209 -0
- package/dist/approvals/auto-approve.d.ts +1 -1
- package/dist/arguments-75r85mvc.js +27 -0
- package/dist/arguments-x24bbqvd.js +22 -0
- package/dist/audit/index.js +16 -472
- package/dist/audit-pack-1gnych0m.js +93 -0
- package/dist/{audit-pack-y02n8zd0.js → audit-pack-h44kjkbj.js} +17 -11
- package/dist/calendar-2xw0rr7b.js +49 -0
- package/dist/cli/application-cli.d.ts +2 -0
- package/dist/cli/arguments.d.ts +14 -1
- package/dist/cli/auto-approve-setup.d.ts +13 -0
- package/dist/cli/configured-harness.d.ts +1 -2
- package/dist/cli/console/console-budget.d.ts +16 -2
- package/dist/cli/console/console-checkpoints.d.ts +12 -0
- package/dist/cli/console/console-commands.d.ts +3 -3
- package/dist/cli/console/console-compaction.d.ts +1 -1
- package/dist/cli/console/console-diff.d.ts +2 -0
- package/dist/cli/console/console-input.d.ts +29 -1
- package/dist/cli/console/console-navigation.d.ts +2 -2
- package/dist/cli/console/console-outcome.d.ts +10 -0
- package/dist/cli/console/console-presentation.d.ts +17 -2
- package/dist/cli/console/console-pricing.d.ts +14 -0
- package/dist/cli/console/console-reasoning.d.ts +1 -1
- package/dist/cli/console/console-recovery.d.ts +2 -0
- package/dist/cli/console/console-review.d.ts +34 -0
- package/dist/cli/console/console-run-policy.d.ts +5 -0
- package/dist/cli/console/console-run-view.d.ts +28 -0
- package/dist/cli/console/console-task.d.ts +30 -0
- package/dist/cli/console/console-welcome.d.ts +13 -3
- package/dist/cli/console/review-diff.d.ts +20 -0
- package/dist/cli/presentation.d.ts +8 -6
- package/dist/cli/service-checkpoints.d.ts +234 -0
- package/dist/cli/terminal/activity-history.d.ts +4 -2
- package/dist/cli/terminal/activity-stream.d.ts +33 -0
- package/dist/cli/terminal/file-diff.d.ts +11 -0
- package/dist/cli/terminal/terminal-theme.d.ts +9 -0
- package/dist/cli/terminal/terminal-ui.d.ts +44 -2
- package/dist/cli/terminal/tool-activity.d.ts +6 -2
- package/dist/{cli-entry-hdtfef27.js → cli-entry-68kqraj7.js} +95 -43
- package/dist/{cli-entry-j6jcb2jb.js → cli-entry-86rcbmwh.js} +294 -14
- package/dist/cli-entry-btkpb4h1.js +3627 -0
- package/dist/cli-entry-bxjbs6qq.js +200 -0
- package/dist/cli-entry-cpm89r9q.js +624 -0
- package/dist/{cli-entry-v5db3eb2.js → cli-entry-dksm56sj.js} +39 -297
- package/dist/{cli-entry-td04s0fa.js → cli-entry-eka68ttb.js} +3919 -4549
- package/dist/cli-entry-h7dcah4p.js +137 -0
- package/dist/cli-entry-kwk23ktq.js +33 -0
- package/dist/{cli-entry-ynahz9qc.js → cli-entry-vmce694z.js} +1251 -3139
- package/dist/cli-entry-wanv05db.js +1113 -0
- package/dist/{cli-zw18kdqx.js → cli-z7vhm1rk.js} +1767 -380
- package/dist/cli.js +8 -6
- package/dist/client/json-contracts.d.ts +153 -0
- package/dist/client/local-service.d.ts +7 -12
- package/dist/client/local-transport.d.ts +14 -0
- package/dist/client/protocol.d.ts +43 -1
- package/dist/compat/cli-options.d.ts +7 -1
- package/dist/compat/cli.d.ts +2 -0
- package/dist/compat/cli.js +4043 -0
- package/dist/compat/code-support.d.ts +3 -0
- package/dist/compat/code-support.js +50 -28
- package/dist/{config-r9fdhce6.js → config-hw78440t.js} +5 -5
- package/dist/{config-vyajmksy.js → config-v7s8hp37.js} +1 -1
- package/dist/context/adaptive-compaction.d.ts +1 -0
- package/dist/context/lossless-lines.d.ts +13 -0
- package/dist/context/numbered-read-lines.d.ts +15 -0
- package/dist/context/read-attempts.d.ts +21 -0
- package/dist/context/request-projection.d.ts +32 -4
- package/dist/context/scoped-context.d.ts +14 -0
- package/dist/context/working-read-replay.d.ts +12 -0
- package/dist/coordinator-client-nzysqxf0.js +10 -0
- package/dist/engine/acp.js +27 -21
- package/dist/engine/application-client.d.ts +11 -0
- package/dist/engine/application-client.js +18 -0
- package/dist/engine/application-protocol.d.ts +5 -0
- package/dist/engine/application-protocol.js +7 -0
- package/dist/engine/application.d.ts +43 -0
- package/dist/engine/application.js +206 -0
- package/dist/engine/assistant/automation/scheduler.d.ts +2 -0
- package/dist/engine/assistant/automation/scheduler.js +11 -0
- package/dist/engine/assistant/automation/summary.d.ts +3 -0
- package/dist/engine/assistant/automation/summary.js +8 -0
- package/dist/engine/assistant/automation/time.d.ts +5 -0
- package/dist/engine/assistant/automation/time.js +15 -0
- package/dist/engine/assistant/calendar/calendar.d.ts +5 -0
- package/dist/engine/assistant/calendar/calendar.js +12 -0
- package/dist/engine/assistant/calendar/connection.d.ts +2 -0
- package/dist/engine/assistant/calendar/connection.js +11 -0
- package/dist/engine/assistant/calendar/environment.d.ts +1 -0
- package/dist/engine/assistant/calendar/environment.js +7 -0
- package/dist/engine/assistant/calendar/http.d.ts +3 -0
- package/dist/engine/assistant/calendar/http.js +9 -0
- package/dist/engine/assistant/calendar/oauth.d.ts +5 -0
- package/dist/engine/assistant/calendar/oauth.js +12 -0
- package/dist/engine/assistant/calendar/store.d.ts +2 -0
- package/dist/engine/assistant/calendar/store.js +8 -0
- package/dist/engine/assistant/calendar/tools.d.ts +2 -0
- package/dist/engine/assistant/calendar/tools.js +46 -0
- package/dist/engine/assistant/client.d.ts +2 -0
- package/dist/engine/assistant/client.js +33 -0
- package/dist/engine/assistant/config.d.ts +1 -0
- package/dist/engine/assistant/config.js +102 -0
- package/dist/engine/assistant/contracts.d.ts +10 -0
- package/dist/engine/assistant/contracts.js +78 -0
- package/dist/engine/assistant/daily/service.d.ts +12 -0
- package/dist/engine/assistant/daily/service.js +27 -0
- package/dist/engine/assistant/doctor.d.ts +1 -0
- package/dist/engine/assistant/doctor.js +116 -0
- package/dist/engine/assistant/evaluation.d.ts +2 -0
- package/dist/engine/assistant/evaluation.js +76 -0
- package/dist/engine/assistant/host.d.ts +2 -0
- package/dist/engine/assistant/host.js +63 -0
- package/dist/engine/assistant/integrations/google.d.ts +9 -0
- package/dist/engine/assistant/integrations/google.js +30 -0
- package/dist/engine/assistant/integrations/public-web.d.ts +3 -0
- package/dist/engine/assistant/integrations/public-web.js +11 -0
- package/dist/engine/assistant/managed/secrets.d.ts +1 -0
- package/dist/engine/assistant/managed/secrets.js +0 -0
- package/dist/engine/assistant/managed/setup-state.d.ts +11 -0
- package/dist/engine/assistant/managed/setup-state.js +84 -0
- package/dist/engine/assistant/managed/setup.d.ts +3 -0
- package/dist/engine/assistant/managed/setup.js +85 -0
- package/dist/engine/assistant/microsoft/connection.d.ts +7 -0
- package/dist/engine/assistant/microsoft/connection.js +21 -0
- package/dist/engine/assistant/microsoft/tools.d.ts +8 -0
- package/dist/engine/assistant/microsoft/tools.js +30 -0
- package/dist/engine/assistant/modules/calendar.d.ts +1 -0
- package/dist/engine/assistant/modules/calendar.js +49 -0
- package/dist/engine/assistant/modules/catalog.d.ts +3 -0
- package/dist/engine/assistant/modules/catalog.js +67 -0
- package/dist/engine/assistant/modules/daily.d.ts +1 -0
- package/dist/engine/assistant/modules/daily.js +48 -0
- package/dist/engine/assistant/modules/github.d.ts +1 -0
- package/dist/engine/assistant/modules/github.js +43 -0
- package/dist/engine/assistant/modules/google.d.ts +1 -0
- package/dist/engine/assistant/modules/google.js +53 -0
- package/dist/engine/assistant/modules/mcp.d.ts +1 -0
- package/dist/engine/assistant/modules/mcp.js +42 -0
- package/dist/engine/assistant/modules/microsoft.d.ts +1 -0
- package/dist/engine/assistant/modules/microsoft.js +53 -0
- package/dist/engine/assistant/modules/module.d.ts +5 -0
- package/dist/engine/assistant/modules/module.js +42 -0
- package/dist/engine/assistant/modules/tools.d.ts +2 -0
- package/dist/engine/assistant/modules/tools.js +42 -0
- package/dist/engine/assistant/modules/web.d.ts +1 -0
- package/dist/engine/assistant/modules/web.js +45 -0
- package/dist/engine/assistant/private-directory.d.ts +1 -0
- package/dist/engine/assistant/private-directory.js +7 -0
- package/dist/engine/assistant/proactive/service.d.ts +6 -0
- package/dist/engine/assistant/proactive/service.js +16 -0
- package/dist/engine/assistant/providers/openai-compatible.d.ts +4 -0
- package/dist/engine/assistant/providers/openai-compatible.js +12 -0
- package/dist/engine/assistant/providers/provider.d.ts +7 -0
- package/dist/engine/assistant/providers/provider.js +54 -0
- package/dist/engine/assistant/providers/web-citations.d.ts +1 -0
- package/dist/engine/assistant/providers/web-citations.js +7 -0
- package/dist/engine/assistant/runtime.d.ts +2 -0
- package/dist/engine/assistant/runtime.js +73 -0
- package/dist/engine/assistant/task-metrics.d.ts +8 -0
- package/dist/engine/assistant/task-metrics.js +17 -0
- package/dist/engine/assistant/telegram/api.d.ts +5 -0
- package/dist/engine/assistant/telegram/api.js +11 -0
- package/dist/engine/assistant/telegram/bridge.d.ts +2 -0
- package/dist/engine/assistant/telegram/bridge.js +40 -0
- package/dist/engine/assistant/telegram/store.d.ts +2 -0
- package/dist/engine/assistant/telegram/store.js +8 -0
- package/dist/engine/client.js +26 -18
- package/dist/engine/desktop-providers-v1.js +4 -4
- package/dist/engine/desktop-state-v1.js +16 -13
- package/dist/engine/index.js +111 -159
- package/dist/engine/mcp-stdio-v1.js +13 -12
- package/dist/engine/models.js +65 -23
- package/dist/engine/protocol.js +10 -6
- package/dist/engine/service.js +32 -21
- package/dist/hostile-repository-demo.js +1822 -696
- package/dist/index-09rsdr2d.js +1744 -0
- package/dist/index-0csc5sc7.js +139 -0
- package/dist/{index-v86bh0eg.js → index-0dkty795.js} +8 -6
- package/dist/index-0kkgqvg7.js +0 -0
- package/dist/index-0mzz9axm.js +58 -0
- package/dist/index-1e69ar8r.js +38 -0
- package/dist/index-1z0xhkh9.js +18 -0
- package/dist/index-2cef1k92.js +356 -0
- package/dist/{index-k1a1xesg.js → index-2j0v1xwr.js} +17 -13
- package/dist/index-2jw9jd7h.js +116 -0
- package/dist/index-2n9qx4km.js +0 -0
- package/dist/index-3rvk23e8.js +877 -0
- package/dist/index-3wa4j0yk.js +71 -0
- package/dist/index-41q1k17x.js +210 -0
- package/dist/index-4vz4bqqw.js +33 -0
- package/dist/index-5jxm2wy5.js +123 -0
- package/dist/index-5rk6ss42.js +216 -0
- package/dist/index-5v1skxf7.js +1852 -0
- package/dist/{index-qz4fs9f9.js → index-6ehtssyz.js} +355 -332
- package/dist/index-76kpdbpw.js +80 -0
- package/dist/{index-r0q0r88h.js → index-7nbmhmw5.js} +10 -10
- package/dist/index-8mx0yrkz.js +31 -0
- package/dist/index-8tjev5ds.js +11 -0
- package/dist/index-91n5wr6s.js +163 -0
- package/dist/index-91trs3ew.js +151 -0
- package/dist/index-9y8p5vy5.js +222 -0
- package/dist/index-abxahprd.js +55 -0
- package/dist/index-aptyr511.js +84 -0
- package/dist/{index-8sm2a1wa.js → index-ay26xfxt.js} +28 -20
- package/dist/index-b4yed1s3.js +657 -0
- package/dist/index-bb7phvtg.js +23 -0
- package/dist/index-bk5tn9b8.js +236 -0
- package/dist/index-bw34861c.js +292 -0
- package/dist/index-c6fnjhgv.js +55 -0
- package/dist/{index-qfsrrnz6.js → index-cjevq9s8.js} +2 -2
- package/dist/{index-c39197wq.js → index-ctcwrkrc.js} +4 -4
- package/dist/{index-yx52bt4a.js → index-cztmcesv.js} +2 -2
- package/dist/index-dpbmxnrf.js +564 -0
- package/dist/index-ekxdcy36.js +134 -0
- package/dist/index-f8zpcsx3.js +289 -0
- package/dist/{index-6dxrbnxm.js → index-f970qtb4.js} +7 -143
- package/dist/index-fatcn6fp.js +2791 -0
- package/dist/index-fbzykqxy.js +105 -0
- package/dist/{index-1265j7t2.js → index-fwf274vc.js} +24 -14
- package/dist/index-fy4w0a7v.js +0 -0
- package/dist/index-gvva3e5x.js +76 -0
- package/dist/index-h7dcah4p.js +137 -0
- package/dist/index-hm9r120s.js +42 -0
- package/dist/index-j3d2tw97.js +328 -0
- package/dist/index-jfqj20x8.js +41 -0
- package/dist/{index-yp0jtaxp.js → index-k529a278.js} +6 -6
- package/dist/{index-bt2p8x7r.js → index-kbrf5bx7.js} +110 -106
- package/dist/index-kwk23ktq.js +33 -0
- package/dist/index-kz857p1j.js +557 -0
- package/dist/{index-tc2r2n8b.js → index-mkt5yrax.js} +31 -105
- package/dist/{index-tgt8gtq7.js → index-ndgnvjez.js} +18 -18
- package/dist/index-nemn4epv.js +43 -0
- package/dist/index-nkwy5bjr.js +1225 -0
- package/dist/index-nvvzr4ny.js +136 -0
- package/dist/index-pkspzsfs.js +78 -0
- package/dist/{index-fm84men1.js → index-px1tnqgt.js} +2 -2
- package/dist/index-q7qdw883.js +79 -0
- package/dist/{index-mzydbzp8.js → index-qvbg6tx1.js} +65 -23
- package/dist/index-r3mwr5fb.js +0 -0
- package/dist/index-rdr78m0k.js +91 -0
- package/dist/index-rtamqsfs.js +59 -0
- package/dist/index-s125ss45.js +38 -0
- package/dist/{index-h8r80xhk.js → index-sx1t6dnd.js} +4005 -2781
- package/dist/index-tar0ngkm.js +359 -0
- package/dist/index-tn58cr6w.js +471 -0
- package/dist/{index-v17e1xs8.js → index-v79s9bf9.js} +96 -23
- package/dist/index-vk3rq21m.js +17 -0
- package/dist/index-vmvnr28y.js +72 -0
- package/dist/index-vz629cg8.js +49 -0
- package/dist/{index-eps3c3g6.js → index-w292hdpz.js} +197 -960
- package/dist/{index-t6sjhxh8.js → index-w9eqg6p9.js} +24 -302
- package/dist/index-wj96kdw2.js +57 -0
- package/dist/index-wyck5yhd.js +141 -0
- package/dist/index-xvtk8pxs.js +674 -0
- package/dist/{index-bpc596v3.js → index-xwb691v9.js} +2 -2
- package/dist/index-ym69x168.js +518 -0
- package/dist/index-yprdjk9v.js +65 -0
- package/dist/index-z2a81ccr.js +35 -0
- package/dist/{index-3ah1f369.js → index-z69cqk74.js} +3 -3
- package/dist/index-zaakvmzq.js +62 -0
- package/dist/index-zk3m4mzg.js +232 -0
- package/dist/index-zx3wgvx4.js +218 -0
- package/dist/index.js +102 -83
- package/dist/persistence/migration-guard.d.ts +3 -0
- package/dist/runtime/harness.d.ts +2 -0
- package/dist/service-cli.js +130 -40
- package/dist/service-client-cli-2rzxy5mj.js +1166 -0
- package/dist/service-client-cli-5ne8q5ej.js +543 -0
- package/dist/tools/ooxml-zip.d.ts +21 -0
- package/dist/tools/presentations.d.ts +47 -0
- package/dist/tools/tabular-data.d.ts +114 -0
- package/dist/tools/workspace.d.ts +76 -0
- package/dist/verify-historical-migrations.js +1923 -797
- package/dist/workspace/workspace.d.ts +13 -1
- package/dist/zhx.js +8 -6
- package/docs/APPLICATION_MIGRATION.md +32 -0
- package/docs/CLI.md +166 -2
- package/docs/CODE_RELEASE.md +5 -3
- package/docs/CODE_WEB_TASKS.md +3 -114
- package/docs/CONTEXT_ENGINEERING.md +27 -0
- package/docs/ENGINE_API.md +1 -1
- package/docs/EXTENSIBILITY.md +1 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/INTERNAL_ARCHIVE.md +43 -0
- package/docs/LOCAL_SERVICE.md +1 -1
- package/docs/MODEL_CATALOG.md +14 -0
- package/docs/README.md +13 -2
- package/evaluations/representative-assembly-matrix.json +10 -1
- package/examples/README.md +3 -3
- package/examples/assistant/compatible-calendar.json +17 -0
- package/examples/assistant/composed-modules.json +23 -0
- package/examples/assistant/connected-tools.json +9 -0
- package/examples/assistant/daily-tools.json +6 -0
- package/examples/assistant/offline.mjs +24 -0
- package/fixtures/cli-compatibility/README.md +10 -0
- package/fixtures/cli-compatibility/inventory.json +7858 -0
- package/package.json +230 -28
- package/dist/cli/console/console-model-catalog.d.ts +0 -8
- package/dist/index-4gt045j0.js +0 -288
- package/dist/index-4jw3tvy8.js +0 -301
- package/dist/index-ebb5d4s3.js +0 -640
- package/dist/index-x9hv1a34.js +0 -274
- package/dist/service-client-cli-gtk26axb.js +0 -1251
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const taskMetricsPricingSchema: z.ZodObject<{
|
|
3
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
4
|
+
prices: z.ZodArray<z.ZodObject<{
|
|
5
|
+
provider: z.ZodString;
|
|
6
|
+
model: z.ZodString;
|
|
7
|
+
inputUsdPerMillion: z.ZodNumber;
|
|
8
|
+
outputUsdPerMillion: z.ZodNumber;
|
|
9
|
+
source: z.ZodString;
|
|
10
|
+
asOf: z.ZodString;
|
|
11
|
+
expiresAt: z.ZodString;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export declare const taskCategorySchema: z.ZodEnum<{
|
|
15
|
+
agenda: "agenda";
|
|
16
|
+
"calendar-change": "calendar-change";
|
|
17
|
+
"daily-summary": "daily-summary";
|
|
18
|
+
general: "general";
|
|
19
|
+
preferences: "preferences";
|
|
20
|
+
recovery: "recovery";
|
|
21
|
+
}>;
|
|
22
|
+
export declare const taskFeedbackSchema: z.ZodObject<{
|
|
23
|
+
taskId: z.ZodString;
|
|
24
|
+
expectedRevision: z.ZodString;
|
|
25
|
+
outcome: z.ZodEnum<{
|
|
26
|
+
abandoned: "abandoned";
|
|
27
|
+
failure: "failure";
|
|
28
|
+
success: "success";
|
|
29
|
+
unverified: "unverified";
|
|
30
|
+
}>;
|
|
31
|
+
category: z.ZodEnum<{
|
|
32
|
+
agenda: "agenda";
|
|
33
|
+
"calendar-change": "calendar-change";
|
|
34
|
+
"daily-summary": "daily-summary";
|
|
35
|
+
general: "general";
|
|
36
|
+
preferences: "preferences";
|
|
37
|
+
recovery: "recovery";
|
|
38
|
+
}>;
|
|
39
|
+
}, z.core.$strict>;
|
|
40
|
+
export declare const taskLinkSchema: z.ZodObject<{
|
|
41
|
+
taskId: z.ZodString;
|
|
42
|
+
runId: z.ZodString;
|
|
43
|
+
kind: z.ZodEnum<{
|
|
44
|
+
continuation: "continuation";
|
|
45
|
+
correction: "correction";
|
|
46
|
+
}>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
export declare const taskUsageSchema: z.ZodObject<{
|
|
49
|
+
calls: z.ZodNumber;
|
|
50
|
+
inputTokens: z.ZodNumber;
|
|
51
|
+
outputTokens: z.ZodNumber;
|
|
52
|
+
usageComplete: z.ZodBoolean;
|
|
53
|
+
estimatedUsd: z.ZodNullable<z.ZodNumber>;
|
|
54
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
provider: z.ZodString;
|
|
56
|
+
model: z.ZodString;
|
|
57
|
+
calls: z.ZodNumber;
|
|
58
|
+
inputTokens: z.ZodNumber;
|
|
59
|
+
outputTokens: z.ZodNumber;
|
|
60
|
+
unknownCalls: z.ZodNumber;
|
|
61
|
+
estimatedUsd: z.ZodNullable<z.ZodNumber>;
|
|
62
|
+
priceStatuses: z.ZodArray<z.ZodEnum<{
|
|
63
|
+
estimate: "estimate";
|
|
64
|
+
missing: "missing";
|
|
65
|
+
stale: "stale";
|
|
66
|
+
}>>;
|
|
67
|
+
}, z.core.$strip>>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
declare const runSchema: z.ZodObject<{
|
|
70
|
+
runId: z.ZodString;
|
|
71
|
+
sessionId: z.ZodString;
|
|
72
|
+
status: z.ZodString;
|
|
73
|
+
startedAt: z.ZodNumber;
|
|
74
|
+
updatedAt: z.ZodNumber;
|
|
75
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
76
|
+
calls: z.ZodNumber;
|
|
77
|
+
inputTokens: z.ZodNumber;
|
|
78
|
+
outputTokens: z.ZodNumber;
|
|
79
|
+
usageComplete: z.ZodBoolean;
|
|
80
|
+
estimatedUsd: z.ZodNullable<z.ZodNumber>;
|
|
81
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
provider: z.ZodString;
|
|
83
|
+
model: z.ZodString;
|
|
84
|
+
calls: z.ZodNumber;
|
|
85
|
+
inputTokens: z.ZodNumber;
|
|
86
|
+
outputTokens: z.ZodNumber;
|
|
87
|
+
unknownCalls: z.ZodNumber;
|
|
88
|
+
estimatedUsd: z.ZodNullable<z.ZodNumber>;
|
|
89
|
+
priceStatuses: z.ZodArray<z.ZodEnum<{
|
|
90
|
+
estimate: "estimate";
|
|
91
|
+
missing: "missing";
|
|
92
|
+
stale: "stale";
|
|
93
|
+
}>>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
export type TaskRunSnapshot = z.infer<typeof runSchema>;
|
|
98
|
+
/** Assistant-owned observations only. Never stores prompts, outputs, tool payloads or credentials. */
|
|
99
|
+
export declare function openTaskMetrics(directory: string, now?: () => number): Promise<{
|
|
100
|
+
observe(input: TaskRunSnapshot): void;
|
|
101
|
+
references: () => {
|
|
102
|
+
runId: string;
|
|
103
|
+
sessionId: string;
|
|
104
|
+
}[];
|
|
105
|
+
get: (taskId: string) => {
|
|
106
|
+
taskId: string;
|
|
107
|
+
revision: string;
|
|
108
|
+
category: "agenda" | "calendar-change" | "daily-summary" | "general" | "preferences" | "recovery";
|
|
109
|
+
outcome: "abandoned" | "failure" | "success" | "unverified";
|
|
110
|
+
verification: "operator" | null;
|
|
111
|
+
reviewedAt: number | null;
|
|
112
|
+
startedAt: number;
|
|
113
|
+
endedAt: number | null;
|
|
114
|
+
durationMs: number | null;
|
|
115
|
+
elapsedMs: number;
|
|
116
|
+
corrections: number;
|
|
117
|
+
runCount: number;
|
|
118
|
+
usageComplete: boolean;
|
|
119
|
+
inputTokens: number;
|
|
120
|
+
outputTokens: number;
|
|
121
|
+
estimatedUsd: number | null;
|
|
122
|
+
costComplete: boolean;
|
|
123
|
+
costKind: 'estimate-not-invoice';
|
|
124
|
+
runs: {
|
|
125
|
+
runId: string;
|
|
126
|
+
sessionId: string;
|
|
127
|
+
status: string;
|
|
128
|
+
startedAt: number;
|
|
129
|
+
updatedAt: number;
|
|
130
|
+
usage: {
|
|
131
|
+
calls: number;
|
|
132
|
+
inputTokens: number;
|
|
133
|
+
outputTokens: number;
|
|
134
|
+
usageComplete: boolean;
|
|
135
|
+
estimatedUsd: number | null;
|
|
136
|
+
routes?: {
|
|
137
|
+
provider: string;
|
|
138
|
+
model: string;
|
|
139
|
+
calls: number;
|
|
140
|
+
inputTokens: number;
|
|
141
|
+
outputTokens: number;
|
|
142
|
+
unknownCalls: number;
|
|
143
|
+
estimatedUsd: number | null;
|
|
144
|
+
priceStatuses: ("estimate" | "missing" | "stale")[];
|
|
145
|
+
}[] | undefined;
|
|
146
|
+
} | null;
|
|
147
|
+
kind: string;
|
|
148
|
+
}[];
|
|
149
|
+
};
|
|
150
|
+
link(input: unknown): {
|
|
151
|
+
taskId: string;
|
|
152
|
+
revision: string;
|
|
153
|
+
category: "agenda" | "calendar-change" | "daily-summary" | "general" | "preferences" | "recovery";
|
|
154
|
+
outcome: "abandoned" | "failure" | "success" | "unverified";
|
|
155
|
+
verification: "operator" | null;
|
|
156
|
+
reviewedAt: number | null;
|
|
157
|
+
startedAt: number;
|
|
158
|
+
endedAt: number | null;
|
|
159
|
+
durationMs: number | null;
|
|
160
|
+
elapsedMs: number;
|
|
161
|
+
corrections: number;
|
|
162
|
+
runCount: number;
|
|
163
|
+
usageComplete: boolean;
|
|
164
|
+
inputTokens: number;
|
|
165
|
+
outputTokens: number;
|
|
166
|
+
estimatedUsd: number | null;
|
|
167
|
+
costComplete: boolean;
|
|
168
|
+
costKind: 'estimate-not-invoice';
|
|
169
|
+
runs: {
|
|
170
|
+
runId: string;
|
|
171
|
+
sessionId: string;
|
|
172
|
+
status: string;
|
|
173
|
+
startedAt: number;
|
|
174
|
+
updatedAt: number;
|
|
175
|
+
usage: {
|
|
176
|
+
calls: number;
|
|
177
|
+
inputTokens: number;
|
|
178
|
+
outputTokens: number;
|
|
179
|
+
usageComplete: boolean;
|
|
180
|
+
estimatedUsd: number | null;
|
|
181
|
+
routes?: {
|
|
182
|
+
provider: string;
|
|
183
|
+
model: string;
|
|
184
|
+
calls: number;
|
|
185
|
+
inputTokens: number;
|
|
186
|
+
outputTokens: number;
|
|
187
|
+
unknownCalls: number;
|
|
188
|
+
estimatedUsd: number | null;
|
|
189
|
+
priceStatuses: ("estimate" | "missing" | "stale")[];
|
|
190
|
+
}[] | undefined;
|
|
191
|
+
} | null;
|
|
192
|
+
kind: string;
|
|
193
|
+
}[];
|
|
194
|
+
};
|
|
195
|
+
feedback(input: unknown): {
|
|
196
|
+
taskId: string;
|
|
197
|
+
revision: string;
|
|
198
|
+
category: "agenda" | "calendar-change" | "daily-summary" | "general" | "preferences" | "recovery";
|
|
199
|
+
outcome: "abandoned" | "failure" | "success" | "unverified";
|
|
200
|
+
verification: "operator" | null;
|
|
201
|
+
reviewedAt: number | null;
|
|
202
|
+
startedAt: number;
|
|
203
|
+
endedAt: number | null;
|
|
204
|
+
durationMs: number | null;
|
|
205
|
+
elapsedMs: number;
|
|
206
|
+
corrections: number;
|
|
207
|
+
runCount: number;
|
|
208
|
+
usageComplete: boolean;
|
|
209
|
+
inputTokens: number;
|
|
210
|
+
outputTokens: number;
|
|
211
|
+
estimatedUsd: number | null;
|
|
212
|
+
costComplete: boolean;
|
|
213
|
+
costKind: 'estimate-not-invoice';
|
|
214
|
+
runs: {
|
|
215
|
+
runId: string;
|
|
216
|
+
sessionId: string;
|
|
217
|
+
status: string;
|
|
218
|
+
startedAt: number;
|
|
219
|
+
updatedAt: number;
|
|
220
|
+
usage: {
|
|
221
|
+
calls: number;
|
|
222
|
+
inputTokens: number;
|
|
223
|
+
outputTokens: number;
|
|
224
|
+
usageComplete: boolean;
|
|
225
|
+
estimatedUsd: number | null;
|
|
226
|
+
routes?: {
|
|
227
|
+
provider: string;
|
|
228
|
+
model: string;
|
|
229
|
+
calls: number;
|
|
230
|
+
inputTokens: number;
|
|
231
|
+
outputTokens: number;
|
|
232
|
+
unknownCalls: number;
|
|
233
|
+
estimatedUsd: number | null;
|
|
234
|
+
priceStatuses: ("estimate" | "missing" | "stale")[];
|
|
235
|
+
}[] | undefined;
|
|
236
|
+
} | null;
|
|
237
|
+
kind: string;
|
|
238
|
+
}[];
|
|
239
|
+
};
|
|
240
|
+
report(): {
|
|
241
|
+
schemaVersion: 1;
|
|
242
|
+
generatedAt: number;
|
|
243
|
+
tasks: {
|
|
244
|
+
taskId: string;
|
|
245
|
+
revision: string;
|
|
246
|
+
category: "agenda" | "calendar-change" | "daily-summary" | "general" | "preferences" | "recovery";
|
|
247
|
+
outcome: "abandoned" | "failure" | "success" | "unverified";
|
|
248
|
+
verification: "operator" | null;
|
|
249
|
+
reviewedAt: number | null;
|
|
250
|
+
startedAt: number;
|
|
251
|
+
endedAt: number | null;
|
|
252
|
+
durationMs: number | null;
|
|
253
|
+
elapsedMs: number;
|
|
254
|
+
corrections: number;
|
|
255
|
+
runCount: number;
|
|
256
|
+
usageComplete: boolean;
|
|
257
|
+
inputTokens: number;
|
|
258
|
+
outputTokens: number;
|
|
259
|
+
estimatedUsd: number | null;
|
|
260
|
+
costComplete: boolean;
|
|
261
|
+
costKind: 'estimate-not-invoice';
|
|
262
|
+
runs: {
|
|
263
|
+
runId: string;
|
|
264
|
+
sessionId: string;
|
|
265
|
+
status: string;
|
|
266
|
+
startedAt: number;
|
|
267
|
+
updatedAt: number;
|
|
268
|
+
usage: {
|
|
269
|
+
calls: number;
|
|
270
|
+
inputTokens: number;
|
|
271
|
+
outputTokens: number;
|
|
272
|
+
usageComplete: boolean;
|
|
273
|
+
estimatedUsd: number | null;
|
|
274
|
+
routes?: {
|
|
275
|
+
provider: string;
|
|
276
|
+
model: string;
|
|
277
|
+
calls: number;
|
|
278
|
+
inputTokens: number;
|
|
279
|
+
outputTokens: number;
|
|
280
|
+
unknownCalls: number;
|
|
281
|
+
estimatedUsd: number | null;
|
|
282
|
+
priceStatuses: ("estimate" | "missing" | "stale")[];
|
|
283
|
+
}[] | undefined;
|
|
284
|
+
} | null;
|
|
285
|
+
kind: string;
|
|
286
|
+
}[];
|
|
287
|
+
}[];
|
|
288
|
+
summary: {
|
|
289
|
+
tasks: number;
|
|
290
|
+
evaluated: number;
|
|
291
|
+
success: number;
|
|
292
|
+
unverified: number;
|
|
293
|
+
verifiedSuccessRate: number | null;
|
|
294
|
+
verificationCoverage: number | null;
|
|
295
|
+
corrections: number;
|
|
296
|
+
totalEstimatedUsd: number | null;
|
|
297
|
+
costComplete: boolean;
|
|
298
|
+
estimatedUsdPerSuccess: number | null;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
close(): void;
|
|
302
|
+
}>;
|
|
303
|
+
export type TaskMetrics = Awaited<ReturnType<typeof openTaskMetrics>>;
|
|
304
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updateSchema: z.ZodObject<{
|
|
3
|
+
update_id: z.ZodNumber;
|
|
4
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
message_id: z.ZodNumber;
|
|
6
|
+
from: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
id: z.ZodNumber;
|
|
8
|
+
is_bot: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
chat: z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
type: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
text: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
callback_query: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
from: z.ZodObject<{
|
|
19
|
+
id: z.ZodNumber;
|
|
20
|
+
is_bot: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
23
|
+
message_id: z.ZodNumber;
|
|
24
|
+
from: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
id: z.ZodNumber;
|
|
26
|
+
is_bot: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
chat: z.ZodObject<{
|
|
29
|
+
id: z.ZodNumber;
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
text: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
data: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type TelegramUpdate = z.infer<typeof updateSchema>;
|
|
38
|
+
export interface TelegramApi {
|
|
39
|
+
call(method: string, payload: Record<string, unknown>, signal?: AbortSignal): Promise<unknown>;
|
|
40
|
+
}
|
|
41
|
+
export declare class TelegramFailure extends Error {
|
|
42
|
+
readonly kind: 'retry' | 'rejected' | 'uncertain';
|
|
43
|
+
readonly retryAfter: number;
|
|
44
|
+
constructor(kind: 'retry' | 'rejected' | 'uncertain', retryAfter?: number);
|
|
45
|
+
}
|
|
46
|
+
/** Token remains only in memory. Never propagate fetch errors containing request URLs. */
|
|
47
|
+
export declare function createTelegramApi(token: string, fetcher?: typeof fetch): TelegramApi;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { AgendaSource } from '../automation/summary.js';
|
|
2
|
+
import type { SummarySource } from '../modules/module.js';
|
|
3
|
+
import type { HarnessClientRun } from '../../../engine/protocol.js';
|
|
4
|
+
import { type TelegramApi } from './api.js';
|
|
5
|
+
export interface TelegramBridgeOptions {
|
|
6
|
+
stateDirectory: string;
|
|
7
|
+
credentialsPath: string;
|
|
8
|
+
ownerId: string;
|
|
9
|
+
expectedTelegramUserId: string;
|
|
10
|
+
/** Trusted local setup only: private challenge already proved and explicitly confirmed by the owner. */
|
|
11
|
+
confirmedPrivateChatId?: string;
|
|
12
|
+
confirmedUpdateOffset?: number;
|
|
13
|
+
api: TelegramApi;
|
|
14
|
+
recover?: boolean;
|
|
15
|
+
now?: () => number;
|
|
16
|
+
/** Trusted host lookup of digest-bound external operation details, never supplied by a channel message. */
|
|
17
|
+
agendaSource?: AgendaSource;
|
|
18
|
+
summarySources?: SummarySource[];
|
|
19
|
+
reviewTools?: readonly string[];
|
|
20
|
+
approvalDetails?: (run: HarnessClientRun) => Promise<unknown>;
|
|
21
|
+
}
|
|
22
|
+
/** One local owner, one bot, one private conversation. No channel payload grants host authority. */
|
|
23
|
+
export declare function createTelegramBridge(options: TelegramBridgeOptions): Promise<{
|
|
24
|
+
notifications: {
|
|
25
|
+
ready: () => boolean;
|
|
26
|
+
send(text: string, signal: AbortSignal): Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
automation: {
|
|
29
|
+
status: () => {
|
|
30
|
+
schedule: {
|
|
31
|
+
enabled: number;
|
|
32
|
+
revision: number;
|
|
33
|
+
next_at: number;
|
|
34
|
+
} | null;
|
|
35
|
+
preferences: unknown[];
|
|
36
|
+
occurrences: unknown[];
|
|
37
|
+
};
|
|
38
|
+
command(text: string): string;
|
|
39
|
+
} | undefined;
|
|
40
|
+
pairingCode: string | undefined;
|
|
41
|
+
ingest: (values: unknown[]) => void;
|
|
42
|
+
work: (controlOnly?: boolean) => Promise<void>;
|
|
43
|
+
flush: () => Promise<void>;
|
|
44
|
+
tick: () => Promise<void>;
|
|
45
|
+
diagnostics: () => {
|
|
46
|
+
linked: boolean;
|
|
47
|
+
offset: number;
|
|
48
|
+
inbox: {
|
|
49
|
+
status: string;
|
|
50
|
+
count: number;
|
|
51
|
+
}[];
|
|
52
|
+
automation: {
|
|
53
|
+
schedule: {
|
|
54
|
+
enabled: number;
|
|
55
|
+
revision: number;
|
|
56
|
+
next_at: number;
|
|
57
|
+
} | null;
|
|
58
|
+
preferences: unknown[];
|
|
59
|
+
occurrences: unknown[];
|
|
60
|
+
} | undefined;
|
|
61
|
+
lastFault: string | undefined;
|
|
62
|
+
outbox: {
|
|
63
|
+
status: string;
|
|
64
|
+
count: number;
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
start(): void;
|
|
68
|
+
close(): Promise<void>;
|
|
69
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function openTelegramStore(directory: string, recover?: boolean): Promise<{
|
|
2
|
+
get: <T>(sql: string, ...args: (string | number | null)[]) => T | undefined;
|
|
3
|
+
all: <T>(sql: string, ...args: (string | number | null)[]) => T[];
|
|
4
|
+
run: (sql: string, ...args: (string | number | null)[]) => import("node:sqlite").StatementResultingChanges;
|
|
5
|
+
transaction: <T>(fn: () => T) => T;
|
|
6
|
+
meta: (key: string) => string | undefined;
|
|
7
|
+
set: (key: string, value: string) => import("node:sqlite").StatementResultingChanges;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
}>;
|
|
10
|
+
export type TelegramStore = Awaited<ReturnType<typeof openTelegramStore>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AutomationSnapshot } from './contracts.js';
|
|
2
|
+
export type { AutomationSnapshot, AutomationChange } from './contracts.js';
|
|
3
|
+
import type { ManagedApplication } from './coordinator-client.js';
|
|
4
|
+
/** Configuration lane only; never executes a summary or retries an external delivery. */
|
|
5
|
+
export declare function applicationAutomation(manager: ManagedApplication, raw: unknown): Promise<AutomationSnapshot>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ApprovalReviewItem } from './approval-review.js';
|
|
2
|
+
/** Called only after the complete stored details pass the host's credential-redaction gate. */
|
|
3
|
+
export declare function attachCalendarChange(item: ApprovalReviewItem, details: unknown): void;
|
|
4
|
+
/** New-event projection uses the same credential-redaction prerequisite as changes. */
|
|
5
|
+
export declare function attachCalendarCreation(item: ApprovalReviewItem, details: unknown): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HarnessClientData, HarnessClientResponse } from '../client/protocol.js';
|
|
2
|
+
type Restore = Extract<HarnessClientData, {
|
|
3
|
+
kind: 'restore';
|
|
4
|
+
}>;
|
|
5
|
+
export interface CheckpointReview {
|
|
6
|
+
ticketId: string;
|
|
7
|
+
operation: Restore['operation'];
|
|
8
|
+
preview: Restore['preview'];
|
|
9
|
+
canApply: boolean;
|
|
10
|
+
redacted: boolean;
|
|
11
|
+
expiresAt: number;
|
|
12
|
+
recoverySessionId?: string;
|
|
13
|
+
completionOnly?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Main-process authority. The renderer cannot choose a proposal, revision or child at confirmation. */
|
|
16
|
+
export declare function createCheckpointReviewHost(call: (command: Record<string, unknown>) => Promise<HarnessClientResponse>, redact: (value: unknown) => unknown, now?: () => number): {
|
|
17
|
+
review(sessionId: unknown, operationId: unknown): Promise<{
|
|
18
|
+
ticketId: string;
|
|
19
|
+
operation: Restore['operation'];
|
|
20
|
+
preview: Restore['preview'];
|
|
21
|
+
canApply: boolean;
|
|
22
|
+
redacted: boolean;
|
|
23
|
+
expiresAt: number;
|
|
24
|
+
recoverySessionId?: string;
|
|
25
|
+
completionOnly: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
reviewRecovery(sessionId: unknown, operationId: unknown, forkSessionId: unknown): Promise<CheckpointReview>;
|
|
28
|
+
resolve(ticketId: unknown, approve: unknown): Promise<HarnessClientResponse | null>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type HarnessClientResponse, type HarnessClientCommand } from "../client/protocol.js";
|
|
2
|
+
import type { ApplicationReviewResponse } from "./review-channel.js";
|
|
3
|
+
type Unscoped<T> = T extends unknown ? Omit<T, "projectId"> : never;
|
|
4
|
+
export type ApplicationCommand = Unscoped<HarnessClientCommand>;
|
|
5
|
+
/** A client is bound by the host to one runtime. It never owns that runtime.
|
|
6
|
+
* Reconnect explicitly and inspect durable state after an uncertain mutation;
|
|
7
|
+
* connection-scoped idempotency keys are not permission to replay across clients.
|
|
8
|
+
*/
|
|
9
|
+
export declare function connectApplication(credentialsPath: string): Promise<{
|
|
10
|
+
projectId: string;
|
|
11
|
+
capabilities: readonly string[];
|
|
12
|
+
review(sessionId: string, runId: string): Promise<ApplicationReviewResponse>;
|
|
13
|
+
decide(ticketId: string, approve: boolean): Promise<HarnessClientResponse>;
|
|
14
|
+
command(command: ApplicationCommand | Record<string, unknown>): Promise<HarnessClientResponse>;
|
|
15
|
+
events(sessionId: string, after?: number): Promise<import("../index.js").HarnessActivityPage>;
|
|
16
|
+
}>;
|
|
17
|
+
export type ApplicationClient = Awaited<ReturnType<typeof connectApplication>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CodeContextSnapshot } from '../contracts.js';
|
|
2
|
+
export type { CodeContextSnapshot } from '../contracts.js';
|
|
3
|
+
import type { ZhivexHarness } from '../../runtime/harness.js';
|
|
4
|
+
/** Metadata of the host's loaded bundle, never file contents or credential configuration. */
|
|
5
|
+
export declare function projectCodeContext(harness: Pick<ZhivexHarness, 'context' | 'config'>, secrets?: readonly string[]): CodeContextSnapshot;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HarnessLocalService } from '../../client/local-service.js';
|
|
2
|
+
/** Core-owned Git authority; clients receive previews and opaque receipts, never shell commands. */
|
|
3
|
+
export declare function createCodeDelivery(service: HarnessLocalService, workspace: string, directory: string, secrets: readonly string[]): {
|
|
4
|
+
call(action: string, input?: unknown): Promise<unknown>;
|
|
5
|
+
close(): Promise<void>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface DeliveryChanges {
|
|
3
|
+
files: Array<{
|
|
4
|
+
path: string;
|
|
5
|
+
staged: boolean;
|
|
6
|
+
worktree: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
blocked: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CommitFile {
|
|
11
|
+
path: string;
|
|
12
|
+
before: string;
|
|
13
|
+
after: string;
|
|
14
|
+
beforeMode: string;
|
|
15
|
+
afterMode: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CommitReview {
|
|
18
|
+
ticketId: string;
|
|
19
|
+
branch: string;
|
|
20
|
+
head: string;
|
|
21
|
+
tree: string;
|
|
22
|
+
message: string;
|
|
23
|
+
files: CommitFile[];
|
|
24
|
+
author: string;
|
|
25
|
+
committer: string;
|
|
26
|
+
destination: "local";
|
|
27
|
+
expiresAt: number;
|
|
28
|
+
}
|
|
29
|
+
declare const operationSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
workspace: z.ZodString;
|
|
32
|
+
branch: z.ZodString;
|
|
33
|
+
head: z.ZodString;
|
|
34
|
+
tree: z.ZodString;
|
|
35
|
+
commit: z.ZodString;
|
|
36
|
+
status: z.ZodEnum<{
|
|
37
|
+
completed: "completed";
|
|
38
|
+
prepared: "prepared";
|
|
39
|
+
}>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export type CommitOperation = z.infer<typeof operationSchema>;
|
|
42
|
+
export type CommitReconciliation = CommitOperation | {
|
|
43
|
+
id: string;
|
|
44
|
+
status: "not-accepted";
|
|
45
|
+
};
|
|
46
|
+
/** Host-only, single desktop owner. No hooks, signing, push or shell evaluation. */
|
|
47
|
+
export declare function openGitDelivery(workspace: string, directory: string, sensitiveValues?: readonly string[]): Promise<{
|
|
48
|
+
changes: () => Promise<DeliveryChanges>;
|
|
49
|
+
stage: (paths: unknown) => Promise<DeliveryChanges>;
|
|
50
|
+
reviewCommit(input: unknown): Promise<CommitReview>;
|
|
51
|
+
commit(ticketId: string): Promise<CommitOperation>;
|
|
52
|
+
reconcile: (id: string) => Promise<CommitReconciliation>;
|
|
53
|
+
}>;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type PushDestination, type PushSnapshot, type RemoteTransport } from "./remote-delivery.js";
|
|
2
|
+
export interface RemoteTargets {
|
|
3
|
+
branch: string;
|
|
4
|
+
remotes: Array<{
|
|
5
|
+
remote: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}>;
|
|
8
|
+
unsupported: number;
|
|
9
|
+
}
|
|
10
|
+
/** GitHub HTTPS transport. Auth stays in Git/gh, never in snapshots or IPC. */
|
|
11
|
+
export declare function openGitHubGitTransport(workspace: string): Promise<RemoteTransport & {
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
targets(): Promise<RemoteTargets>;
|
|
14
|
+
inspectPullRequest(destination: PushDestination): Promise<PushSnapshot>;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PushDestination, type PushSnapshot } from "./remote-delivery.js";
|
|
2
|
+
import { type PullRequestTransport } from "./pr-delivery.js";
|
|
3
|
+
/** Explicit REST endpoints and stdin JSON; gh retains the host's credentials. */
|
|
4
|
+
export declare function openGitHubPullRequestTransport(git: {
|
|
5
|
+
inspectPullRequest(destination: PushDestination): Promise<PushSnapshot>;
|
|
6
|
+
}): PullRequestTransport;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CreateHarnessOptions } from '../../runtime/harness.js';
|
|
2
|
+
/** Shared Code composition for the service CLI and desktop-owned projects. */
|
|
3
|
+
export declare function startCodeHost(options: {
|
|
4
|
+
workspace: string;
|
|
5
|
+
directory: string;
|
|
6
|
+
recover?: boolean;
|
|
7
|
+
engine?: Omit<CreateHarnessOptions, 'workspace'>;
|
|
8
|
+
sensitiveValues?: readonly string[];
|
|
9
|
+
}): Promise<{
|
|
10
|
+
socketPath: string;
|
|
11
|
+
credentialsPath: string;
|
|
12
|
+
pauseAdmission(): boolean;
|
|
13
|
+
resumeAdmission(): void;
|
|
14
|
+
cancelActive(): Promise<void>;
|
|
15
|
+
dispatchReviewed(request: unknown): Promise<import("../../index.js").HarnessClientResponse>;
|
|
16
|
+
binding: () => import("../contracts.js").ApplicationRuntimeBinding;
|
|
17
|
+
context: () => import("./context.js").CodeContextSnapshot;
|
|
18
|
+
delivery: (action: string, input?: unknown) => Promise<unknown>;
|
|
19
|
+
close: () => Promise<void>;
|
|
20
|
+
checks(): Promise<{
|
|
21
|
+
name: string;
|
|
22
|
+
script: string;
|
|
23
|
+
argv: string[];
|
|
24
|
+
}[]>;
|
|
25
|
+
}>;
|