@humain/humain-code 0.7.0 → 0.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 +139 -0
- package/README.md +2 -2
- package/dist/bundle/agent-monitor.js +1 -1
- package/dist/bundle/chunks/anthropic-messages-UZB5HJE3.js +77 -0
- package/dist/bundle/chunks/anthropic.js +25 -24
- package/dist/bundle/chunks/azure-openai-responses-J3LCMWPQ.js +15 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +460 -431
- package/dist/bundle/chunks/bowser-DXKSTXFQ.js +89 -0
- package/dist/bundle/chunks/{chunk-HTA325LJ.js → chunk-2NVGOSBN.js} +1 -1
- package/dist/bundle/chunks/{chunk-5B25YXF7.js → chunk-3CGMVKHA.js} +13 -3
- package/dist/bundle/chunks/{chunk-SCINMV4X.js → chunk-46C6D7UC.js} +22 -21
- package/dist/bundle/chunks/{chunk-RS6PZK35.js → chunk-4EV7CK26.js} +249 -216
- package/dist/bundle/chunks/{chunk-T7BXP46S.js → chunk-4SFWYKL5.js} +1848 -1662
- package/dist/bundle/chunks/{chunk-TGDPZCSW.js → chunk-4TDNOR36.js} +1 -1
- package/dist/bundle/chunks/{chunk-C6VERWRZ.js → chunk-4XF5JX7X.js} +1 -1
- package/dist/bundle/chunks/chunk-6HTHDVJC.js +4 -0
- package/dist/bundle/chunks/{chunk-2G7YVAVF.js → chunk-7EONJCBE.js} +1 -1
- package/dist/bundle/chunks/chunk-7H2WNBX7.js +11 -0
- package/dist/bundle/chunks/{chunk-2FYYW6FY.js → chunk-7OZNMWAJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-R6YQR7TZ.js → chunk-7WE77IE3.js} +1 -1
- package/dist/bundle/chunks/{chunk-Z5YLKK3S.js → chunk-7WETECIB.js} +1 -1
- package/dist/bundle/chunks/{chunk-EIC7CQX3.js → chunk-AI7EHDAX.js} +1 -1
- package/dist/bundle/chunks/{chunk-KRCX3ZBA.js → chunk-APNPBT7Y.js} +1 -1
- package/dist/bundle/chunks/{chunk-4HTVBBJD.js → chunk-ATFZAFMS.js} +2 -2
- package/dist/bundle/chunks/{chunk-R5OOX7RW.js → chunk-B47PNNLL.js} +9 -2
- package/dist/bundle/chunks/{chunk-AZXVJN6E.js → chunk-C4DHVDYT.js} +1 -1
- package/dist/bundle/chunks/{chunk-4PRNKB6V.js → chunk-CET2MXXN.js} +7 -7
- package/dist/bundle/chunks/{chunk-66FZJO75.js → chunk-CU6KU7JK.js} +472 -3924
- package/dist/bundle/chunks/{chunk-MD7K7RPN.js → chunk-D3KYOSQY.js} +1 -1
- package/dist/bundle/chunks/{chunk-I3NDOUHE.js → chunk-DCXHRP6C.js} +1 -1
- package/dist/bundle/chunks/{chunk-OB332KMV.js → chunk-DD5UT56Y.js} +46 -32
- package/dist/bundle/chunks/{chunk-G4QPSFBF.js → chunk-EMBIUIQ2.js} +216 -223
- package/dist/bundle/chunks/{chunk-Q7VXYXY3.js → chunk-ENBDASDN.js} +2 -2
- package/dist/bundle/chunks/{chunk-2H3LUS62.js → chunk-FJIISX5W.js} +241 -229
- package/dist/bundle/chunks/{chunk-WQOOJP7U.js → chunk-GV5OVRKK.js} +1 -1
- package/dist/bundle/chunks/{chunk-KTSJYIYC.js → chunk-HHWVVNGG.js} +1 -1
- package/dist/bundle/chunks/{chunk-4JRER4XK.js → chunk-HQMUDHC3.js} +19 -19
- package/dist/bundle/chunks/{chunk-WQ7EJQIT.js → chunk-IOLLZXQN.js} +225 -239
- package/dist/bundle/chunks/chunk-IXQYPQRQ.js +2079 -0
- package/dist/bundle/chunks/{chunk-RU7ADKA7.js → chunk-J4GII2EE.js} +112 -96
- package/dist/bundle/chunks/chunk-J5TSAJGC.js +22 -0
- package/dist/bundle/chunks/{chunk-QT6ZHDMP.js → chunk-JBSWWCT5.js} +1 -1
- package/dist/bundle/chunks/{chunk-P6AXBESH.js → chunk-JV7VHOAY.js} +1119 -1098
- package/dist/bundle/chunks/{chunk-PWUDFU5V.js → chunk-JWOPWHVH.js} +4 -4
- package/dist/bundle/chunks/{chunk-4V5VL2BO.js → chunk-KLSRGGOH.js} +131 -154
- package/dist/bundle/chunks/{chunk-JF7FYXAI.js → chunk-KONLZKPL.js} +7 -6
- package/dist/bundle/chunks/{chunk-32QLLD2P.js → chunk-KQXXBQ57.js} +360 -332
- package/dist/bundle/chunks/{chunk-UZNIPOGS.js → chunk-L4J7SMJB.js} +1 -1
- package/dist/bundle/chunks/chunk-MPRAQ6ZI.js +41 -0
- package/dist/bundle/chunks/{chunk-GUHNFZ2Q.js → chunk-NNWNIBLG.js} +20 -19
- package/dist/bundle/chunks/{chunk-TWAHPPXN.js → chunk-OVDMYBIT.js} +1307 -1194
- package/dist/bundle/chunks/{chunk-WAPZN4KP.js → chunk-P2Y2H7SD.js} +2 -2
- package/dist/bundle/chunks/{chunk-PPBDDQHP.js → chunk-PGVDL4KB.js} +7 -6
- package/dist/bundle/chunks/{chunk-XHDVDJM7.js → chunk-PVNXN2TC.js} +7 -7
- package/dist/bundle/chunks/{chunk-RNBZBCH2.js → chunk-QJB5YI3I.js} +1 -1
- package/dist/bundle/chunks/{chunk-I5E7RQ5V.js → chunk-QRYDGY5I.js} +5 -5
- package/dist/bundle/chunks/{chunk-4QAXV5T6.js → chunk-R3VDXQW2.js} +9 -9
- package/dist/bundle/chunks/chunk-SKCJ25SX.js +24 -0
- package/dist/bundle/chunks/chunk-SQ7NTRLJ.js +77 -0
- package/dist/bundle/chunks/{chunk-SSRCVJZK.js → chunk-TYN46EVI.js} +5 -5
- package/dist/bundle/chunks/{chunk-6E6RHNOU.js → chunk-UXM4WFLH.js} +12 -11
- package/dist/bundle/chunks/{chunk-LB4CIS4F.js → chunk-VCMXBP5S.js} +17 -17
- package/dist/bundle/chunks/{chunk-N2SNMUD3.js → chunk-VKQNYZUA.js} +1 -1
- package/dist/bundle/chunks/{chunk-JYWUOKOI.js → chunk-WBSGWISD.js} +367 -353
- package/dist/bundle/chunks/{chunk-3EDMWQ35.js → chunk-WGXMYMPE.js} +17 -15
- package/dist/bundle/chunks/chunk-WRYGY5XG.js +24 -0
- package/dist/bundle/chunks/{chunk-GRJUKEE3.js → chunk-XVIQYONJ.js} +4 -4
- package/dist/bundle/chunks/chunk-YSWDFV2L.js +11 -0
- package/dist/bundle/chunks/{chunk-AEWYICBL.js → chunk-Z5UFSRO4.js} +2 -2
- package/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/bundle/chunks/chunk-ZTG5OKI7.js +3 -0
- package/dist/bundle/chunks/{cli-H4LJNE2V.js → cli-6DJO467D.js} +2 -2
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-T5R2RVFQ.js → cloudflare-workers-ai-system-one-ETKC6B2S.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +68 -68
- package/dist/bundle/chunks/compat-HS4ARZK3.js +15 -0
- package/dist/bundle/chunks/curator-server-TC7RVVN2.js +3600 -0
- package/dist/bundle/chunks/dist-35STTNYA.js +37 -0
- package/dist/bundle/chunks/{dist-FMWWM4H7.js → dist-5AQPJ2TI.js} +2 -2
- package/dist/bundle/chunks/{dist-NHQTBDHT.js → dist-DYB3AR7C.js} +91 -257
- package/dist/bundle/chunks/dist-NMEXYUP3.js +11 -0
- package/dist/bundle/chunks/dist-cjs-EROMDUKS.js +193 -0
- package/dist/bundle/chunks/{easter-egg-3d-BUEOC3NO.js → easter-egg-3d-VVUF3C3X.js} +1 -1
- package/dist/bundle/chunks/entry-2GZ3PTWQ.js +2 -0
- package/dist/bundle/chunks/{entry-A2CSLKHC.js → entry-SRYLSS5P.js} +3 -3
- package/dist/bundle/chunks/{event-streams-7YGFEPBZ.js → event-streams-F67JLS6B.js} +1 -1
- package/dist/bundle/chunks/{execute-MY5JSEPV.js → execute-I3WGGPWL.js} +2 -2
- package/dist/bundle/chunks/{extract-PTGACPGP.js → extract-QHZTEVJP.js} +68 -65
- package/dist/bundle/chunks/{flow-implementer-APJFY4YI.js → flow-implementer-QMN3HKE2.js} +8 -9
- package/dist/bundle/chunks/github-copilot.js +55 -45
- package/dist/bundle/chunks/google-generative-ai-ZND73WDQ.js +22 -0
- package/dist/bundle/chunks/google-vertex-YAH62YRM.js +25 -0
- package/dist/bundle/chunks/host-Q565BCXB.js +3 -0
- package/dist/bundle/chunks/image-resize-worker.js +3 -3
- package/dist/bundle/chunks/{index.bundle-THL4EUSU.js → index.bundle-HONF3PUD.js} +177 -176
- package/dist/bundle/chunks/{inprocess-5NP5VJHZ.js → inprocess-453SLFL5.js} +6 -6
- package/dist/bundle/chunks/interactive-mode-MVZOJ5OU.js +5 -0
- package/dist/bundle/chunks/{llama-cpp-classify-GJAXULWL.js → llama-cpp-classify-Z4GZY4GC.js} +1 -1
- package/dist/bundle/chunks/mistral-conversations-7I5JURDP.js +43 -0
- package/dist/bundle/chunks/{node-ZFIIS5IM.js → node-IMSYVRPL.js} +53 -30
- package/dist/bundle/chunks/{node-UNHECG4X.js → node-MHHE76P4.js} +475 -440
- package/dist/bundle/chunks/{openai-codex-responses-S7CMCAOY.js → openai-codex-responses-LTHOMN37.js} +30 -29
- package/dist/bundle/chunks/openai-codex.js +9 -8
- package/dist/bundle/chunks/{openai-completions-2Z57N7PC.js → openai-completions-W2X635EE.js} +22 -22
- package/dist/bundle/chunks/{openai-decisions-JIOJDB4C.js → openai-decisions-TN2GNOYI.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5VBZSTHL.js → openai-responses-DVY4QXOG.js} +4 -5
- package/dist/bundle/chunks/{openrouter-images-S6O7DBEJ.js → openrouter-images-SE2JMS44.js} +1 -1
- package/dist/bundle/chunks/openrouter.js +9 -8
- package/dist/bundle/chunks/pdfjs-FE3L72A6.js +3662 -0
- package/dist/bundle/chunks/{pdfjs-decoders-OFXX4HDZ.js → pdfjs-decoders-VCMCTQJ2.js} +1 -1
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-I4K6AIV4.js +295 -0
- package/dist/bundle/chunks/pdfjs-openjpeg-PYQCV6CM.js +590 -0
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-G363SGDI.js +775 -0
- package/dist/bundle/chunks/{pi-messages-SMLN5J2W.js → pi-messages-WAS6Z5L5.js} +11 -11
- package/dist/bundle/chunks/radius.js +8 -7
- package/dist/bundle/chunks/{runtime-OYTWXIUM.js → runtime-H7LYNKCZ.js} +1 -1
- package/dist/bundle/chunks/session-picker-XNVLSJ22.js +4 -0
- package/dist/bundle/chunks/startup-ui-3TCT465D.js +3 -0
- package/dist/bundle/chunks/{trace-command-YLDYCL55.js → trace-command-7ORDQ3JS.js} +4 -4
- package/dist/bundle/chunks/{typesafe-system-one-7BEL3H5N.js → typesafe-system-one-AAZH6S3I.js} +1 -1
- package/dist/bundle/chunks/{undici-C6S56CGI.js → undici-WVNE45GY.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-CIVXCEAN.js +28 -0
- package/dist/bundle/cli-runtime.js +5 -5
- package/dist/bundle/flow/package.json +5 -5
- package/dist/bundle/index.js +13 -13
- package/dist/bundle/orchestrate/package.json +22 -6
- package/dist/bundle/rpc-entry.js +4 -5
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +9 -6
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +9 -6
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +8 -4
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +11 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +19 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +0 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +0 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +31 -39
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +231 -535
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-subscription-usage.d.ts +4 -2
- package/dist/core/anthropic-subscription-usage.d.ts.map +1 -1
- package/dist/core/anthropic-subscription-usage.js +32 -16
- package/dist/core/anthropic-subscription-usage.js.map +1 -1
- package/dist/core/auto-session-namer.js +1 -1
- package/dist/core/auto-session-namer.js.map +1 -1
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +2 -0
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/exec.d.ts +1 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +6 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +57 -20
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +18 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +5 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +5 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/flow-implementer.d.ts.map +1 -1
- package/dist/core/flow-implementer.js +3 -9
- package/dist/core/flow-implementer.js.map +1 -1
- package/dist/core/keybindings.d.ts +40 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +5 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +13 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-registry.d.ts +3 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +32 -8
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +3 -10
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +18 -7
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +41 -8
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-account-pool.d.ts +5 -0
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +34 -3
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/core/package-manager.d.ts +16 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +46 -3
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +1 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +7 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +5 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +2 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/run-outcome.d.ts +6 -3
- package/dist/core/run-outcome.d.ts.map +1 -1
- package/dist/core/run-outcome.js +36 -9
- package/dist/core/run-outcome.js.map +1 -1
- package/dist/core/run-preflight.d.ts +1 -1
- package/dist/core/run-preflight.d.ts.map +1 -1
- package/dist/core/run-preflight.js +19 -11
- package/dist/core/run-preflight.js.map +1 -1
- package/dist/core/sdk.d.ts +0 -6
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +7 -16
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +0 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +0 -9
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +0 -4
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +0 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/tools/bash-jobs.d.ts.map +1 -1
- package/dist/core/tools/bash-jobs.js +2 -9
- package/dist/core/tools/bash-jobs.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +28 -16
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts +8 -4
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +10 -15
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +6 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/subagent-worktree.d.ts.map +1 -1
- package/dist/core/tools/subagent-worktree.js +2 -10
- package/dist/core/tools/subagent-worktree.js.map +1 -1
- package/dist/core/trace-client/credential-store.d.ts.map +1 -1
- package/dist/core/trace-client/credential-store.js +9 -5
- package/dist/core/trace-client/credential-store.js.map +1 -1
- package/dist/extensions/codemode/execute.js +2 -2
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -4
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/usage/account-reconnect.d.ts +5 -0
- package/dist/extensions/usage/account-reconnect.d.ts.map +1 -0
- package/dist/extensions/usage/account-reconnect.js +12 -0
- package/dist/extensions/usage/account-reconnect.js.map +1 -0
- package/dist/extensions/usage/hcode-overview.d.ts +6 -19
- package/dist/extensions/usage/hcode-overview.d.ts.map +1 -1
- package/dist/extensions/usage/hcode-overview.js +86 -100
- package/dist/extensions/usage/hcode-overview.js.map +1 -1
- package/dist/extensions/usage/index.d.ts.map +1 -1
- package/dist/extensions/usage/index.js +74 -98
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/extensions/usage/overview.d.ts +22 -17
- package/dist/extensions/usage/overview.d.ts.map +1 -1
- package/dist/extensions/usage/overview.js +98 -13
- package/dist/extensions/usage/overview.js.map +1 -1
- package/dist/extensions/usage/popup.d.ts +9 -14
- package/dist/extensions/usage/popup.d.ts.map +1 -1
- package/dist/extensions/usage/popup.js +78 -165
- package/dist/extensions/usage/popup.js.map +1 -1
- package/dist/humain/bedrock-provider/vendor/index.bundle.mjs +4 -1
- package/dist/humain/flow-command.js +1 -1
- package/dist/humain/flow-command.js.map +1 -1
- package/dist/humain/flow-loader.d.ts +9 -4
- package/dist/humain/flow-loader.d.ts.map +1 -1
- package/dist/humain/flow-loader.js +30 -21
- package/dist/humain/flow-loader.js.map +1 -1
- package/dist/humain/gateway/client.d.ts +3 -1
- package/dist/humain/gateway/client.d.ts.map +1 -1
- package/dist/humain/gateway/client.js +10 -5
- package/dist/humain/gateway/client.js.map +1 -1
- package/dist/humain/gateway/login.d.ts.map +1 -1
- package/dist/humain/gateway/login.js +160 -53
- package/dist/humain/gateway/login.js.map +1 -1
- package/dist/humain/hcode/account-store.d.ts +29 -5
- package/dist/humain/hcode/account-store.d.ts.map +1 -1
- package/dist/humain/hcode/account-store.js +224 -124
- package/dist/humain/hcode/account-store.js.map +1 -1
- package/dist/humain/hcode/account.d.ts +6 -0
- package/dist/humain/hcode/account.d.ts.map +1 -1
- package/dist/humain/hcode/account.js +348 -129
- package/dist/humain/hcode/account.js.map +1 -1
- package/dist/humain/hcode/catalog-watch.d.ts +21 -0
- package/dist/humain/hcode/catalog-watch.d.ts.map +1 -0
- package/dist/humain/hcode/catalog-watch.js +46 -0
- package/dist/humain/hcode/catalog-watch.js.map +1 -0
- package/dist/humain/hcode/contracts.d.ts +16 -1
- package/dist/humain/hcode/contracts.d.ts.map +1 -1
- package/dist/humain/hcode/contracts.js +122 -128
- package/dist/humain/hcode/contracts.js.map +1 -1
- package/dist/humain/hcode/environment.d.ts +3 -1
- package/dist/humain/hcode/environment.d.ts.map +1 -1
- package/dist/humain/hcode/environment.js +12 -2
- package/dist/humain/hcode/environment.js.map +1 -1
- package/dist/humain/hcode/facade.d.ts +26 -6
- package/dist/humain/hcode/facade.d.ts.map +1 -1
- package/dist/humain/hcode/facade.js +148 -38
- package/dist/humain/hcode/facade.js.map +1 -1
- package/dist/humain/hcode/http.d.ts +3 -1
- package/dist/humain/hcode/http.d.ts.map +1 -1
- package/dist/humain/hcode/http.js +44 -23
- package/dist/humain/hcode/http.js.map +1 -1
- package/dist/humain/hcode/images.d.ts +67 -0
- package/dist/humain/hcode/images.d.ts.map +1 -0
- package/dist/humain/hcode/images.js +463 -0
- package/dist/humain/hcode/images.js.map +1 -0
- package/dist/humain/hcode/login-copy.d.ts +28 -0
- package/dist/humain/hcode/login-copy.d.ts.map +1 -0
- package/dist/humain/hcode/login-copy.js +74 -0
- package/dist/humain/hcode/login-copy.js.map +1 -0
- package/dist/humain/hcode/login-failure.d.ts +26 -0
- package/dist/humain/hcode/login-failure.d.ts.map +1 -0
- package/dist/humain/hcode/login-failure.js +50 -0
- package/dist/humain/hcode/login-failure.js.map +1 -0
- package/dist/humain/hcode/notices.d.ts +24 -1
- package/dist/humain/hcode/notices.d.ts.map +1 -1
- package/dist/humain/hcode/notices.js +93 -7
- package/dist/humain/hcode/notices.js.map +1 -1
- package/dist/humain/hcode/provider.d.ts +7 -3
- package/dist/humain/hcode/provider.d.ts.map +1 -1
- package/dist/humain/hcode/provider.js +123 -19
- package/dist/humain/hcode/provider.js.map +1 -1
- package/dist/humain/hcode/selection.d.ts +2 -0
- package/dist/humain/hcode/selection.d.ts.map +1 -1
- package/dist/humain/hcode/selection.js +8 -1
- package/dist/humain/hcode/selection.js.map +1 -1
- package/dist/humain/hcode/transport.d.ts +13 -10
- package/dist/humain/hcode/transport.d.ts.map +1 -1
- package/dist/humain/hcode/transport.js +103 -148
- package/dist/humain/hcode/transport.js.map +1 -1
- package/dist/humain/hcode/wire.d.ts +3 -0
- package/dist/humain/hcode/wire.d.ts.map +1 -1
- package/dist/humain/hcode/wire.js +11 -0
- package/dist/humain/hcode/wire.js.map +1 -1
- package/dist/humain/metadata/contracts.d.ts +1 -0
- package/dist/humain/metadata/contracts.d.ts.map +1 -1
- package/dist/humain/metadata/contracts.js +2 -1
- package/dist/humain/metadata/contracts.js.map +1 -1
- package/dist/humain/web-access/vendor/anysearch.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/anysearch.js +7 -3
- package/dist/humain/web-access/vendor/anysearch.js.map +1 -1
- package/dist/humain/web-access/vendor/autom.d.ts +4 -0
- package/dist/humain/web-access/vendor/autom.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/autom.js +191 -0
- package/dist/humain/web-access/vendor/autom.js.map +1 -0
- package/dist/humain/web-access/vendor/cloro.d.ts +4 -0
- package/dist/humain/web-access/vendor/cloro.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/cloro.js +236 -0
- package/dist/humain/web-access/vendor/cloro.js.map +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +7 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +6 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts +8 -0
- package/dist/humain/web-access/vendor/domain-filter-normalization.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/domain-filter-normalization.js +37 -0
- package/dist/humain/web-access/vendor/domain-filter-normalization.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts +28 -8
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js +135 -34
- package/dist/humain/web-access/vendor/duckduckgo-rate-limit.js.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.d.ts +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/duckduckgo.js +10 -3
- package/dist/humain/web-access/vendor/duckduckgo.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +61 -5
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.d.ts +3 -3
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +35 -5
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +8 -1
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/page-query.d.ts +5 -0
- package/dist/humain/web-access/vendor/page-query.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/page-query.js +12 -2
- package/dist/humain/web-access/vendor/page-query.js.map +1 -1
- package/dist/humain/web-access/vendor/specstream.d.ts +6 -0
- package/dist/humain/web-access/vendor/specstream.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/specstream.js +253 -0
- package/dist/humain/web-access/vendor/specstream.js.map +1 -0
- package/dist/humain/web-access/vendor/tool-activation.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/tool-activation.js +21 -5
- package/dist/humain/web-access/vendor/tool-activation.js.map +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.d.ts +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.js +1 -1
- package/dist/humain/web-access/vendor/upgrade-notice.js.map +1 -1
- package/dist/humain/web-access/vendor/utils.d.ts +1 -0
- package/dist/humain/web-access/vendor/utils.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/utils.js +3 -0
- package/dist/humain/web-access/vendor/utils.js.map +1 -1
- package/dist/humain/web-access/vendor/video-extract.js +2 -2
- package/dist/humain/web-access/vendor/video-extract.js.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.d.ts +13 -0
- package/dist/humain/web-access/vendor/web-tool-core.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/web-tool-core.js +16 -5
- package/dist/humain/web-access/vendor/web-tool-core.js.map +1 -1
- package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
- package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +96 -28
- package/dist/main.js.map +1 -1
- package/dist/modes/diagnostics-stderr.d.ts +4 -0
- package/dist/modes/diagnostics-stderr.d.ts.map +1 -0
- package/dist/modes/diagnostics-stderr.js +11 -0
- package/dist/modes/diagnostics-stderr.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +5 -2
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +14 -5
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +2 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +6 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +10 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +101 -23
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +5 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +17 -6
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +2 -1
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +13 -6
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +8 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +41 -9
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.js +5 -1
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -17
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +1 -78
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts +1 -1
- package/dist/modes/interactive/components/themed-text.d.ts.map +1 -1
- package/dist/modes/interactive/components/themed-text.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +5 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.js +14 -5
- package/dist/modes/interactive/components/trust-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts +2 -2
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +20 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +605 -223
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.d.ts +4 -0
- package/dist/modes/interactive/model-catalog-refresh.d.ts.map +1 -1
- package/dist/modes/interactive/model-catalog-refresh.js +40 -1
- package/dist/modes/interactive/model-catalog-refresh.js.map +1 -1
- package/dist/modes/interactive/oauth-account-format.d.ts +6 -2
- package/dist/modes/interactive/oauth-account-format.d.ts.map +1 -1
- package/dist/modes/interactive/oauth-account-format.js +12 -3
- package/dist/modes/interactive/oauth-account-format.js.map +1 -1
- package/dist/modes/interactive/session-share.js +2 -0
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +1 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +30 -32
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +26 -39
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +1 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +14 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/abort.d.ts +5 -0
- package/dist/utils/abort.d.ts.map +1 -1
- package/dist/utils/abort.js +9 -0
- package/dist/utils/abort.js.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +3 -2
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/flush-stdout.d.ts +8 -0
- package/dist/utils/flush-stdout.d.ts.map +1 -0
- package/dist/utils/flush-stdout.js +23 -0
- package/dist/utils/flush-stdout.js.map +1 -0
- package/dist/utils/image-process.d.ts +2 -0
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-process.js +3 -3
- package/dist/utils/image-process.js.map +1 -1
- package/dist/utils/image-resize-core.js +2 -2
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/shell.d.ts +2 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +19 -0
- package/dist/utils/shell.js.map +1 -1
- package/docs/cli.md +1 -1
- package/docs/development.md +0 -13
- package/docs/extensions.md +6 -4
- package/docs/flow.md +4 -62
- package/docs/humain-code-forge-architecture.md +1 -47
- package/docs/humain-code-forge-flow-walkthrough.md +1 -1
- package/docs/humain-code.md +1 -1
- package/docs/keybindings.md +2 -0
- package/docs/llama-cpp.md +5 -5
- package/docs/models-configuration.md +4 -2
- package/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/docs/providers.md +14 -9
- package/docs/rpc-commands.md +1 -1
- package/docs/run-preflight.md +1 -1
- package/docs/slash-commands.md +1 -1
- package/docs/tui.md +2 -0
- package/examples/README.md +0 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/gondolin/index.ts +4 -7
- package/examples/tsconfig.json +96 -76
- package/npm-shrinkwrap.json +285 -764
- package/package.json +24 -37
- package/schemas/keybindings.schema.json +20 -0
- package/schemas/models.schema.json +5 -1
- package/schemas/settings.schema.json +0 -13
- package/src/humain/web-access/UPSTREAM.md +52 -1
- package/src/humain/web-access/upstream.json +5 -5
- package/src/humain/web-access/vendor/CHANGELOG.md +29 -0
- package/dist/bundle/chunks/adaptive-peer-worker-X2ZNZE3S.js +0 -8
- package/dist/bundle/chunks/adaptive-session-host-7KDSQV5I.js +0 -162
- package/dist/bundle/chunks/anthropic-messages-TQK3FUV3.js +0 -68
- package/dist/bundle/chunks/azure-openai-responses-JY7OSLH2.js +0 -15
- package/dist/bundle/chunks/chunk-5L4PBYC7.js +0 -11
- package/dist/bundle/chunks/chunk-6PNQYO6A.js +0 -10
- package/dist/bundle/chunks/chunk-CRN54O4D.js +0 -24
- package/dist/bundle/chunks/chunk-CTU2ECLD.js +0 -7
- package/dist/bundle/chunks/chunk-DBL35X7L.js +0 -3
- package/dist/bundle/chunks/chunk-GME4AWDG.js +0 -23
- package/dist/bundle/chunks/chunk-GTILMMUF.js +0 -12
- package/dist/bundle/chunks/chunk-J57HOSWD.js +0 -21
- package/dist/bundle/chunks/chunk-KQM7ZGL6.js +0 -11
- package/dist/bundle/chunks/chunk-MX4Q4W6H.js +0 -214
- package/dist/bundle/chunks/chunk-NXA6NEHE.js +0 -54
- package/dist/bundle/chunks/chunk-PJACZCIR.js +0 -2
- package/dist/bundle/chunks/chunk-T5A6T24H.js +0 -93
- package/dist/bundle/chunks/chunk-WCFHG6NO.js +0 -16
- package/dist/bundle/chunks/chunk-ZJUU6WOV.js +0 -2052
- package/dist/bundle/chunks/compat-ZK2DIW3P.js +0 -15
- package/dist/bundle/chunks/dist-EY7YKQHB.js +0 -11
- package/dist/bundle/chunks/dist-J5IUPLMH.js +0 -37
- package/dist/bundle/chunks/dist-cjs-2SKN226B.js +0 -184
- package/dist/bundle/chunks/entry-AL54ZGYO.js +0 -2
- package/dist/bundle/chunks/es5-GYTRHFKS.js +0 -77
- package/dist/bundle/chunks/google-generative-ai-UL7YEQ6J.js +0 -21
- package/dist/bundle/chunks/google-vertex-OTMSPUYH.js +0 -26
- package/dist/bundle/chunks/host-75YAHLDR.js +0 -3
- package/dist/bundle/chunks/interactive-mode-IW4PIVAQ.js +0 -5
- package/dist/bundle/chunks/mistral-conversations-E72Y6OC3.js +0 -43
- package/dist/bundle/chunks/pdfjs-AKD6EBKN.js +0 -3614
- package/dist/bundle/chunks/pdfjs-jbig2_nowasm_fallback-FH3KJM4H.js +0 -326
- package/dist/bundle/chunks/pdfjs-openjpeg-SKR7C34X.js +0 -671
- package/dist/bundle/chunks/pdfjs-openjpeg_nowasm_fallback-VUBL7UEE.js +0 -974
- package/dist/bundle/chunks/session-picker-DM6S37IF.js +0 -4
- package/dist/bundle/chunks/startup-ui-4GGLWNSU.js +0 -3
- package/dist/bundle/chunks/virtual-modules-TI3W24YL.js +0 -28
- package/dist/core/internal-process.d.ts +0 -23
- package/dist/core/internal-process.d.ts.map +0 -1
- package/dist/core/internal-process.js +0 -88
- package/dist/core/internal-process.js.map +0 -1
- package/dist/humain/adaptive-execution.d.ts +0 -51
- package/dist/humain/adaptive-execution.d.ts.map +0 -1
- package/dist/humain/adaptive-execution.js +0 -100
- package/dist/humain/adaptive-execution.js.map +0 -1
- package/dist/humain/adaptive-peer-process.d.ts +0 -44
- package/dist/humain/adaptive-peer-process.d.ts.map +0 -1
- package/dist/humain/adaptive-peer-process.js +0 -159
- package/dist/humain/adaptive-peer-process.js.map +0 -1
- package/dist/humain/adaptive-peer-worker.d.ts +0 -3
- package/dist/humain/adaptive-peer-worker.d.ts.map +0 -1
- package/dist/humain/adaptive-peer-worker.js +0 -122
- package/dist/humain/adaptive-peer-worker.js.map +0 -1
- package/dist/humain/adaptive-runtime-types.d.ts +0 -621
- package/dist/humain/adaptive-runtime-types.d.ts.map +0 -1
- package/dist/humain/adaptive-runtime-types.js +0 -3
- package/dist/humain/adaptive-runtime-types.js.map +0 -1
- package/dist/humain/adaptive-session-host.d.ts +0 -113
- package/dist/humain/adaptive-session-host.d.ts.map +0 -1
- package/dist/humain/adaptive-session-host.js +0 -1838
- package/dist/humain/adaptive-session-host.js.map +0 -1
- package/dist/utils/deprecation.d.ts +0 -4
- package/dist/utils/deprecation.d.ts.map +0 -1
- package/dist/utils/deprecation.js +0 -13
- package/dist/utils/deprecation.js.map +0 -1
- package/examples/plugins/pi-example-plugin/README.md +0 -38
- package/examples/plugins/pi-example-plugin/package.json +0 -10
- package/examples/plugins/pi-example-plugin/src/contract.ts +0 -13
- package/examples/plugins/pi-example-plugin/src/session.ts +0 -24
- package/examples/plugins/pi-example-plugin/src/tui.ts +0 -31
|
@@ -10,6 +10,15 @@ import { assertPrivateWindowsPath } from "../../core/private-windows-path.js";
|
|
|
10
10
|
import { spawnCommand } from "../../core/trace-client/credential-store.js";
|
|
11
11
|
import { resolveHcodeEnvironment } from "./environment.js";
|
|
12
12
|
import * as wire from "./wire.js";
|
|
13
|
+
/** The replacement envelope definitely never became visible; its token may be retired. */
|
|
14
|
+
export class HcodeUncommittedRotationError extends Error {
|
|
15
|
+
}
|
|
16
|
+
/** A refresh may have consumed the retained token; the user must replace the grant rather than retry it. */
|
|
17
|
+
export class HcodeUncertainRotationError extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super("HUMAIN Code sign-in renewal could not be confirmed. Sign in again.");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
13
22
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
14
23
|
const MAX_GRANT = 1048576;
|
|
15
24
|
const MAX_ENVELOPE = 1400000;
|
|
@@ -112,100 +121,128 @@ export class HcodeAccountStore {
|
|
|
112
121
|
if (existsSync(path))
|
|
113
122
|
await this.acl(path, signal);
|
|
114
123
|
await this.keyStore().probe(signal);
|
|
115
|
-
if (state.current
|
|
124
|
+
if (state.current)
|
|
116
125
|
await this.decrypt(state.current, undefined, signal);
|
|
117
126
|
signal.throwIfAborted();
|
|
118
127
|
}
|
|
119
|
-
/** Recovers durable
|
|
120
|
-
async recover(signal) {
|
|
121
|
-
await this.locked(async () => { }, "recover", signal);
|
|
128
|
+
/** Recovers durable intents, replacements and logout markers under the same lock used by every mutation. */
|
|
129
|
+
async recover(signal, retire) {
|
|
130
|
+
await this.locked(async () => { }, "recover", signal, retire);
|
|
122
131
|
}
|
|
123
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Probes the purpose-key store, obtains a grant without holding the account lock, then stores it under the lock
|
|
134
|
+
* only if the account observed before `obtain` is still current. A failed replacement leaves the old grant intact.
|
|
135
|
+
*/
|
|
124
136
|
async replace(binding, obtain, retire, publish) {
|
|
125
137
|
this.assertEnvironment(binding.environmentId);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
await this.keyStore().set(`${this.environment.id}:${generation}`, key.toString("base64"));
|
|
140
|
-
if ((await this.keyStore().get(`${this.environment.id}:${generation}`)) !== key.toString("base64"))
|
|
141
|
-
throw new Error(STORAGE_ERROR);
|
|
142
|
-
const result = await obtain();
|
|
143
|
-
obtained = result.grant;
|
|
144
|
-
const reference = {
|
|
145
|
-
environmentId: wire.string(binding.environmentId),
|
|
146
|
-
accountId: wire.string(result.accountId),
|
|
147
|
-
generation,
|
|
148
|
-
};
|
|
149
|
-
const next = {
|
|
150
|
-
environmentId: binding.environmentId,
|
|
151
|
-
issuer: binding.issuer,
|
|
152
|
-
clientId: binding.clientId,
|
|
153
|
-
reference,
|
|
154
|
-
};
|
|
155
|
-
const old = state.current;
|
|
156
|
-
// Logout of the observed old generation also cancels an in-flight replacement.
|
|
157
|
-
if (old && this.tombstoned(old.reference))
|
|
158
|
-
throw new Error("HUMAIN Code account changed. Sign in again.");
|
|
159
|
-
assertLock();
|
|
160
|
-
this.atomic(`${generation}.enc`, this.encrypt(next, parseGrant(result.grant), key));
|
|
161
|
-
this.atomic("replacement.json", JSON.stringify({ previous: old, candidate: next }));
|
|
162
|
-
journaled = true;
|
|
163
|
-
const published = {
|
|
164
|
-
...state,
|
|
165
|
-
current: next,
|
|
166
|
-
intents: state.intents.filter((id) => id !== generation),
|
|
167
|
-
};
|
|
168
|
-
this.saveState(published);
|
|
169
|
-
// Publication is the decision; its journal survives until retirement also finishes.
|
|
170
|
-
await publish?.(reference);
|
|
171
|
-
Object.assign(state, published);
|
|
138
|
+
await this.keyStore().probe();
|
|
139
|
+
const observed = this.status(this.environment.id);
|
|
140
|
+
// A device sign-in can wait minutes; other windows keep using the saved account meanwhile.
|
|
141
|
+
const result = await obtain();
|
|
142
|
+
let entered = false;
|
|
143
|
+
try {
|
|
144
|
+
return await this.locked(async (state, assertLock) => {
|
|
145
|
+
entered = true;
|
|
146
|
+
return this.commit(binding, result, observed, state, assertLock, retire, publish);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
if (!entered && retire) {
|
|
172
151
|
try {
|
|
173
|
-
await
|
|
152
|
+
await retire(result.grant);
|
|
174
153
|
}
|
|
175
154
|
catch {
|
|
176
|
-
|
|
177
|
-
this.cleanupIncomplete = true;
|
|
155
|
+
/* The lock failure is the reported error. */
|
|
178
156
|
}
|
|
179
|
-
if (!sameReference(state.current?.reference, reference))
|
|
180
|
-
throw new Error("HUMAIN Code account reference changed. Sign in again.");
|
|
181
|
-
return reference;
|
|
182
157
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** Stores an obtained grant as the new current account; runs under the account lock. */
|
|
162
|
+
async commit(binding, result, observed, state, assertLock, retire, publish) {
|
|
163
|
+
const generation = randomUUID();
|
|
164
|
+
let key;
|
|
165
|
+
let journaled = false;
|
|
166
|
+
const retireBound = async (issued, grant) => {
|
|
167
|
+
if (retire)
|
|
168
|
+
await retire(sameBinding(issued, binding) ? grant : null);
|
|
169
|
+
};
|
|
170
|
+
try {
|
|
171
|
+
state.intents.push(generation);
|
|
172
|
+
this.saveState(state);
|
|
173
|
+
key = randomBytes(32);
|
|
174
|
+
await this.keyStore().set(`${this.environment.id}:${generation}`, key.toString("base64"));
|
|
175
|
+
if ((await this.keyStore().get(`${this.environment.id}:${generation}`)) !== key.toString("base64"))
|
|
176
|
+
throw new Error(STORAGE_ERROR);
|
|
177
|
+
const reference = {
|
|
178
|
+
environmentId: wire.string(binding.environmentId),
|
|
179
|
+
accountId: wire.string(result.accountId),
|
|
180
|
+
generation,
|
|
181
|
+
};
|
|
182
|
+
const next = {
|
|
183
|
+
environmentId: binding.environmentId,
|
|
184
|
+
issuer: binding.issuer,
|
|
185
|
+
clientId: binding.clientId,
|
|
186
|
+
reference,
|
|
187
|
+
};
|
|
188
|
+
const old = state.current;
|
|
189
|
+
// Another window replaced or removed the observed account, or logged it out, while this grant was obtained.
|
|
190
|
+
if ((old !== null || observed !== null) &&
|
|
191
|
+
(!sameReference(old?.reference, observed) || this.tombstoned(old.reference)))
|
|
192
|
+
throw new Error("HUMAIN Code account changed. Sign in again.");
|
|
193
|
+
assertLock();
|
|
194
|
+
this.atomic(`${generation}.enc`, this.encrypt(next, parseGrant(result.grant), key));
|
|
195
|
+
this.atomic("replacement.json", JSON.stringify({ previous: old, candidate: next }), () => {
|
|
196
|
+
journaled = true;
|
|
197
|
+
});
|
|
198
|
+
const published = {
|
|
199
|
+
...state,
|
|
200
|
+
current: next,
|
|
201
|
+
intents: state.intents.filter((id) => id !== generation),
|
|
202
|
+
};
|
|
203
|
+
this.saveState(published);
|
|
204
|
+
// Publication is the decision; its journal survives until retirement also finishes.
|
|
205
|
+
await publish?.(reference);
|
|
206
|
+
Object.assign(state, published);
|
|
207
|
+
try {
|
|
208
|
+
await this.finishReplacement(state, assertLock, undefined, retireBound);
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// Never revoke or roll back a published candidate because later cleanup failed.
|
|
212
|
+
this.cleanupIncomplete = true;
|
|
213
|
+
}
|
|
214
|
+
if (!sameReference(state.current?.reference, reference))
|
|
215
|
+
throw new Error("HUMAIN Code account reference changed. Sign in again.");
|
|
216
|
+
return reference;
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
if (journaled) {
|
|
220
|
+
await this.finishReplacement(state, assertLock, undefined, retireBound);
|
|
221
|
+
// A write-then-reject publisher whose CAS compensation failed may still have committed.
|
|
222
|
+
if (state.current?.reference.generation === generation)
|
|
223
|
+
return state.current.reference;
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
if (retire) {
|
|
227
|
+
try {
|
|
228
|
+
await retire(result.grant);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
/* Local cleanup must still run. */
|
|
198
232
|
}
|
|
199
|
-
await this.cleanup(state);
|
|
200
233
|
}
|
|
201
|
-
|
|
234
|
+
await this.cleanup(state);
|
|
202
235
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
finally {
|
|
239
|
+
key?.fill(0);
|
|
240
|
+
}
|
|
207
241
|
}
|
|
208
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* Uses a grant only while its captured binding/generation remains current. An uncertain rotation retains the
|
|
244
|
+
* grant for retirement or replacement, but fences refresh replay across windows and restarts.
|
|
245
|
+
*/
|
|
209
246
|
async use(expected, binding, send, refresh, signal) {
|
|
210
247
|
this.validateReference(expected);
|
|
211
248
|
this.assertEnvironment(binding.environmentId);
|
|
@@ -214,29 +251,59 @@ export class HcodeAccountStore {
|
|
|
214
251
|
let grant = await this.decrypt(current, undefined, signal);
|
|
215
252
|
signal?.throwIfAborted();
|
|
216
253
|
assertLock();
|
|
217
|
-
if (refresh && grant.expiresAt <= Date.now() + 30000) {
|
|
218
|
-
// Resolve cancellable OS work before
|
|
254
|
+
if (refresh && (grant.pendingVerification || grant.expiresAt <= Date.now() + 30000)) {
|
|
255
|
+
// Resolve cancellable OS work before the refresh request; the request itself is never cancelled here.
|
|
219
256
|
const key = await this.key(current.reference.generation, signal);
|
|
257
|
+
let outcome;
|
|
220
258
|
try {
|
|
221
259
|
signal?.throwIfAborted();
|
|
222
260
|
assertLock();
|
|
223
261
|
this.requireCurrent(state, expected, binding);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
262
|
+
outcome = await refresh(grant, (next) => {
|
|
263
|
+
const rotating = state.rotation === expected.generation;
|
|
264
|
+
let staged = false;
|
|
265
|
+
try {
|
|
266
|
+
assertLock();
|
|
267
|
+
const parsed = parseRefreshGrant(next);
|
|
268
|
+
const envelope = this.encrypt(current, parsed, key);
|
|
269
|
+
if (rotating)
|
|
270
|
+
this.atomic(`${expected.generation}.rotation`, envelope, () => {
|
|
271
|
+
staged = true;
|
|
272
|
+
});
|
|
273
|
+
this.atomic(`${expected.generation}.enc`, envelope);
|
|
274
|
+
if (rotating) {
|
|
275
|
+
state.rotation = null;
|
|
276
|
+
this.saveState(state);
|
|
277
|
+
}
|
|
278
|
+
grant = parsed;
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
if (rotating && !staged)
|
|
282
|
+
throw new HcodeUncommittedRotationError(STORAGE_ERROR);
|
|
283
|
+
throw error;
|
|
284
|
+
}
|
|
285
|
+
}, (inFlight) => {
|
|
286
|
+
assertLock();
|
|
287
|
+
if (inFlight && state.rotation !== null)
|
|
288
|
+
throw new HcodeUncertainRotationError();
|
|
289
|
+
state.rotation = inFlight ? expected.generation : null;
|
|
290
|
+
this.saveState(state);
|
|
291
|
+
});
|
|
230
292
|
}
|
|
231
293
|
finally {
|
|
232
294
|
key.fill(0);
|
|
233
295
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
296
|
+
if (outcome === "rejected") {
|
|
297
|
+
assertLock();
|
|
298
|
+
state.current = null;
|
|
299
|
+
state.rotation = null;
|
|
300
|
+
this.saveState(state);
|
|
301
|
+
await this.cleanup(state);
|
|
302
|
+
throw new Error("HUMAIN Code sign-in expired. Sign in again.");
|
|
303
|
+
}
|
|
239
304
|
}
|
|
305
|
+
if (grant.pendingVerification)
|
|
306
|
+
throw new Error("HUMAIN Code account verification is pending.");
|
|
240
307
|
signal?.throwIfAborted();
|
|
241
308
|
assertLock();
|
|
242
309
|
this.requireCurrent(state, expected, binding);
|
|
@@ -277,19 +344,17 @@ export class HcodeAccountStore {
|
|
|
277
344
|
if (binding)
|
|
278
345
|
this.assertEnvironment(binding.environmentId);
|
|
279
346
|
this.tombstone(expected);
|
|
280
|
-
await this.locked(async (state) => {
|
|
347
|
+
await this.locked(async (state, assertLock) => {
|
|
281
348
|
if (sameReference(state.current?.reference, expected)) {
|
|
282
349
|
const current = state.current;
|
|
283
350
|
try {
|
|
284
|
-
const candidate = `${expected.generation}.rotation`;
|
|
285
351
|
if (binding && sameBinding(current, binding))
|
|
286
|
-
await revoke(await this.
|
|
287
|
-
? candidate
|
|
288
|
-
: `${expected.generation}.enc`));
|
|
352
|
+
await revoke(await this.grantForRetirement(state, current));
|
|
289
353
|
}
|
|
290
354
|
catch {
|
|
291
355
|
/* Removal is independent of remote availability. */
|
|
292
356
|
}
|
|
357
|
+
assertLock();
|
|
293
358
|
state.current = null;
|
|
294
359
|
state.rotation = null;
|
|
295
360
|
this.saveState(state);
|
|
@@ -297,6 +362,11 @@ export class HcodeAccountStore {
|
|
|
297
362
|
await this.cleanup(state);
|
|
298
363
|
}, "logout");
|
|
299
364
|
}
|
|
365
|
+
grantForRetirement(state, account, signal) {
|
|
366
|
+
const generation = account.reference.generation;
|
|
367
|
+
const staged = `${generation}.rotation`;
|
|
368
|
+
return this.decrypt(account, state.rotation === generation && this.read(staged, MAX_ENVELOPE) !== undefined ? staged : undefined, signal);
|
|
369
|
+
}
|
|
300
370
|
requireCurrent(state, expected, binding) {
|
|
301
371
|
this.validateReference(expected);
|
|
302
372
|
const current = state.current;
|
|
@@ -376,7 +446,7 @@ export class HcodeAccountStore {
|
|
|
376
446
|
const decipher = createDecipheriv("aes-256-gcm", key, nonce);
|
|
377
447
|
decipher.setAAD(this.aad(account));
|
|
378
448
|
decipher.setAuthTag(tag);
|
|
379
|
-
return
|
|
449
|
+
return parseRefreshGrant(JSON.parse(Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8")));
|
|
380
450
|
}
|
|
381
451
|
finally {
|
|
382
452
|
key.fill(0);
|
|
@@ -408,7 +478,7 @@ export class HcodeAccountStore {
|
|
|
408
478
|
saveState(state) {
|
|
409
479
|
this.atomic("state.json", JSON.stringify(state));
|
|
410
480
|
}
|
|
411
|
-
async locked(operation, intent = "use", signal) {
|
|
481
|
+
async locked(operation, intent = "use", signal, retire = this.publication?.retire) {
|
|
412
482
|
signal?.throwIfAborted();
|
|
413
483
|
this.guardParents(true);
|
|
414
484
|
for (const path of [dirname(dirname(this.dir)), dirname(this.dir), this.dir])
|
|
@@ -417,13 +487,15 @@ export class HcodeAccountStore {
|
|
|
417
487
|
await this.acl(join(this.dir, name), signal);
|
|
418
488
|
let compromised = false;
|
|
419
489
|
let release;
|
|
490
|
+
// About 30 s: another window's refresh holds the lock for up to two 10 s requests plus revocation.
|
|
491
|
+
const attempts = 300;
|
|
420
492
|
for (let attempt = 0;; attempt++) {
|
|
421
493
|
signal?.throwIfAborted();
|
|
422
494
|
try {
|
|
423
495
|
release = await lockfile.lock(this.dir, {
|
|
424
496
|
realpath: true,
|
|
425
497
|
// proper-lockfile's internal retry timers have no cancellation API.
|
|
426
|
-
retries: signal ? 0 : { retries:
|
|
498
|
+
retries: signal ? 0 : { retries: attempts, minTimeout: 20, maxTimeout: 100 },
|
|
427
499
|
onCompromised: () => {
|
|
428
500
|
compromised = true;
|
|
429
501
|
},
|
|
@@ -432,7 +504,7 @@ export class HcodeAccountStore {
|
|
|
432
504
|
}
|
|
433
505
|
catch (error) {
|
|
434
506
|
signal?.throwIfAborted();
|
|
435
|
-
if (!signal || attempt >=
|
|
507
|
+
if (!signal || attempt >= attempts)
|
|
436
508
|
throw error;
|
|
437
509
|
await delay(Math.min(20 * 2 ** attempt, 100), undefined, { signal });
|
|
438
510
|
}
|
|
@@ -447,28 +519,38 @@ export class HcodeAccountStore {
|
|
|
447
519
|
assertLock();
|
|
448
520
|
const state = this.readState();
|
|
449
521
|
await this.finishReplacement(state, assertLock, signal);
|
|
450
|
-
|
|
451
|
-
if (
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
522
|
+
const current = state.current;
|
|
523
|
+
if (current && this.tombstoned(current.reference)) {
|
|
524
|
+
// Normal readers must leave revocable material for serialized logout, not perform crash collection.
|
|
525
|
+
if (intent === "use")
|
|
526
|
+
throw new Error("HUMAIN Code account changed. Sign in again.");
|
|
527
|
+
if (intent === "recover") {
|
|
528
|
+
try {
|
|
529
|
+
// Recovery may acquire the lock ahead of the window that wrote the tombstone.
|
|
530
|
+
if (retire)
|
|
531
|
+
await retire(current, await this.grantForRetirement(state, current));
|
|
532
|
+
}
|
|
533
|
+
catch {
|
|
534
|
+
/* Logout remains effective offline. */
|
|
535
|
+
}
|
|
460
536
|
assertLock();
|
|
461
|
-
this.atomic(`${state.rotation}.enc`, this.read(`${state.rotation}.rotation`, MAX_ENVELOPE));
|
|
462
|
-
}
|
|
463
|
-
else if (current?.reference.generation === state.rotation)
|
|
464
537
|
state.current = null;
|
|
465
|
-
|
|
466
|
-
|
|
538
|
+
state.rotation = null;
|
|
539
|
+
this.saveState(state);
|
|
540
|
+
}
|
|
467
541
|
}
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
state.rotation
|
|
471
|
-
|
|
542
|
+
else if (state.rotation !== null) {
|
|
543
|
+
const staged = `${state.rotation}.rotation`;
|
|
544
|
+
const envelope = current?.reference.generation === state.rotation ? this.read(staged, MAX_ENVELOPE) : undefined;
|
|
545
|
+
if (envelope !== undefined && current) {
|
|
546
|
+
await this.decrypt(current, staged, signal);
|
|
547
|
+
assertLock();
|
|
548
|
+
this.atomic(`${state.rotation}.enc`, envelope);
|
|
549
|
+
}
|
|
550
|
+
if (envelope !== undefined || current?.reference.generation !== state.rotation) {
|
|
551
|
+
state.rotation = null;
|
|
552
|
+
this.saveState(state);
|
|
553
|
+
}
|
|
472
554
|
}
|
|
473
555
|
await this.cleanup(state, signal);
|
|
474
556
|
signal?.throwIfAborted();
|
|
@@ -505,14 +587,13 @@ export class HcodeAccountStore {
|
|
|
505
587
|
current = null;
|
|
506
588
|
}
|
|
507
589
|
state.current = current;
|
|
508
|
-
state.rotation = null;
|
|
509
590
|
this.saveState(state);
|
|
510
591
|
if (!forward && previous !== null && current === null)
|
|
511
592
|
await this.publication?.clear(published, signal);
|
|
512
593
|
const discarded = forward ? previous : candidate;
|
|
513
594
|
if (discarded && retire) {
|
|
514
595
|
try {
|
|
515
|
-
await retire(discarded, await this.
|
|
596
|
+
await retire(discarded, await this.grantForRetirement(state, discarded, signal));
|
|
516
597
|
}
|
|
517
598
|
catch {
|
|
518
599
|
/* Missing retired material or unavailable revocation must not prevent local cleanup. */
|
|
@@ -520,6 +601,10 @@ export class HcodeAccountStore {
|
|
|
520
601
|
}
|
|
521
602
|
signal?.throwIfAborted();
|
|
522
603
|
assertLock();
|
|
604
|
+
if (state.rotation !== null && state.rotation !== current?.reference.generation) {
|
|
605
|
+
state.rotation = null;
|
|
606
|
+
this.saveState(state);
|
|
607
|
+
}
|
|
523
608
|
await this.cleanup(state, signal);
|
|
524
609
|
assertLock();
|
|
525
610
|
this.removeFile("replacement.json");
|
|
@@ -545,7 +630,8 @@ export class HcodeAccountStore {
|
|
|
545
630
|
state.intents = [];
|
|
546
631
|
this.saveState(state);
|
|
547
632
|
}
|
|
548
|
-
|
|
633
|
+
// A staged envelope is needed only until the matching rotation marker has cleared.
|
|
634
|
+
if (current && current !== state.rotation)
|
|
549
635
|
this.removeFile(`${current}.rotation`);
|
|
550
636
|
}
|
|
551
637
|
guardParents(create, allowMissing = false) {
|
|
@@ -619,7 +705,7 @@ export class HcodeAccountStore {
|
|
|
619
705
|
closeSync(fd);
|
|
620
706
|
}
|
|
621
707
|
}
|
|
622
|
-
atomic(name, text) {
|
|
708
|
+
atomic(name, text, renamed) {
|
|
623
709
|
this.guardParents(false);
|
|
624
710
|
// Validate an existing destination rather than following or replacing a hostile link.
|
|
625
711
|
this.read(name, MAX_ENVELOPE);
|
|
@@ -633,6 +719,7 @@ export class HcodeAccountStore {
|
|
|
633
719
|
closeSync(fd);
|
|
634
720
|
}
|
|
635
721
|
renameSync(temp, join(this.dir, name));
|
|
722
|
+
renamed?.();
|
|
636
723
|
this.syncDirectory();
|
|
637
724
|
}
|
|
638
725
|
removeFile(name) {
|
|
@@ -714,6 +801,19 @@ export function parseGrant(value) {
|
|
|
714
801
|
return wire.invalid();
|
|
715
802
|
return { accessToken, refreshToken, expiresAt: wire.integer(v.expiresAt) };
|
|
716
803
|
}
|
|
804
|
+
function parseRefreshGrant(value) {
|
|
805
|
+
const { pendingVerification, ...tokens } = wire.object(value, [
|
|
806
|
+
"accessToken",
|
|
807
|
+
"refreshToken",
|
|
808
|
+
"expiresAt",
|
|
809
|
+
"pendingVerification",
|
|
810
|
+
]);
|
|
811
|
+
const grant = parseGrant(tokens);
|
|
812
|
+
// Keep the flag in the authenticated envelope so a crash cannot separate it from the rotated grant.
|
|
813
|
+
return pendingVerification === undefined
|
|
814
|
+
? grant
|
|
815
|
+
: { ...grant, pendingVerification: wire.literal(pendingVerification, true) };
|
|
816
|
+
}
|
|
717
817
|
function isMissing(error) {
|
|
718
818
|
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
719
819
|
}
|