clawmini 0.0.8 → 0.0.9
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/.changeset/README.md +8 -0
- package/.changeset/config.json +14 -0
- package/.github/workflows/release.yml +49 -0
- package/CHANGELOG.md +36 -0
- package/README.md +5 -4
- package/dist/adapter-discord/index.d.mts.map +1 -1
- package/dist/adapter-discord/index.mjs +465 -282
- package/dist/adapter-discord/index.mjs.map +1 -1
- package/dist/adapter-google-chat/index.mjs +367 -243
- package/dist/adapter-google-chat/index.mjs.map +1 -1
- package/dist/cli/index.mjs +684 -24
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lite.mjs +43 -13
- package/dist/cli/lite.mjs.map +1 -1
- package/dist/cli/{propose-policy.mjs → manage-policies.mjs} +270 -47
- package/dist/cli/manage-policies.mjs.map +1 -0
- package/dist/cli/run-host.d.mts +1 -0
- package/dist/cli/run-host.mjs +3090 -0
- package/dist/cli/run-host.mjs.map +1 -0
- package/dist/config-CPFQIGdG.mjs +57 -0
- package/dist/config-CPFQIGdG.mjs.map +1 -0
- package/dist/config-Dvl-Pov4.mjs +76 -0
- package/dist/config-Dvl-Pov4.mjs.map +1 -0
- package/dist/daemon/index.d.mts.map +1 -1
- package/dist/daemon/index.mjs +970 -332
- package/dist/daemon/index.mjs.map +1 -1
- package/dist/supervisor-actions-CiW56eLi.mjs +843 -0
- package/dist/supervisor-actions-CiW56eLi.mjs.map +1 -0
- package/dist/turn-log-buffer-DRgW53gl.mjs +767 -0
- package/dist/turn-log-buffer-DRgW53gl.mjs.map +1 -0
- package/dist/web/_app/immutable/chunks/{Drm9vgeP.js → 3AZlWB6U.js} +1 -1
- package/dist/web/_app/immutable/chunks/BhRSsUCh.js +2 -0
- package/dist/web/_app/immutable/chunks/BiLeM2i1.js +1 -0
- package/{web/.svelte-kit/output/client/_app/immutable/chunks/CME08kGM.js → dist/web/_app/immutable/chunks/BmBj85Ll.js} +1 -1
- package/dist/web/_app/immutable/chunks/BrERcKAH.js +1 -0
- package/dist/web/_app/immutable/chunks/Bv9252RM.js +1 -0
- package/dist/web/_app/immutable/chunks/CIXNBPKi.js +1 -0
- package/dist/web/_app/immutable/chunks/DISKL3GN.js +2 -0
- package/dist/web/_app/immutable/chunks/{Zeh-C-mx.js → DcpaLzmX.js} +1 -1
- package/dist/web/_app/immutable/chunks/DnQ3vS13.js +1 -0
- package/dist/web/_app/immutable/chunks/KsloHTKS.js +1 -0
- package/{web/.svelte-kit/output/client/_app/immutable/chunks/Ck-be5J2.js → dist/web/_app/immutable/chunks/RsHsUj-8.js} +2 -2
- package/dist/web/_app/immutable/chunks/{vDehDcuJ.js → wpfV79dV.js} +1 -1
- package/dist/web/_app/immutable/entry/app.CIw1Qj0n.js +2 -0
- package/dist/web/_app/immutable/entry/start.Di0-Jhte.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.CUGC2p-K.js → 0.DYyUA1au.js} +1 -1
- package/dist/web/_app/immutable/nodes/1.D-3QEMMZ.js +1 -0
- package/dist/web/_app/immutable/nodes/{2.BnwnD1Ki.js → 2.4olHnH7U.js} +1 -1
- package/{web/.svelte-kit/output/client/_app/immutable/nodes/3.0arZe_Uf.js → dist/web/_app/immutable/nodes/3.4w0bE-m2.js} +3 -3
- package/dist/web/_app/immutable/nodes/4.CZvjhVHt.js +60 -0
- package/dist/web/_app/immutable/nodes/{5.Bq2JzCEj.js → 5.DLbPVJY2.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +12 -12
- package/dist/workspace-oWmVh5mi.mjs +1001 -0
- package/dist/workspace-oWmVh5mi.mjs.map +1 -0
- package/docs/23_adapter_slash_autocomplete/development_log.md +19 -0
- package/docs/23_adapter_slash_autocomplete/notes.md +18 -0
- package/docs/23_adapter_slash_autocomplete/prd.md +46 -0
- package/docs/23_adapter_slash_autocomplete/questions.md +6 -0
- package/docs/23_adapter_slash_autocomplete/tickets.md +21 -0
- package/docs/24_subagent_job_policy_fixes/development_log.md +22 -0
- package/docs/24_subagent_job_policy_fixes/notes.md +28 -0
- package/docs/24_subagent_job_policy_fixes/prd.md +59 -0
- package/docs/24_subagent_job_policy_fixes/questions.md +3 -0
- package/docs/24_subagent_job_policy_fixes/tickets.md +49 -0
- package/docs/25_e2e_test_improvements/development_log.md +30 -0
- package/docs/25_e2e_test_improvements/notes.md +29 -0
- package/docs/25_e2e_test_improvements/prd.md +43 -0
- package/docs/25_e2e_test_improvements/questions.md +12 -0
- package/docs/25_e2e_test_improvements/tickets-2.md +22 -0
- package/docs/25_e2e_test_improvements/tickets.md +22 -0
- package/docs/25_policy_cwd/development_log.md +30 -0
- package/docs/25_policy_cwd/notes.md +28 -0
- package/docs/25_policy_cwd/prd.md +77 -0
- package/docs/25_policy_cwd/questions.md +6 -0
- package/docs/25_policy_cwd/tickets.md +77 -0
- package/docs/CLI_REFERENCE.md +3 -1
- package/docs/PHILOSOPHY.md +35 -0
- package/docs/adapter-visibility/SPEC.md +461 -0
- package/docs/adapter-visibility/SPEC_v2.md +202 -0
- package/docs/auto-update/SPEC.md +344 -0
- package/docs/backups/SPEC.md +296 -0
- package/docs/backups/clawmini.gitignore +69 -0
- package/docs/guides/assets/clawmini-avatar.png +0 -0
- package/docs/guides/backups.md +332 -0
- package/docs/guides/discord_adapter_setup.md +1 -1
- package/docs/guides/google_chat_adapter_setup.md +81 -0
- package/docs/unified-startup/SPEC.md +203 -0
- package/e2e/_helpers/test-environment.test.ts +49 -0
- package/e2e/_helpers/test-environment.ts +548 -0
- package/e2e/adapters/_google-chat-fixtures.ts +340 -0
- package/{src/cli/e2e → e2e/adapters}/adapter-discord.test.ts +22 -23
- package/e2e/adapters/adapter-google-chat-downtime.test.ts +157 -0
- package/e2e/adapters/adapter-google-chat-inbound.test.ts +697 -0
- package/e2e/adapters/adapter-google-chat-outbound.test.ts +297 -0
- package/e2e/adapters/adapter-google-chat-roundtrip.test.ts +56 -0
- package/e2e/adapters/adapter-google-chat-threads.test.ts +1078 -0
- package/e2e/agents/custom-api-env.test.ts +80 -0
- package/e2e/agents/export-lite-func.test.ts +104 -0
- package/e2e/agents/fallbacks.test.ts +124 -0
- package/e2e/agents/interrupt.test.ts +50 -0
- package/e2e/agents/no-reply-necessary.test.ts +57 -0
- package/e2e/agents/session-timeout-subagents.test.ts +76 -0
- package/e2e/agents/subagent-authorization.test.ts +246 -0
- package/e2e/agents/subagent-env.test.ts +49 -0
- package/e2e/agents/subagent-lifecycle.test.ts +782 -0
- package/e2e/agents/subagents-depth.test.ts +47 -0
- package/e2e/cli/agents.test.ts +176 -0
- package/e2e/cli/auto-update.test.ts +741 -0
- package/e2e/cli/basic.test.ts +44 -0
- package/{src/cli/e2e → e2e/cli}/export-lite.test.ts +16 -12
- package/e2e/cli/init-gitignore.test.ts +86 -0
- package/e2e/cli/init.test.ts +76 -0
- package/e2e/cli/messages.test.ts +363 -0
- package/e2e/cli/serve.test.ts +76 -0
- package/{src/cli/e2e → e2e/cli}/skills.test.ts +11 -10
- package/{src/cli/e2e → e2e/daemon}/daemon.test.ts +57 -195
- package/e2e/jobs/agent-jobs.test.ts +216 -0
- package/e2e/jobs/cron.test.ts +64 -0
- package/e2e/jobs/restart.test.ts +108 -0
- package/e2e/policies/approval-session.test.ts +69 -0
- package/e2e/policies/auto-create-policies-file.test.ts +35 -0
- package/e2e/policies/builtin-manage-policies.test.ts +184 -0
- package/e2e/policies/builtin-run-host.test.ts +180 -0
- package/e2e/policies/environment-policies.test.ts +177 -0
- package/e2e/policies/manage-policies.test.ts +566 -0
- package/e2e/policies/output-size.test.ts +98 -0
- package/e2e/policies/policies-context-cwd.test.ts +160 -0
- package/e2e/policies/relative-script-path.test.ts +60 -0
- package/e2e/policies/requests-show.test.ts +135 -0
- package/e2e/policies/requests.test.ts +208 -0
- package/e2e/policies/slash-policies.test.ts +308 -0
- package/e2e/policies/startup-cleanup.test.ts +48 -0
- package/e2e/routers/session-timeout.test.ts +106 -0
- package/e2e/routers/slash-model.test.ts +152 -0
- package/e2e/routers/slash-new.test.ts +50 -0
- package/e2e/routers/slash-restart-adapter.test.ts +96 -0
- package/e2e/routers/slash-restart.test.ts +114 -0
- package/e2e/routers/slash-shutdown.test.ts +55 -0
- package/e2e/routers/slash-stop.test.ts +232 -0
- package/e2e/routers/slash-upgrade.test.ts +88 -0
- package/{src/cli/e2e → e2e/sandbox}/environments.test.ts +14 -13
- package/eslint.config.js +6 -0
- package/napkin.md +1 -1
- package/package.json +8 -3
- package/src/adapter-discord/commands.test.ts +42 -0
- package/src/adapter-discord/commands.ts +33 -0
- package/src/adapter-discord/config.ts +12 -0
- package/src/adapter-discord/forwarder.test.ts +499 -21
- package/src/adapter-discord/forwarder.ts +343 -124
- package/src/adapter-discord/inbound-cache.test.ts +47 -0
- package/src/adapter-discord/inbound-cache.ts +37 -0
- package/src/adapter-discord/index.test.ts +67 -2
- package/src/adapter-discord/index.ts +84 -216
- package/src/adapter-discord/interactions.test.ts +54 -3
- package/src/adapter-discord/interactions.ts +97 -53
- package/src/adapter-discord/processMessage.ts +239 -0
- package/src/adapter-discord/state.ts +1 -0
- package/src/adapter-google-chat/auth.test.ts +9 -5
- package/src/adapter-google-chat/auth.ts +29 -23
- package/src/adapter-google-chat/cards.ts +7 -2
- package/src/adapter-google-chat/client.test.ts +37 -2
- package/src/adapter-google-chat/client.ts +138 -38
- package/src/adapter-google-chat/config.ts +19 -0
- package/src/adapter-google-chat/forwarder.test.ts +81 -56
- package/src/adapter-google-chat/forwarder.ts +394 -185
- package/src/adapter-google-chat/inbound-cache.test.ts +61 -0
- package/src/adapter-google-chat/inbound-cache.ts +36 -0
- package/src/adapter-google-chat/state.test.ts +1 -0
- package/src/adapter-google-chat/state.ts +9 -1
- package/src/adapter-google-chat/subscriptions.ts +8 -6
- package/src/cli/builtin-policies.ts +44 -0
- package/src/cli/commands/agents.ts +59 -5
- package/src/cli/commands/down.ts +54 -2
- package/src/cli/commands/environments.ts +8 -2
- package/src/cli/commands/init.ts +31 -0
- package/src/cli/commands/logs.ts +116 -0
- package/src/cli/commands/policies.ts +6 -4
- package/src/cli/commands/serve.test.ts +67 -0
- package/src/cli/commands/serve.ts +284 -0
- package/src/cli/commands/up.ts +122 -2
- package/src/cli/commands/web-api/agents.ts +3 -2
- package/src/cli/index.ts +4 -0
- package/src/cli/install-detection.test.ts +72 -0
- package/src/cli/install-detection.ts +48 -0
- package/src/cli/lite.ts +54 -22
- package/src/cli/manage-policies-utils.ts +104 -0
- package/src/cli/manage-policies.ts +291 -0
- package/src/cli/run-host.ts +45 -0
- package/src/cli/supervisor-actions.ts +267 -0
- package/src/cli/supervisor-control.test.ts +129 -0
- package/src/cli/supervisor-control.ts +155 -0
- package/src/cli/supervisor-pid.ts +68 -0
- package/src/cli/supervisor.ts +277 -0
- package/src/daemon/agent/agent-context.ts +11 -11
- package/src/daemon/agent/agent-session.ts +8 -1
- package/src/daemon/agent/chat-logger.test.ts +78 -9
- package/src/daemon/agent/chat-logger.ts +25 -5
- package/src/daemon/agent/turn-registry.test.ts +89 -0
- package/src/daemon/agent/turn-registry.ts +94 -0
- package/src/daemon/agent/types.ts +2 -0
- package/src/daemon/api/agent-policy-endpoints.ts +263 -0
- package/src/daemon/api/agent-router.ts +47 -126
- package/src/daemon/api/index.test.ts +1 -0
- package/src/daemon/api/policy-request.test.ts +7 -5
- package/src/daemon/api/router-utils.ts +6 -5
- package/src/daemon/api/subagent-router.ts +110 -74
- package/src/daemon/api/subagent-utils.test.ts +60 -0
- package/src/daemon/api/subagent-utils.ts +113 -87
- package/src/daemon/api/user-router.ts +34 -8
- package/src/daemon/auth.ts +1 -0
- package/src/daemon/cron.test.ts +62 -4
- package/src/daemon/cron.ts +42 -16
- package/src/daemon/events.ts +65 -0
- package/src/daemon/index.ts +24 -1
- package/src/daemon/message-interruption.test.ts +1 -0
- package/src/daemon/message-jobs.test.ts +1 -0
- package/src/daemon/message.ts +78 -14
- package/src/daemon/observation.test.ts +26 -18
- package/src/daemon/pending-replies.test.ts +112 -0
- package/src/daemon/pending-replies.ts +162 -0
- package/src/daemon/policy-request-service.ts +3 -1
- package/src/daemon/policy-utils.test.ts +66 -1
- package/src/daemon/policy-utils.ts +126 -1
- package/src/daemon/request-store.ts +31 -0
- package/src/daemon/routers/session-timeout.ts +4 -0
- package/src/daemon/routers/slash-model.test.ts +344 -0
- package/src/daemon/routers/slash-model.ts +207 -0
- package/src/daemon/routers/slash-policies.test.ts +38 -32
- package/src/daemon/routers/slash-policies.ts +84 -33
- package/src/daemon/routers/slash-restart.test.ts +69 -0
- package/src/daemon/routers/slash-restart.ts +36 -0
- package/src/daemon/routers/slash-shutdown.test.ts +50 -0
- package/src/daemon/routers/slash-shutdown.ts +28 -0
- package/src/daemon/routers/slash-upgrade.test.ts +116 -0
- package/src/daemon/routers/slash-upgrade.ts +76 -0
- package/src/daemon/routers/types.ts +7 -0
- package/src/daemon/routers.ts +16 -0
- package/src/shared/adapters/blockquote.test.ts +28 -0
- package/src/shared/adapters/blockquote.ts +20 -0
- package/src/shared/adapters/filtering.test.ts +224 -10
- package/src/shared/adapters/filtering.ts +95 -7
- package/src/shared/adapters/inbound-cache.test.ts +48 -0
- package/src/shared/adapters/inbound-cache.ts +54 -0
- package/src/shared/adapters/turn-log-buffer.ts +266 -0
- package/src/shared/adapters/turn-log.test.ts +389 -0
- package/src/shared/adapters/turn-log.ts +357 -0
- package/src/shared/agent-utils.ts +12 -5
- package/src/shared/chats.test.ts +4 -0
- package/src/shared/chats.ts +9 -0
- package/src/shared/config.ts +16 -1
- package/src/shared/lite.ts +76 -2
- package/src/shared/policies.ts +26 -0
- package/src/shared/template-manifest.ts +267 -0
- package/src/shared/utils/shell.ts +61 -0
- package/src/shared/version.ts +34 -0
- package/src/shared/workspace.test.ts +217 -0
- package/src/shared/workspace.ts +626 -48
- package/templates/environments/cladding/allowlist-domain.mjs +125 -0
- package/templates/environments/cladding/env.json +21 -1
- package/templates/environments/cladding/run-with-network.mjs +54 -0
- package/templates/environments/macos-proxy/allowlist-domain.mjs +95 -0
- package/templates/environments/macos-proxy/env.json +8 -1
- package/templates/environments/macos-proxy/proxy.mjs +0 -1
- package/templates/gemini/template.json +5 -0
- package/templates/gemini-claw/template.json +13 -0
- package/templates/skills/clawmini-requests/SKILL.md +69 -10
- package/templates/skills/run-host/SKILL.md +51 -0
- package/templates/skills/skill-creator/SKILL.md +4 -3
- package/templates/skills/skill-creator/scripts/validate.sh +52 -0
- package/tsdown.config.ts +10 -1
- package/vitest.config.ts +2 -2
- package/web/.svelte-kit/ambient.d.ts +292 -118
- package/web/.svelte-kit/generated/server/internal.js +1 -1
- package/web/.svelte-kit/output/client/.vite/manifest.json +126 -136
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{Drm9vgeP.js → 3AZlWB6U.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BhRSsUCh.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BiLeM2i1.js +1 -0
- package/{dist/web/_app/immutable/chunks/CME08kGM.js → web/.svelte-kit/output/client/_app/immutable/chunks/BmBj85Ll.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BrERcKAH.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/Bv9252RM.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/CIXNBPKi.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DISKL3GN.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{Zeh-C-mx.js → DcpaLzmX.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DnQ3vS13.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/chunks/KsloHTKS.js +1 -0
- package/{dist/web/_app/immutable/chunks/Ck-be5J2.js → web/.svelte-kit/output/client/_app/immutable/chunks/RsHsUj-8.js} +2 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/{vDehDcuJ.js → wpfV79dV.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/entry/app.CIw1Qj0n.js +2 -0
- package/web/.svelte-kit/output/client/_app/immutable/entry/start.Di0-Jhte.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.CUGC2p-K.js → 0.DYyUA1au.js} +1 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/1.D-3QEMMZ.js +1 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.BnwnD1Ki.js → 2.4olHnH7U.js} +1 -1
- package/{dist/web/_app/immutable/nodes/3.0arZe_Uf.js → web/.svelte-kit/output/client/_app/immutable/nodes/3.4w0bE-m2.js} +3 -3
- package/web/.svelte-kit/output/client/_app/immutable/nodes/4.CZvjhVHt.js +60 -0
- package/web/.svelte-kit/output/client/_app/immutable/nodes/{5.Bq2JzCEj.js → 5.DLbPVJY2.js} +1 -1
- package/web/.svelte-kit/output/client/_app/version.json +1 -1
- package/web/.svelte-kit/output/server/.vite/manifest.json +12 -10
- package/web/.svelte-kit/output/server/chunks/Icon.js +1 -1
- package/web/.svelte-kit/output/server/chunks/client.js +1 -1
- package/web/.svelte-kit/output/server/chunks/exports.js +1 -1
- package/web/.svelte-kit/output/server/chunks/index-server.js +2 -1
- package/web/.svelte-kit/output/server/chunks/internal.js +1 -1
- package/web/.svelte-kit/output/server/chunks/render-context.js +77 -0
- package/web/.svelte-kit/output/server/chunks/root.js +739 -788
- package/web/.svelte-kit/output/server/chunks/shared.js +234 -21
- package/web/.svelte-kit/output/server/index.js +126 -90
- package/web/.svelte-kit/output/server/manifest-full.js +1 -1
- package/web/.svelte-kit/output/server/manifest.js +1 -1
- package/web/.svelte-kit/output/server/nodes/0.js +1 -1
- package/web/.svelte-kit/output/server/nodes/1.js +1 -1
- package/web/.svelte-kit/output/server/nodes/2.js +1 -1
- package/web/.svelte-kit/output/server/nodes/3.js +1 -1
- package/web/.svelte-kit/output/server/nodes/4.js +1 -1
- package/web/.svelte-kit/output/server/nodes/5.js +1 -1
- package/web/.svelte-kit/output/server/remote-entry.js +245 -81
- package/web/.svelte-kit/tsconfig.json +4 -1
- package/dist/cli/propose-policy.mjs.map +0 -1
- package/dist/lite-CBxOT1y5.mjs +0 -241
- package/dist/lite-CBxOT1y5.mjs.map +0 -1
- package/dist/routing-D8rTxtaV.mjs +0 -245
- package/dist/routing-D8rTxtaV.mjs.map +0 -1
- package/dist/web/_app/immutable/chunks/B6YN0Nuq.js +0 -1
- package/dist/web/_app/immutable/chunks/BmRlVmv6.js +0 -1
- package/dist/web/_app/immutable/chunks/CK9JZLaG.js +0 -2
- package/dist/web/_app/immutable/chunks/Ck3rYNON.js +0 -1
- package/dist/web/_app/immutable/chunks/D5iV40bG.js +0 -1
- package/dist/web/_app/immutable/chunks/DMtIqaiV.js +0 -2
- package/dist/web/_app/immutable/chunks/DhD271EB.js +0 -1
- package/dist/web/_app/immutable/chunks/DpuLqk8d.js +0 -1
- package/dist/web/_app/immutable/chunks/DsIToJCP.js +0 -1
- package/dist/web/_app/immutable/entry/app.BCSV3nrG.js +0 -2
- package/dist/web/_app/immutable/entry/start.D4eLEZUM.js +0 -1
- package/dist/web/_app/immutable/nodes/1.CGC_42IQ.js +0 -1
- package/dist/web/_app/immutable/nodes/4.ClM1bXLE.js +0 -60
- package/dist/workspace-BJmJBfKi.mjs +0 -456
- package/dist/workspace-BJmJBfKi.mjs.map +0 -1
- package/src/cli/e2e/agents.test.ts +0 -140
- package/src/cli/e2e/basic.test.ts +0 -43
- package/src/cli/e2e/cron.test.ts +0 -132
- package/src/cli/e2e/export-lite-func.test.ts +0 -206
- package/src/cli/e2e/fallbacks.test.ts +0 -175
- package/src/cli/e2e/init.test.ts +0 -77
- package/src/cli/e2e/messages.test.ts +0 -332
- package/src/cli/e2e/propose-policy.test.ts +0 -203
- package/src/cli/e2e/requests.test.ts +0 -180
- package/src/cli/e2e/session-timeout.test.ts +0 -192
- package/src/cli/e2e/slash-new.test.ts +0 -93
- package/src/cli/e2e/subagents.test.ts +0 -106
- package/src/cli/e2e/utils.ts +0 -66
- package/src/cli/propose-policy.ts +0 -91
- package/web/.svelte-kit/output/client/_app/immutable/chunks/B6YN0Nuq.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/BmRlVmv6.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/CK9JZLaG.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/Ck3rYNON.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/D5iV40bG.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DMtIqaiV.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DhD271EB.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DpuLqk8d.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/chunks/DsIToJCP.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/entry/app.BCSV3nrG.js +0 -2
- package/web/.svelte-kit/output/client/_app/immutable/entry/start.D4eLEZUM.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/1.CGC_42IQ.js +0 -1
- package/web/.svelte-kit/output/client/_app/immutable/nodes/4.ClM1bXLE.js +0 -60
- package/web/.svelte-kit/output/server/chunks/false.js +0 -4
- /package/dist/cli/{propose-policy.d.mts → manage-policies.d.mts} +0 -0
- /package/{src/cli/e2e → e2e/_helpers}/global-setup.ts +0 -0
|
@@ -2,7 +2,20 @@ import { json, text } from "@sveltejs/kit";
|
|
|
2
2
|
import { SvelteKitError, HttpError } from "@sveltejs/kit/internal";
|
|
3
3
|
import { with_request_store } from "@sveltejs/kit/internal/server";
|
|
4
4
|
import * as devalue from "devalue";
|
|
5
|
-
import { t as text_decoder,
|
|
5
|
+
import { t as text_decoder, c as base64_decode, b as base64_encode } from "./utils.js";
|
|
6
|
+
import { e as experimental_async_required, g as get_render_context, h as hydratable_serialization_failed } from "./render-context.js";
|
|
7
|
+
import "clsx";
|
|
8
|
+
function noop() {
|
|
9
|
+
}
|
|
10
|
+
function once(fn) {
|
|
11
|
+
let done = false;
|
|
12
|
+
let result;
|
|
13
|
+
return () => {
|
|
14
|
+
if (done) return result;
|
|
15
|
+
done = true;
|
|
16
|
+
return result = fn();
|
|
17
|
+
};
|
|
18
|
+
}
|
|
6
19
|
const SVELTE_KIT_ASSETS = "/_svelte_kit_assets";
|
|
7
20
|
const ENDPOINT_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
8
21
|
const MUTATIVE_METHODS = ["POST", "PUT", "PATCH", "DELETE"];
|
|
@@ -442,7 +455,7 @@ function create_field_proxy(target, get_input, set_input, get_issues, path = [])
|
|
|
442
455
|
value: {
|
|
443
456
|
enumerable: true,
|
|
444
457
|
get() {
|
|
445
|
-
return get_value();
|
|
458
|
+
return get_value() ?? input_value;
|
|
446
459
|
}
|
|
447
460
|
}
|
|
448
461
|
});
|
|
@@ -501,7 +514,7 @@ function create_field_proxy(target, get_input, set_input, get_issues, path = [])
|
|
|
501
514
|
value: {
|
|
502
515
|
enumerable: true,
|
|
503
516
|
get() {
|
|
504
|
-
const value = get_value();
|
|
517
|
+
const value = get_value() ?? input_value;
|
|
505
518
|
return value != null ? String(value) : "";
|
|
506
519
|
}
|
|
507
520
|
}
|
|
@@ -729,15 +742,196 @@ function get_node_type(node_id) {
|
|
|
729
742
|
const dot_parts = filename.split(".");
|
|
730
743
|
return dot_parts.slice(0, -1).join(".");
|
|
731
744
|
}
|
|
745
|
+
function hydratable(key, fn) {
|
|
746
|
+
{
|
|
747
|
+
experimental_async_required();
|
|
748
|
+
}
|
|
749
|
+
const { hydratable: hydratable2 } = get_render_context();
|
|
750
|
+
let entry = hydratable2.lookup.get(key);
|
|
751
|
+
if (entry !== void 0) {
|
|
752
|
+
return (
|
|
753
|
+
/** @type {T} */
|
|
754
|
+
entry.value
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
const value = fn();
|
|
758
|
+
entry = encode(key, value, hydratable2.unresolved_promises);
|
|
759
|
+
hydratable2.lookup.set(key, entry);
|
|
760
|
+
return value;
|
|
761
|
+
}
|
|
762
|
+
function encode(key, value, unresolved) {
|
|
763
|
+
const entry = { value, serialized: "" };
|
|
764
|
+
let uid = 1;
|
|
765
|
+
entry.serialized = devalue.uneval(entry.value, (value2, uneval) => {
|
|
766
|
+
if (is_promise(value2)) {
|
|
767
|
+
const placeholder = `"${uid++}"`;
|
|
768
|
+
const p = value2.then((v) => {
|
|
769
|
+
entry.serialized = entry.serialized.replace(placeholder, `r(${uneval(v)})`);
|
|
770
|
+
}).catch(
|
|
771
|
+
(devalue_error) => hydratable_serialization_failed(
|
|
772
|
+
key,
|
|
773
|
+
serialization_stack(entry.stack, devalue_error?.stack)
|
|
774
|
+
)
|
|
775
|
+
);
|
|
776
|
+
p.catch(() => {
|
|
777
|
+
}).finally(() => unresolved?.delete(p));
|
|
778
|
+
(entry.promises ??= []).push(p);
|
|
779
|
+
return placeholder;
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
return entry;
|
|
783
|
+
}
|
|
784
|
+
function is_promise(value) {
|
|
785
|
+
return Object.prototype.toString.call(value) === "[object Promise]";
|
|
786
|
+
}
|
|
787
|
+
function serialization_stack(root_stack, uneval_stack) {
|
|
788
|
+
let out = "";
|
|
789
|
+
if (root_stack) {
|
|
790
|
+
out += root_stack + "\n";
|
|
791
|
+
}
|
|
792
|
+
if (uneval_stack) {
|
|
793
|
+
out += "Caused by:\n" + uneval_stack + "\n";
|
|
794
|
+
}
|
|
795
|
+
return out || "<missing stack trace>";
|
|
796
|
+
}
|
|
732
797
|
const INVALIDATED_PARAM = "x-sveltekit-invalidated";
|
|
733
798
|
const TRAILING_SLASH_PARAM = "x-sveltekit-trailing-slash";
|
|
734
799
|
function stringify(data, transport) {
|
|
735
800
|
const encoders = Object.fromEntries(Object.entries(transport).map(([k, v]) => [k, v.encode]));
|
|
736
801
|
return devalue.stringify(data, encoders);
|
|
737
802
|
}
|
|
738
|
-
|
|
803
|
+
const object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
804
|
+
function is_plain_object(thing) {
|
|
805
|
+
if (typeof thing !== "object" || thing === null) return false;
|
|
806
|
+
const proto = Object.getPrototypeOf(thing);
|
|
807
|
+
return proto === Object.prototype || proto === null || Object.getPrototypeOf(proto) === null || Object.getOwnPropertyNames(proto).sort().join("\0") === object_proto_names;
|
|
808
|
+
}
|
|
809
|
+
function to_sorted(value, clones) {
|
|
810
|
+
const clone = Object.getPrototypeOf(value) === null ? /* @__PURE__ */ Object.create(null) : {};
|
|
811
|
+
clones.set(value, clone);
|
|
812
|
+
Object.defineProperty(clone, remote_arg_marker, { value: true });
|
|
813
|
+
for (const key of Object.keys(value).sort()) {
|
|
814
|
+
const property = value[key];
|
|
815
|
+
Object.defineProperty(clone, key, {
|
|
816
|
+
value: clones.get(property) ?? property,
|
|
817
|
+
enumerable: true,
|
|
818
|
+
configurable: true,
|
|
819
|
+
writable: true
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
return clone;
|
|
823
|
+
}
|
|
824
|
+
const remote_object = "__skrao";
|
|
825
|
+
const remote_map = "__skram";
|
|
826
|
+
const remote_set = "__skras";
|
|
827
|
+
const remote_regex_guard = "__skrag";
|
|
828
|
+
const remote_arg_marker = Symbol(remote_object);
|
|
829
|
+
function create_remote_arg_reducers(transport, sort, remote_arg_clones) {
|
|
830
|
+
const remote_fns_reducers = {
|
|
831
|
+
[remote_regex_guard]: (
|
|
832
|
+
/** @type {(value: unknown) => void} */
|
|
833
|
+
(value) => {
|
|
834
|
+
if (value instanceof RegExp) {
|
|
835
|
+
throw new Error("Regular expressions are not valid remote function arguments");
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
)
|
|
839
|
+
};
|
|
840
|
+
if (sort) {
|
|
841
|
+
remote_fns_reducers[remote_map] = (value) => {
|
|
842
|
+
if (!(value instanceof Map)) {
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
const entries = [];
|
|
846
|
+
for (const [key, val] of value) {
|
|
847
|
+
entries.push([stringify2(key), stringify2(val)]);
|
|
848
|
+
}
|
|
849
|
+
return entries.sort(([a1, a2], [b1, b2]) => {
|
|
850
|
+
if (a1 < b1) return -1;
|
|
851
|
+
if (a1 > b1) return 1;
|
|
852
|
+
if (a2 < b2) return -1;
|
|
853
|
+
if (a2 > b2) return 1;
|
|
854
|
+
return 0;
|
|
855
|
+
});
|
|
856
|
+
};
|
|
857
|
+
remote_fns_reducers[remote_set] = (value) => {
|
|
858
|
+
if (!(value instanceof Set)) {
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
const items = [];
|
|
862
|
+
for (const item of value) {
|
|
863
|
+
items.push(stringify2(item));
|
|
864
|
+
}
|
|
865
|
+
items.sort();
|
|
866
|
+
return items;
|
|
867
|
+
};
|
|
868
|
+
remote_fns_reducers[remote_object] = (value) => {
|
|
869
|
+
if (!is_plain_object(value)) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
if (Object.hasOwn(value, remote_arg_marker)) {
|
|
873
|
+
return;
|
|
874
|
+
}
|
|
875
|
+
if (remote_arg_clones.has(value)) {
|
|
876
|
+
return remote_arg_clones.get(value);
|
|
877
|
+
}
|
|
878
|
+
return to_sorted(value, remote_arg_clones);
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
const user_reducers = Object.fromEntries(
|
|
882
|
+
Object.entries(transport).map(([k, v]) => [k, v.encode])
|
|
883
|
+
);
|
|
884
|
+
const all_reducers = { ...user_reducers, ...remote_fns_reducers };
|
|
885
|
+
const stringify2 = (value) => devalue.stringify(value, all_reducers);
|
|
886
|
+
return all_reducers;
|
|
887
|
+
}
|
|
888
|
+
function create_remote_arg_revivers(transport) {
|
|
889
|
+
const remote_fns_revivers = {
|
|
890
|
+
/** @type {(value: unknown) => unknown} */
|
|
891
|
+
[remote_object]: (value) => value,
|
|
892
|
+
/** @type {(value: unknown) => Map<unknown, unknown>} */
|
|
893
|
+
[remote_map]: (value) => {
|
|
894
|
+
if (!Array.isArray(value)) {
|
|
895
|
+
throw new Error("Invalid data for Map reviver");
|
|
896
|
+
}
|
|
897
|
+
const map = /* @__PURE__ */ new Map();
|
|
898
|
+
for (const item of value) {
|
|
899
|
+
if (!Array.isArray(item) || item.length !== 2 || typeof item[0] !== "string" || typeof item[1] !== "string") {
|
|
900
|
+
throw new Error("Invalid data for Map reviver");
|
|
901
|
+
}
|
|
902
|
+
const [key, val] = item;
|
|
903
|
+
map.set(parse(key), parse(val));
|
|
904
|
+
}
|
|
905
|
+
return map;
|
|
906
|
+
},
|
|
907
|
+
/** @type {(value: unknown) => Set<unknown>} */
|
|
908
|
+
[remote_set]: (value) => {
|
|
909
|
+
if (!Array.isArray(value)) {
|
|
910
|
+
throw new Error("Invalid data for Set reviver");
|
|
911
|
+
}
|
|
912
|
+
const set = /* @__PURE__ */ new Set();
|
|
913
|
+
for (const item of value) {
|
|
914
|
+
if (typeof item !== "string") {
|
|
915
|
+
throw new Error("Invalid data for Set reviver");
|
|
916
|
+
}
|
|
917
|
+
set.add(parse(item));
|
|
918
|
+
}
|
|
919
|
+
return set;
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
const user_revivers = Object.fromEntries(
|
|
923
|
+
Object.entries(transport).map(([k, v]) => [k, v.decode])
|
|
924
|
+
);
|
|
925
|
+
const all_revivers = { ...user_revivers, ...remote_fns_revivers };
|
|
926
|
+
const parse = (data) => devalue.parse(data, all_revivers);
|
|
927
|
+
return all_revivers;
|
|
928
|
+
}
|
|
929
|
+
function stringify_remote_arg(value, transport, sort = true) {
|
|
739
930
|
if (value === void 0) return "";
|
|
740
|
-
const json_string = stringify(
|
|
931
|
+
const json_string = devalue.stringify(
|
|
932
|
+
value,
|
|
933
|
+
create_remote_arg_reducers(transport, sort, /* @__PURE__ */ new Map())
|
|
934
|
+
);
|
|
741
935
|
const bytes = new TextEncoder().encode(json_string);
|
|
742
936
|
return base64_encode(bytes).replaceAll("=", "").replaceAll("+", "-").replaceAll("/", "_");
|
|
743
937
|
}
|
|
@@ -747,13 +941,32 @@ function parse_remote_arg(string, transport) {
|
|
|
747
941
|
// no need to add back `=` characters, atob can handle it
|
|
748
942
|
base64_decode(string.replaceAll("-", "+").replaceAll("_", "/"))
|
|
749
943
|
);
|
|
750
|
-
|
|
751
|
-
return devalue.parse(json_string, decoders);
|
|
944
|
+
return devalue.parse(json_string, create_remote_arg_revivers(transport));
|
|
752
945
|
}
|
|
753
946
|
function create_remote_key(id, payload) {
|
|
754
947
|
return id + "/" + payload;
|
|
755
948
|
}
|
|
949
|
+
function split_remote_key(key) {
|
|
950
|
+
const i = key.lastIndexOf("/");
|
|
951
|
+
if (i === -1) {
|
|
952
|
+
throw new Error(`Invalid remote key: ${key}`);
|
|
953
|
+
}
|
|
954
|
+
return {
|
|
955
|
+
id: key.slice(0, i),
|
|
956
|
+
payload: key.slice(i + 1)
|
|
957
|
+
};
|
|
958
|
+
}
|
|
959
|
+
function unfriendly_hydratable(key, fn) {
|
|
960
|
+
if (!hydratable) {
|
|
961
|
+
throw new Error("Remote functions require Svelte 5.44.0 or later");
|
|
962
|
+
}
|
|
963
|
+
return hydratable(key, fn);
|
|
964
|
+
}
|
|
756
965
|
export {
|
|
966
|
+
normalize_issue as A,
|
|
967
|
+
set_nested_value as B,
|
|
968
|
+
flatten_issues as C,
|
|
969
|
+
deep_set as D,
|
|
757
970
|
ENDPOINT_METHODS as E,
|
|
758
971
|
INVALIDATED_PARAM as I,
|
|
759
972
|
MUTATIVE_METHODS as M,
|
|
@@ -764,26 +977,26 @@ export {
|
|
|
764
977
|
get_global_name as b,
|
|
765
978
|
clarify_devalue_error as c,
|
|
766
979
|
get_node_type as d,
|
|
767
|
-
|
|
768
|
-
|
|
980
|
+
noop as e,
|
|
981
|
+
escape_html as f,
|
|
769
982
|
get_status as g,
|
|
770
983
|
handle_error_and_jsonify as h,
|
|
771
984
|
is_form_content_type as i,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
985
|
+
create_remote_key as j,
|
|
986
|
+
static_error_page as k,
|
|
987
|
+
stringify as l,
|
|
775
988
|
method_not_allowed as m,
|
|
776
989
|
negotiate as n,
|
|
777
|
-
|
|
990
|
+
deserialize_binary_form as o,
|
|
778
991
|
parse_remote_arg as p,
|
|
779
|
-
|
|
992
|
+
split_remote_key as q,
|
|
780
993
|
redirect_response as r,
|
|
781
994
|
serialize_uses as s,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
995
|
+
once as t,
|
|
996
|
+
has_prerendered_path as u,
|
|
997
|
+
handle_fatal_error as v,
|
|
998
|
+
format_server_error as w,
|
|
999
|
+
stringify_remote_arg as x,
|
|
1000
|
+
unfriendly_hydratable as y,
|
|
1001
|
+
create_field_proxy as z
|
|
789
1002
|
};
|