@zhivex-ai/harness 1.6.3 → 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 +16 -3
- package/README.md +17 -5
- package/SECURITY.md +1 -1
- package/SUPPORT.md +2 -2
- package/benchmarks/README.md +98 -0
- package/contracts/engine-api.json +1587 -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/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-s9n693by.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-1epvek01.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-mbcq96nx.js → cli-entry-dksm56sj.js} +39 -293
- package/dist/{cli-entry-rsx0wpvs.js → cli-entry-eka68ttb.js} +4087 -4625
- package/dist/cli-entry-h7dcah4p.js +137 -0
- package/dist/cli-entry-kwk23ktq.js +33 -0
- package/dist/{cli-entry-nyzyvf24.js → cli-entry-vmce694z.js} +1286 -3142
- package/dist/cli-entry-wanv05db.js +1113 -0
- package/dist/{cli-yxvq8qf1.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 +4 -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 +31 -5
- 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.d.ts +4 -0
- package/dist/engine/index.js +117 -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 +2329 -1096
- package/dist/index-09rsdr2d.js +1744 -0
- package/dist/index-0csc5sc7.js +139 -0
- package/dist/{index-4mn6m3bq.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-rgqzdgv6.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-fqqz1yt8.js → index-6ehtssyz.js} +369 -335
- package/dist/index-76kpdbpw.js +80 -0
- package/dist/{index-5nmm0642.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-hhrnrqfc.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-j466sekf.js → index-mkt5yrax.js} +31 -105
- package/dist/{index-nxmk6re7.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-vn91b9z1.js → index-sx1t6dnd.js} +3721 -2382
- package/dist/index-tar0ngkm.js +359 -0
- package/dist/index-tn58cr6w.js +471 -0
- package/dist/{index-w0m1nckc.js → index-v79s9bf9.js} +118 -45
- 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-amjttjaj.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/agent-profile.d.ts +12 -0
- package/dist/runtime/harness.d.ts +13 -0
- package/dist/runtime/known-file-preload.d.ts +35 -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 +2249 -1016
- 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 +11 -5
- package/docs/CODE_WEB_TASKS.md +3 -114
- package/docs/CONTEXT_ENGINEERING.md +93 -0
- package/docs/ENGINE_API.md +9 -2
- 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/PROJECT_MEMORY.md +1 -1
- package/docs/README.md +23 -4
- package/evaluations/representative-assembly-matrix.json +19 -1
- package/examples/README.md +4 -4
- 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 +232 -26
- package/dist/cli/console/console-model-catalog.d.ts +0 -8
- package/dist/index-2yyfg69h.js +0 -619
- package/dist/index-3wwfn5n6.js +0 -270
- package/dist/index-4gt045j0.js +0 -288
- package/dist/index-4jw3tvy8.js +0 -301
- package/dist/service-client-cli-xbj7j5kj.js +0 -1251
package/dist/index-3wwfn5n6.js
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
// package.json
|
|
2
|
-
var package_default = {
|
|
3
|
-
name: "@zhivex-ai/harness",
|
|
4
|
-
version: "1.6.3",
|
|
5
|
-
description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
|
|
6
|
-
type: "module",
|
|
7
|
-
license: "MIT",
|
|
8
|
-
repository: {
|
|
9
|
-
type: "git",
|
|
10
|
-
url: "git+https://github.com/Zhivex/zhivex-harness.git"
|
|
11
|
-
},
|
|
12
|
-
bugs: {
|
|
13
|
-
url: "https://github.com/Zhivex/zhivex-harness/issues"
|
|
14
|
-
},
|
|
15
|
-
homepage: "https://github.com/Zhivex/zhivex-harness#readme",
|
|
16
|
-
publishConfig: {
|
|
17
|
-
access: "public",
|
|
18
|
-
provenance: true,
|
|
19
|
-
registry: "https://registry.npmjs.org/"
|
|
20
|
-
},
|
|
21
|
-
keywords: [
|
|
22
|
-
"ai",
|
|
23
|
-
"agents",
|
|
24
|
-
"coding-agent",
|
|
25
|
-
"agent-runtime",
|
|
26
|
-
"agent-governance",
|
|
27
|
-
"change-control",
|
|
28
|
-
"policy-as-code",
|
|
29
|
-
"software-supply-chain",
|
|
30
|
-
"sandbox",
|
|
31
|
-
"durable-workflows",
|
|
32
|
-
"mcp",
|
|
33
|
-
"docker",
|
|
34
|
-
"typescript",
|
|
35
|
-
"node",
|
|
36
|
-
"bun",
|
|
37
|
-
"harness",
|
|
38
|
-
"zhivex"
|
|
39
|
-
],
|
|
40
|
-
bin: {
|
|
41
|
-
"zhivex-harness": "./dist/cli.js",
|
|
42
|
-
zhx: "./dist/zhx.js",
|
|
43
|
-
"zhx-acp": "./dist/acp-cli.js"
|
|
44
|
-
},
|
|
45
|
-
exports: {
|
|
46
|
-
".": {
|
|
47
|
-
types: "./dist/index.d.ts",
|
|
48
|
-
import: "./dist/index.js"
|
|
49
|
-
},
|
|
50
|
-
"./engine": {
|
|
51
|
-
types: "./dist/engine/index.d.ts",
|
|
52
|
-
import: "./dist/engine/index.js"
|
|
53
|
-
},
|
|
54
|
-
"./protocol": {
|
|
55
|
-
types: "./dist/engine/protocol.d.ts",
|
|
56
|
-
import: "./dist/engine/protocol.js"
|
|
57
|
-
},
|
|
58
|
-
"./client": {
|
|
59
|
-
types: "./dist/engine/client.d.ts",
|
|
60
|
-
import: "./dist/engine/client.js"
|
|
61
|
-
},
|
|
62
|
-
"./service": {
|
|
63
|
-
types: "./dist/engine/service.d.ts",
|
|
64
|
-
import: "./dist/engine/service.js"
|
|
65
|
-
},
|
|
66
|
-
"./acp": {
|
|
67
|
-
types: "./dist/engine/acp.d.ts",
|
|
68
|
-
import: "./dist/engine/acp.js"
|
|
69
|
-
},
|
|
70
|
-
"./code-support": {
|
|
71
|
-
types: "./dist/compat/code-support.d.ts",
|
|
72
|
-
import: "./dist/compat/code-support.js"
|
|
73
|
-
},
|
|
74
|
-
"./models": {
|
|
75
|
-
types: "./dist/engine/models.d.ts",
|
|
76
|
-
import: "./dist/engine/models.js"
|
|
77
|
-
},
|
|
78
|
-
"./desktop/v1/state": {
|
|
79
|
-
types: "./dist/engine/desktop-state-v1.d.ts",
|
|
80
|
-
import: "./dist/engine/desktop-state-v1.js"
|
|
81
|
-
},
|
|
82
|
-
"./desktop/v1/providers": {
|
|
83
|
-
types: "./dist/engine/desktop-providers-v1.d.ts",
|
|
84
|
-
import: "./dist/engine/desktop-providers-v1.js"
|
|
85
|
-
},
|
|
86
|
-
"./mcp/stdio/v1": {
|
|
87
|
-
types: "./dist/engine/mcp-stdio-v1.d.ts",
|
|
88
|
-
import: "./dist/engine/mcp-stdio-v1.js"
|
|
89
|
-
},
|
|
90
|
-
"./audit": {
|
|
91
|
-
types: "./dist/audit/index.d.ts",
|
|
92
|
-
import: "./dist/audit/index.js"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
files: [
|
|
96
|
-
"dist",
|
|
97
|
-
"README.md",
|
|
98
|
-
"CHANGELOG.md",
|
|
99
|
-
"SECURITY.md",
|
|
100
|
-
"SUPPORT.md",
|
|
101
|
-
"LICENSE",
|
|
102
|
-
"docs/CHANGE_ENVELOPES.md",
|
|
103
|
-
"docs/CLI.md",
|
|
104
|
-
"docs/AUTO_APPROVE.md",
|
|
105
|
-
"docs/WEB_LIMITS.md",
|
|
106
|
-
"docs/CODE_RELEASE.md",
|
|
107
|
-
"docs/CODE_WEB_TASKS.md",
|
|
108
|
-
"docs/images/cli-conversation.png",
|
|
109
|
-
"docs/CLIENT_PROTOCOL.md",
|
|
110
|
-
"docs/CONTEXT_ENGINEERING.md",
|
|
111
|
-
"docs/CREDENTIALS.md",
|
|
112
|
-
"docs/MODEL_CATALOG.md",
|
|
113
|
-
"docs/DEPRECATIONS.md",
|
|
114
|
-
"docs/DURABLE_OPERATIONS.md",
|
|
115
|
-
"docs/EXECUTION_ENVIRONMENTS.md",
|
|
116
|
-
"docs/EXTENSIBILITY.md",
|
|
117
|
-
"docs/FIRST_USE.md",
|
|
118
|
-
"docs/FIRST_USE_EXAMPLE.md",
|
|
119
|
-
"docs/HOSTILE_REPOSITORY_DEMO.md",
|
|
120
|
-
"docs/LOCAL_SERVICE.md",
|
|
121
|
-
"docs/PUBLIC_SECURITY.md",
|
|
122
|
-
"docs/README.md",
|
|
123
|
-
"docs/REPOSITORY_EDITING.md",
|
|
124
|
-
"docs/STABILITY.md",
|
|
125
|
-
"docs/SUPPORT_MATRIX.md",
|
|
126
|
-
"docs/SUPPORT_MATRIX_1_1.md",
|
|
127
|
-
"docs/THREAT_MODEL.md",
|
|
128
|
-
"docs/TIME_TO_SAFE_FIX.md",
|
|
129
|
-
"docs/USAGE.md",
|
|
130
|
-
"docs/support-matrix.json",
|
|
131
|
-
"docs/support-matrix-1.1.json",
|
|
132
|
-
"contracts",
|
|
133
|
-
"examples",
|
|
134
|
-
"fixtures",
|
|
135
|
-
"evaluations/*.json",
|
|
136
|
-
"evaluations/*.jsonl",
|
|
137
|
-
"benchmarks/README.md",
|
|
138
|
-
"docs/ACP.md",
|
|
139
|
-
"docs/WORKSPACE_CHECKPOINTS.md",
|
|
140
|
-
"docs/ENGINE_API.md",
|
|
141
|
-
"docs/ANTHROPIC.md",
|
|
142
|
-
"docs/MCP_STDIO.md",
|
|
143
|
-
"docs/adr/0002-isolated-mcp-stdio.md",
|
|
144
|
-
"docs/VERTEX.md",
|
|
145
|
-
"docs/BEDROCK.md",
|
|
146
|
-
"docs/AZURE_OPENAI.md",
|
|
147
|
-
"docs/TOOL_POLICY.md",
|
|
148
|
-
"docs/fixtures/mcp-stdio-contract-v1.json",
|
|
149
|
-
"docs/PROJECT_MEMORY.md",
|
|
150
|
-
"docs/MINIMUM_TASK_AUTHORITY.md",
|
|
151
|
-
"docs/MINIMUM_OFFLINE_EVALS.md",
|
|
152
|
-
"docs/AUDIT_PACK.md"
|
|
153
|
-
],
|
|
154
|
-
scripts: {
|
|
155
|
-
"models:check": "bun run scripts/validate-model-catalog.ts",
|
|
156
|
-
"models:import": "bun run scripts/generate-console-models.ts",
|
|
157
|
-
dev: "bun run build && node --env-file-if-exists=.env dist/cli.js",
|
|
158
|
-
start: "node dist/cli.js",
|
|
159
|
-
build: "bun run scripts/clean-dist.ts && bun build ./src/index.ts ./src/service-cli.ts ./src/acp-cli.ts ./src/audit/index.ts ./src/engine/index.ts ./src/engine/protocol.ts ./src/engine/client.ts ./src/engine/service.ts ./src/engine/acp.ts ./src/engine/models.ts ./src/engine/desktop-state-v1.ts ./src/engine/desktop-providers-v1.ts ./src/compat/code-support.ts ./src/engine/mcp-stdio-v1.ts --root ./src --outdir ./dist --target node --packages external --splitting && bun build ./src/engine/protocol.ts ./src/engine/models.ts --outdir ./dist/engine --target browser --packages external && bun build ./src/cli-entry.ts --outdir ./dist --target node --packages external --splitting && mv ./dist/cli-entry.js ./dist/cli.js && cp ./dist/cli.js ./dist/zhx.js && bun build ./scripts/verify-historical-migrations.ts --outfile ./dist/verify-historical-migrations.js --target node --packages external && bun build ./scripts/hostile-repository-demo.ts --outfile ./dist/hostile-repository-demo.js --target node --packages external && tsc --emitDeclarationOnly",
|
|
160
|
-
prepack: "bun run build",
|
|
161
|
-
"architecture:check": "bun run scripts/check-architecture.ts",
|
|
162
|
-
"docs:check": "bun run scripts/check-docs.ts",
|
|
163
|
-
"contract:check": "bun run scripts/check-1-0-readiness.ts",
|
|
164
|
-
"contract:signatures:update": "bun run scripts/generate-stable-api-signatures.ts --write",
|
|
165
|
-
"migration:check": "bun run scripts/verify-historical-migrations.ts",
|
|
166
|
-
"readiness:1.0": "bun run scripts/check-1-0-readiness.ts",
|
|
167
|
-
"readiness:1.0:release": "bun run scripts/check-1-0-readiness.ts --release",
|
|
168
|
-
typecheck: "tsc --noEmit",
|
|
169
|
-
test: "bun test --preload ./tests/preload-bedrock-mock.ts ./tests ./desktop/tests",
|
|
170
|
-
evaluate: "bun run scripts/evaluate.ts",
|
|
171
|
-
"benchmark:workspace": "bun run scripts/benchmark-workspace.ts",
|
|
172
|
-
"benchmark:workspace:ci": "bun run scripts/benchmark-workspace.ts --files 1000 --page-size 100 --repetitions 3 --warmups 0",
|
|
173
|
-
"benchmark:oci": "bun run scripts/benchmark-oci.ts",
|
|
174
|
-
"benchmark:safe-fix": "bun run scripts/benchmark-time-to-safe-fix.ts",
|
|
175
|
-
"benchmark:safe-fix:ci": "bun run scripts/benchmark-time-to-safe-fix.ts --tasks 2 --repetitions 1 --profiles direct,governed,optimized --carriers rule_file --summary",
|
|
176
|
-
"benchmark:safe-fix:live": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --driver-zhivex",
|
|
177
|
-
"benchmark:safe-fix:live:smoke": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --tasks 2 --repetitions 1 --profiles direct,governed,optimized --carriers rule_file --driver-zhivex --summary",
|
|
178
|
-
"benchmark:safe-fix:live:expanded": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --dataset evaluations/time-to-safe-fix-expanded.jsonl --dataset-name zhivex-time-to-safe-fix-expanded --tasks 12 --repetitions 3 --profiles direct,governed,optimized --carriers rule_file --driver-zhivex --driver-timeout-ms 300000 --summary",
|
|
179
|
-
"benchmark:safe-fix:baseline": "bun run scripts/create-time-to-safe-fix-baseline.ts",
|
|
180
|
-
"benchmark:safe-fix:image:check": "bun run scripts/build-time-to-safe-fix-image.ts --validate-only",
|
|
181
|
-
"benchmark:safe-fix:image:build": "bun run scripts/build-time-to-safe-fix-image.ts",
|
|
182
|
-
"smoke:package": "bun run build && bun run scripts/package-smoke.ts",
|
|
183
|
-
"smoke:artifact": "bun run scripts/package-smoke.ts",
|
|
184
|
-
"smoke:mcp": "bun run scripts/mcp-interoperability-smoke.ts",
|
|
185
|
-
"smoke:mcp:official": "bun run scripts/mcp-official-sdk-smoke.ts",
|
|
186
|
-
"smoke:oci": "bun run scripts/oci-execution-smoke.ts",
|
|
187
|
-
"smoke:live": "bun --env-file=.env run scripts/live-provider-smoke.ts",
|
|
188
|
-
"smoke:live:orchestration": "bun --env-file=.env run scripts/live-orchestration-smoke.ts",
|
|
189
|
-
"smoke:live:routing": "bun --env-file=.env run scripts/live-routing-smoke.ts",
|
|
190
|
-
"smoke:live:execution": "bun --env-file=.env run scripts/live-execution-smoke.ts",
|
|
191
|
-
"demo:hostile": "bun run dist/hostile-repository-demo.js",
|
|
192
|
-
"artifact:check": "bun run scripts/check-release-artifact.ts",
|
|
193
|
-
"pack:inspect": "bun run build && bun pm pack --dry-run --ignore-scripts",
|
|
194
|
-
check: "bun run architecture:check && bun run docs:check && bun run contract:check && bun run typecheck && bun run typecheck:tooling && bun run test && bun run migration:check && bun run evaluate && bun run benchmark:workspace:ci && bun run benchmark:safe-fix:image:check && bun run benchmark:safe-fix:ci && bun run smoke:mcp && bun run smoke:mcp:official && bun run smoke:oci && bun run smoke:package",
|
|
195
|
-
"check:sdk-redaction": "bun run scripts/diagnostics/reproduce-redaction-state-divergence.ts --require-fixed",
|
|
196
|
-
"release:check": "bun run release:preflight && bun run check:sdk-redaction && bun run check && bun run scripts/audit-dependencies.ts && bun pm untrusted && bun run pack:inspect && bun run scripts/check-release-readiness.ts",
|
|
197
|
-
"release:status": "bun run scripts/check-registry-release-status.ts",
|
|
198
|
-
"release:verify": "bun run scripts/verify-registry-release.ts",
|
|
199
|
-
"benchmark:workspace:scale": "bun run scripts/benchmark-workspace.ts --files 10000 --directories 100 --file-bytes 4096 --page-size 100 --repetitions 5 --warmups 1",
|
|
200
|
-
"evaluate:continuity": "bun test tests/compaction.test.ts tests/harness.test.ts",
|
|
201
|
-
"benchmark:swebench": "bun run scripts/benchmark-swebench.ts",
|
|
202
|
-
"benchmark:swebench:test": "bun test tests/swebench.test.ts",
|
|
203
|
-
"typecheck:tooling": "tsc -p tsconfig.tooling.json",
|
|
204
|
-
service: "node dist/service-cli.js",
|
|
205
|
-
"smoke:console": "bun run build && python3 scripts/console-pty-smoke.py && python3 scripts/console-entry-smoke.py",
|
|
206
|
-
"smoke:credentials": "node --experimental-strip-types scripts/credential-store-smoke.ts",
|
|
207
|
-
"release:preflight": "bun run scripts/release-preflight.ts",
|
|
208
|
-
"release:prepare": "bun run scripts/prepare-release.ts",
|
|
209
|
-
"build:code": "bun run --cwd packages/code build",
|
|
210
|
-
"test:code": "bun run --cwd packages/code test",
|
|
211
|
-
"smoke:engine-code": "bun run scripts/smoke-engine-code.ts",
|
|
212
|
-
"smoke:state-upgrade": "bun run scripts/smoke-state-upgrade.ts",
|
|
213
|
-
"smoke:global-code": "node scripts/smoke-global-code.mjs",
|
|
214
|
-
"dev:code": "bun run build && bun run packages/code/scripts/link-local-engine.ts && bun run build:code",
|
|
215
|
-
"typecheck:code": "bun run --cwd packages/code typecheck",
|
|
216
|
-
"evaluate:tasks": "bun run scripts/task-acceptance.ts",
|
|
217
|
-
"prepare:desktop": "bun run build && bun pm pack --ignore-scripts --quiet --filename desktop/.harness-candidate.tgz && bun run desktop/scripts/prepare-harness.ts desktop/.harness-candidate.tgz",
|
|
218
|
-
"smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts"
|
|
219
|
-
},
|
|
220
|
-
dependencies: {
|
|
221
|
-
"@zhivex-ai/agents": "1.12.0",
|
|
222
|
-
"@zhivex-ai/anthropic": "0.15.0",
|
|
223
|
-
"@zhivex-ai/azure-openai": "0.8.0",
|
|
224
|
-
"@zhivex-ai/bedrock": "2.1.0",
|
|
225
|
-
"@zhivex-ai/core": "1.37.0",
|
|
226
|
-
"@zhivex-ai/gemini": "0.14.0",
|
|
227
|
-
"@zhivex-ai/meta": "0.3.0",
|
|
228
|
-
"@zhivex-ai/openai": "0.17.0",
|
|
229
|
-
"@zhivex-ai/qwen": "0.18.1",
|
|
230
|
-
"@zhivex-ai/vertex": "1.3.0",
|
|
231
|
-
"google-auth-library": "11.3.1",
|
|
232
|
-
zod: "4.6.7"
|
|
233
|
-
},
|
|
234
|
-
overrides: {
|
|
235
|
-
"@zhivex-ai/core": "1.37.0"
|
|
236
|
-
},
|
|
237
|
-
devDependencies: {
|
|
238
|
-
"@agentclientprotocol/sdk": "2.1.0",
|
|
239
|
-
"@modelcontextprotocol/server": "2.3.1",
|
|
240
|
-
"@types/bun": "1.4.4",
|
|
241
|
-
"@types/node": "^26.6.5",
|
|
242
|
-
typescript: "7.0.2",
|
|
243
|
-
"typescript-compiler-api": "npm:typescript@6.0.3"
|
|
244
|
-
},
|
|
245
|
-
engines: {
|
|
246
|
-
node: ">=22.13.0",
|
|
247
|
-
bun: ">=1.4.0"
|
|
248
|
-
},
|
|
249
|
-
packageManager: "bun@1.4.0",
|
|
250
|
-
optionalDependencies: {
|
|
251
|
-
"@napi-rs/keyring": "2.1.2"
|
|
252
|
-
}
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
// src/version.ts
|
|
256
|
-
var packageMetadata = package_default;
|
|
257
|
-
if (typeof packageMetadata.version !== "string" || packageMetadata.version.length === 0) {
|
|
258
|
-
throw new Error("package.json must contain a non-empty version.");
|
|
259
|
-
}
|
|
260
|
-
if (typeof packageMetadata.engines?.node !== "string" || packageMetadata.engines.node.length === 0) {
|
|
261
|
-
throw new Error("package.json must contain a non-empty engines.node requirement.");
|
|
262
|
-
}
|
|
263
|
-
if (typeof packageMetadata.engines?.bun !== "string" || packageMetadata.engines.bun.length === 0) {
|
|
264
|
-
throw new Error("package.json must contain a non-empty engines.bun requirement.");
|
|
265
|
-
}
|
|
266
|
-
var HARNESS_VERSION = packageMetadata.version;
|
|
267
|
-
var NODE_ENGINE_RANGE = packageMetadata.engines.node;
|
|
268
|
-
var BUN_ENGINE_RANGE = packageMetadata.engines.bun;
|
|
269
|
-
|
|
270
|
-
export { HARNESS_VERSION, NODE_ENGINE_RANGE, BUN_ENGINE_RANGE };
|
package/dist/index-4gt045j0.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
providerStreamDiagnostic
|
|
3
|
-
} from "./index-bpc596v3.js";
|
|
4
|
-
|
|
5
|
-
// src/client/stream.ts
|
|
6
|
-
var CLI_JSON_SCHEMA_VERSION = 1;
|
|
7
|
-
var CLI_EVENT_SCHEMA_VERSION = 1;
|
|
8
|
-
var streamEventDocument = (event, sequence = 0) => {
|
|
9
|
-
if (!Number.isSafeInteger(sequence) || sequence < 0) {
|
|
10
|
-
throw new Error("JSONL event sequence must be a non-negative integer.");
|
|
11
|
-
}
|
|
12
|
-
const base = {
|
|
13
|
-
schemaVersion: CLI_EVENT_SCHEMA_VERSION,
|
|
14
|
-
kind: "run-event",
|
|
15
|
-
sequence,
|
|
16
|
-
type: event.type
|
|
17
|
-
};
|
|
18
|
-
switch (event.type) {
|
|
19
|
-
case "text-delta":
|
|
20
|
-
return { ...base, textDelta: event.textDelta };
|
|
21
|
-
case "tool-call":
|
|
22
|
-
return { ...base, toolCallId: event.toolCall.id, toolName: event.toolCall.name };
|
|
23
|
-
case "tool-result":
|
|
24
|
-
return {
|
|
25
|
-
...base,
|
|
26
|
-
toolCallId: event.toolResult.toolCallId,
|
|
27
|
-
toolName: event.toolResult.toolName,
|
|
28
|
-
isError: event.toolResult.isError
|
|
29
|
-
};
|
|
30
|
-
case "tool-approval-request":
|
|
31
|
-
case "agent-approval-request":
|
|
32
|
-
return {
|
|
33
|
-
...base,
|
|
34
|
-
approvalRequestId: event.approval.id,
|
|
35
|
-
approvalKind: event.approval.kind ?? "provider",
|
|
36
|
-
toolName: event.approval.name
|
|
37
|
-
};
|
|
38
|
-
case "agent-approval-resolved":
|
|
39
|
-
return {
|
|
40
|
-
...base,
|
|
41
|
-
approvalRequestId: event.approval.approvalRequestId,
|
|
42
|
-
approved: event.approval.approve
|
|
43
|
-
};
|
|
44
|
-
case "provider-data":
|
|
45
|
-
return { ...base, provider: event.provider };
|
|
46
|
-
case "image-generation":
|
|
47
|
-
return {
|
|
48
|
-
...base,
|
|
49
|
-
provider: event.provider,
|
|
50
|
-
partial: event.partial,
|
|
51
|
-
...event.id ? { id: event.id } : {},
|
|
52
|
-
...event.index !== undefined ? { index: event.index } : {}
|
|
53
|
-
};
|
|
54
|
-
case "finish":
|
|
55
|
-
return {
|
|
56
|
-
...base,
|
|
57
|
-
...event.finishReason ? { finishReason: event.finishReason } : {},
|
|
58
|
-
...event.usage ? { usage: event.usage } : {}
|
|
59
|
-
};
|
|
60
|
-
case "error": {
|
|
61
|
-
const diagnostic = providerStreamDiagnostic(event.error);
|
|
62
|
-
return { ...base, error: "Provider stream failed.", ...diagnostic ? { providerDiagnostic: diagnostic } : {} };
|
|
63
|
-
}
|
|
64
|
-
case "agent-run-start":
|
|
65
|
-
return { ...base, currentStep: event.currentStep, maxSteps: event.maxSteps };
|
|
66
|
-
case "agent-step-start":
|
|
67
|
-
return { ...base, stepIndex: event.stepIndex };
|
|
68
|
-
case "agent-step-finish":
|
|
69
|
-
return {
|
|
70
|
-
...base,
|
|
71
|
-
stepIndex: event.step.index,
|
|
72
|
-
status: event.step.status,
|
|
73
|
-
toolCalls: event.step.toolResults.length
|
|
74
|
-
};
|
|
75
|
-
case "agent-compaction":
|
|
76
|
-
return {
|
|
77
|
-
...base,
|
|
78
|
-
compactionId: event.compaction.id,
|
|
79
|
-
reasons: event.compaction.reasons,
|
|
80
|
-
messageCountBefore: event.compaction.messageCountBefore,
|
|
81
|
-
messageCountAfter: event.compaction.messageCountAfter
|
|
82
|
-
};
|
|
83
|
-
case "agent-run-finish":
|
|
84
|
-
return {
|
|
85
|
-
...base,
|
|
86
|
-
runId: event.state.runId,
|
|
87
|
-
status: event.status,
|
|
88
|
-
provider: event.state.provider,
|
|
89
|
-
model: event.state.modelId
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var serializeStreamEvent = (event, sequence = 0) => JSON.stringify(streamEventDocument(event, sequence));
|
|
94
|
-
var streamResultDocument = (result, sequence = 0) => {
|
|
95
|
-
if (!Number.isSafeInteger(sequence) || sequence < 0) {
|
|
96
|
-
throw new Error("JSONL result sequence must be a non-negative integer.");
|
|
97
|
-
}
|
|
98
|
-
return {
|
|
99
|
-
schemaVersion: CLI_EVENT_SCHEMA_VERSION,
|
|
100
|
-
kind: "run-stream-result",
|
|
101
|
-
sequence,
|
|
102
|
-
runId: result.runId,
|
|
103
|
-
status: result.status,
|
|
104
|
-
provider: result.provider,
|
|
105
|
-
model: result.model,
|
|
106
|
-
steps: result.steps,
|
|
107
|
-
toolCalls: result.toolCalls,
|
|
108
|
-
pendingApprovals: (result.pendingApprovals ?? []).map((approval) => ({
|
|
109
|
-
id: approval.id,
|
|
110
|
-
kind: approval.kind,
|
|
111
|
-
name: approval.name,
|
|
112
|
-
...approval.childRunId ? { childRunId: approval.childRunId } : {},
|
|
113
|
-
...approval.childAgentId ? { childAgentId: approval.childAgentId } : {}
|
|
114
|
-
})),
|
|
115
|
-
children: (result.children ?? []).map((child) => ({
|
|
116
|
-
runId: child.runId,
|
|
117
|
-
status: child.status
|
|
118
|
-
}))
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
var serializeStreamResult = (result, sequence = 0) => JSON.stringify(streamResultDocument(result, sequence));
|
|
122
|
-
|
|
123
|
-
// src/client/protocol.ts
|
|
124
|
-
import { z } from "zod";
|
|
125
|
-
var HARNESS_CLIENT_PROTOCOL_VERSION = 1;
|
|
126
|
-
var id = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/);
|
|
127
|
-
var revision = z.number().int().nonnegative().safe();
|
|
128
|
-
var scoped = { projectId: id };
|
|
129
|
-
var session = { ...scoped, sessionId: id };
|
|
130
|
-
var run = { ...session, runId: id };
|
|
131
|
-
var mutation = { idempotencyKey: id };
|
|
132
|
-
var checkpoint = { ...session, checkpointId: z.string().uuid() };
|
|
133
|
-
var restore = { ...session, operationId: z.string().uuid() };
|
|
134
|
-
var fileDigest = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
135
|
-
var harnessClientCommandSchema = z.discriminatedUnion("method", [
|
|
136
|
-
z.object({ method: z.literal("project.get"), ...scoped }).strict(),
|
|
137
|
-
z.object({ method: z.literal("policy.get"), ...scoped }).strict(),
|
|
138
|
-
z.object({ method: z.literal("session.list"), ...scoped, search: z.string().max(256).optional() }).strict(),
|
|
139
|
-
z.object({ method: z.literal("session.create"), ...scoped, ...mutation, title: z.string().max(256).optional() }).strict(),
|
|
140
|
-
z.object({ method: z.literal("session.get"), ...session }).strict(),
|
|
141
|
-
z.object({ method: z.literal("session.rename"), ...session, ...mutation, expectedRevision: revision, title: z.string().max(256) }).strict(),
|
|
142
|
-
z.object({ method: z.literal("checkpoint.list"), ...session }).strict(),
|
|
143
|
-
z.object({ method: z.literal("checkpoint.inspect"), ...checkpoint }).strict(),
|
|
144
|
-
z.object({
|
|
145
|
-
method: z.literal("checkpoint.capture"),
|
|
146
|
-
...session,
|
|
147
|
-
...mutation,
|
|
148
|
-
expectedRevision: revision,
|
|
149
|
-
turnId: id,
|
|
150
|
-
paths: z.array(z.string().min(1).max(1024)).min(1).max(20)
|
|
151
|
-
}).strict(),
|
|
152
|
-
z.object({
|
|
153
|
-
method: z.literal("restore.prepare"),
|
|
154
|
-
...checkpoint,
|
|
155
|
-
...mutation,
|
|
156
|
-
expectedRevision: revision,
|
|
157
|
-
expected: z.record(z.string().min(1).max(1024), fileDigest).refine((value) => Object.keys(value).length >= 1 && Object.keys(value).length <= 20)
|
|
158
|
-
}).strict(),
|
|
159
|
-
z.object({ method: z.literal("restore.get"), ...restore }).strict(),
|
|
160
|
-
z.object({ method: z.literal("restore.apply"), ...restore, ...mutation, expectedRevision: revision, reviewedProposalId: fileDigest }).strict(),
|
|
161
|
-
z.object({ method: z.literal("restore.recoverFork"), ...restore, ...mutation, expectedRevision: revision, forkSessionId: id }).strict(),
|
|
162
|
-
z.object({ method: z.literal("run.start"), ...session, ...mutation, expectedRevision: revision, prompt: z.string().min(1).max(64 * 1024) }).strict(),
|
|
163
|
-
z.object({
|
|
164
|
-
method: z.literal("task.start"),
|
|
165
|
-
...session,
|
|
166
|
-
...mutation,
|
|
167
|
-
expectedRevision: revision,
|
|
168
|
-
brief: z.strictObject({
|
|
169
|
-
goal: z.string().trim().min(1).max(2000),
|
|
170
|
-
paths: z.array(z.string().min(1).max(1024)).min(1).max(20),
|
|
171
|
-
checks: z.array(id).min(1).max(8),
|
|
172
|
-
constraints: z.array(z.string().trim().min(1).max(500)).max(8),
|
|
173
|
-
budget: z.strictObject({ inputTokens: z.number().int().positive().safe(), outputTokens: z.number().int().positive().safe(), totalTokens: z.number().int().positive().safe() })
|
|
174
|
-
})
|
|
175
|
-
}).strict(),
|
|
176
|
-
z.object({ method: z.literal("task.review"), ...run }).strict(),
|
|
177
|
-
z.object({ method: z.literal("task.keep"), ...run, ...mutation, reviewId: z.string().uuid() }).strict(),
|
|
178
|
-
z.object({ method: z.literal("task.revise"), ...run, ...mutation, reviewId: z.string().uuid(), correction: z.string().trim().min(1).max(500) }).strict(),
|
|
179
|
-
z.object({ method: z.literal("task.continue"), ...run, ...mutation, reviewId: z.string().uuid(), prompt: z.string().trim().min(1).max(2000) }).strict(),
|
|
180
|
-
z.object({ method: z.literal("task.get"), ...run, projectionVersion: z.number().int().nonnegative().safe() }).strict(),
|
|
181
|
-
z.object({ method: z.literal("run.get"), ...run, includeReview: z.boolean().optional(), includeDiff: z.boolean().optional(), decisionOffset: z.number().int().min(0).max(512).optional() }).strict(),
|
|
182
|
-
z.object({
|
|
183
|
-
method: z.literal("approval.resolve"),
|
|
184
|
-
...run,
|
|
185
|
-
...mutation,
|
|
186
|
-
expectedRevision: revision,
|
|
187
|
-
decisions: z.array(z.object({ approvalId: z.string().min(1).max(256), digest: z.string().regex(/^[a-f0-9]{64}$/), approve: z.boolean() }).strict()).min(1).max(64)
|
|
188
|
-
}).strict(),
|
|
189
|
-
z.object({ method: z.literal("run.cancel"), ...run, ...mutation, expectedRevision: revision }).strict()
|
|
190
|
-
]);
|
|
191
|
-
var harnessClientRequestSchema = z.object({
|
|
192
|
-
protocolVersion: z.literal(HARNESS_CLIENT_PROTOCOL_VERSION),
|
|
193
|
-
requestId: id,
|
|
194
|
-
connectionId: id,
|
|
195
|
-
command: harnessClientCommandSchema
|
|
196
|
-
}).strict();
|
|
197
|
-
|
|
198
|
-
// src/client/task-projection.ts
|
|
199
|
-
import { z as z2 } from "zod";
|
|
200
|
-
var HARNESS_TASK_PROJECTION_VERSION = 1;
|
|
201
|
-
var id2 = z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/);
|
|
202
|
-
var count = z2.number().int().nonnegative().safe();
|
|
203
|
-
var digest = z2.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
204
|
-
var text = z2.string().max(2048);
|
|
205
|
-
var tokens = z2.strictObject({ inputTokens: count, outputTokens: count, totalTokens: count });
|
|
206
|
-
var harnessTaskProjectionSchema = z2.strictObject({
|
|
207
|
-
schemaVersion: z2.literal(1),
|
|
208
|
-
connectionId: id2,
|
|
209
|
-
sequence: count,
|
|
210
|
-
projectId: id2,
|
|
211
|
-
sessionId: id2,
|
|
212
|
-
runId: id2,
|
|
213
|
-
task: z2.strictObject({
|
|
214
|
-
reference: digest,
|
|
215
|
-
contractRevision: count,
|
|
216
|
-
contractDigest: digest,
|
|
217
|
-
runRevision: count,
|
|
218
|
-
objective: text.nullable(),
|
|
219
|
-
objectiveSource: z2.enum(["operator_brief", "retained_operator_source", "unavailable"]),
|
|
220
|
-
observedRunId: id2,
|
|
221
|
-
historicalRequest: z2.boolean(),
|
|
222
|
-
execution: z2.enum(["created", "queued", "running", "waiting_approval", "cancel_requested", "completed", "failed", "cancelled", "timed_out", "unknown"]),
|
|
223
|
-
artifact: z2.strictObject({
|
|
224
|
-
observedDigest: digest.nullable(),
|
|
225
|
-
deliveredDigest: digest.nullable(),
|
|
226
|
-
correspondence: z2.enum(["current", "stale", "missing"]),
|
|
227
|
-
paths: z2.array(text).max(256),
|
|
228
|
-
contents: z2.literal("not_included")
|
|
229
|
-
}),
|
|
230
|
-
review: z2.strictObject({
|
|
231
|
-
structure: z2.enum(["verified", "incomplete"]),
|
|
232
|
-
semantic: z2.literal("pending"),
|
|
233
|
-
acceptance: z2.literal("not_recorded"),
|
|
234
|
-
human: z2.array(z2.strictObject({ id: text, requirement: text, status: z2.literal("pending") })).max(32),
|
|
235
|
-
checks: z2.array(z2.strictObject({ id: text, status: z2.enum(["confirmed", "missing", "missing_or_stale", "host_policy_changed"]), provenance: z2.literal("contract_snapshot_and_tool_journal") })).max(32)
|
|
236
|
-
}),
|
|
237
|
-
budget: z2.strictObject({
|
|
238
|
-
availability: z2.enum(["authoritative", "legacy_not_enabled"]),
|
|
239
|
-
revision: count.nullable(),
|
|
240
|
-
confirmed: tokens.nullable(),
|
|
241
|
-
reserved: tokens.nullable(),
|
|
242
|
-
unknown: tokens.nullable(),
|
|
243
|
-
remaining: tokens.nullable(),
|
|
244
|
-
limits: tokens.nullable(),
|
|
245
|
-
estimated: z2.null(),
|
|
246
|
-
estimation: z2.literal("not_separately_recorded"),
|
|
247
|
-
usageComplete: z2.boolean().nullable(),
|
|
248
|
-
admissionsClosed: z2.boolean().nullable(),
|
|
249
|
-
monetary: z2.strictObject({ estimatedConfirmedUsd: z2.number().finite().nonnegative().nullable(), reservedUsd: z2.number().finite().nonnegative().nullable(), unknownHeldUsd: z2.number().finite().nonnegative().nullable(), remainingUsd: z2.number().finite().nonnegative().nullable(), unknown: z2.boolean(), costKind: z2.literal("estimate-not-invoice") })
|
|
250
|
-
}),
|
|
251
|
-
effects: z2.strictObject({ readOnly: count, recorded: count, unknown: count, missingEvidence: z2.boolean(), automaticReplay: z2.literal(false), providerStopped: z2.literal("unconfirmed") }),
|
|
252
|
-
nextAction: z2.strictObject({
|
|
253
|
-
kind: z2.enum(["wait", "reconcile", "review_approval", "review_delivery", "explicit_continuation"]),
|
|
254
|
-
permitted: z2.literal("read_only"),
|
|
255
|
-
authorization: z2.literal("required_for_execution"),
|
|
256
|
-
preserves: z2.literal("contract_receipts_budget_and_effects"),
|
|
257
|
-
automaticReplay: z2.literal(false)
|
|
258
|
-
}),
|
|
259
|
-
diagnostic: z2.strictObject({ code: z2.enum(["EXECUTION_FAILED", "EXECUTION_CANCELLED", "EXECUTION_TIMED_OUT", "EVIDENCE_INCOMPLETE"]), cause: z2.enum(["execution_terminal_failure", "operator_or_runtime_cancellation", "execution_deadline", "receipts_missing_or_stale"]), impact: z2.literal("acceptance_not_established"), safeAction: z2.enum(["review_configuration", "reconcile", "review_delivery"]) }).nullable(),
|
|
260
|
-
reasons: z2.array(z2.string().regex(/^[A-Z][A-Z0-9_]{0,95}$/)).max(32),
|
|
261
|
-
provenance: z2.literal("host_durable_contract_journal_budget_and_fresh_native_snapshot"),
|
|
262
|
-
textTruncated: z2.boolean()
|
|
263
|
-
})
|
|
264
|
-
});
|
|
265
|
-
function reduceHarnessTaskProjection(current, incoming, expected) {
|
|
266
|
-
const inScope = (value) => ["connectionId", "projectId", "sessionId", "runId"].every((key) => value[key] === expected[key]);
|
|
267
|
-
const previous = harnessTaskProjectionSchema.safeParse(current);
|
|
268
|
-
const retained = previous.success && inScope(previous.data) ? previous.data : null;
|
|
269
|
-
let encoded;
|
|
270
|
-
try {
|
|
271
|
-
encoded = JSON.stringify(incoming);
|
|
272
|
-
} catch {
|
|
273
|
-
return { status: "refresh_required", snapshot: retained };
|
|
274
|
-
}
|
|
275
|
-
if (new TextEncoder().encode(encoded).length > 64 * 1024)
|
|
276
|
-
return { status: "refresh_required", snapshot: retained };
|
|
277
|
-
const parsed = harnessTaskProjectionSchema.safeParse(incoming);
|
|
278
|
-
if (!parsed.success || !inScope(parsed.data))
|
|
279
|
-
return { status: "refresh_required", snapshot: retained };
|
|
280
|
-
if (retained && parsed.data.sequence <= retained.sequence) {
|
|
281
|
-
if (parsed.data.sequence === retained.sequence && JSON.stringify(parsed.data) !== JSON.stringify(retained))
|
|
282
|
-
return { status: "refresh_required", snapshot: retained };
|
|
283
|
-
return { status: "ignored", snapshot: retained };
|
|
284
|
-
}
|
|
285
|
-
return { status: "applied", snapshot: parsed.data };
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export { CLI_JSON_SCHEMA_VERSION, CLI_EVENT_SCHEMA_VERSION, streamEventDocument, serializeStreamEvent, streamResultDocument, serializeStreamResult, HARNESS_CLIENT_PROTOCOL_VERSION, harnessClientCommandSchema, harnessClientRequestSchema, HARNESS_TASK_PROJECTION_VERSION, harnessTaskProjectionSchema, reduceHarnessTaskProjection };
|