dal-code 1.0.28 → 1.0.30
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 +13 -0
- package/dal-docs/README.md +1 -1
- package/dist/bundle/chunks/anthropic-messages-AZKHNVAG.js +5 -0
- package/dist/bundle/chunks/anthropic.js +74 -0
- package/dist/bundle/chunks/azure-openai-responses-LA3FYF3J.js +1 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +82 -0
- package/dist/bundle/chunks/chunk-4HEMJ3PG.js +1140 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +1 -0
- package/dist/bundle/chunks/chunk-4UTLMBZZ.js +13 -0
- package/dist/bundle/chunks/chunk-4XT6IQQ6.js +1 -0
- package/dist/bundle/chunks/chunk-5M7W2EDY.js +3 -0
- package/dist/bundle/chunks/chunk-5ULSWE2O.js +43 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +11 -0
- package/dist/bundle/chunks/chunk-7ZC4UXSL.js +1 -0
- package/dist/bundle/chunks/chunk-ABVPQ2YN.js +14 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +1 -0
- package/dist/bundle/chunks/chunk-F5ZABL6Z.js +19 -0
- package/dist/bundle/chunks/chunk-GYI2XXNW.js +10 -0
- package/dist/bundle/chunks/chunk-H3QXYIF7.js +30 -0
- package/dist/bundle/chunks/chunk-HC56T2OZ.js +134 -0
- package/dist/bundle/chunks/chunk-HMFU7ZIF.js +1 -0
- package/dist/bundle/chunks/chunk-JEMNLK2O.js +10 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +1 -0
- package/dist/bundle/chunks/chunk-LPXNMA2W.js +1 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +1 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +1 -0
- package/dist/bundle/chunks/chunk-PMRZO46Y.js +1 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +1 -0
- package/dist/bundle/chunks/chunk-PRXLTI3Y.js +81 -0
- package/dist/bundle/chunks/chunk-Q6IMZXWD.js +129 -0
- package/dist/bundle/chunks/chunk-R4YWRKK4.js +7 -0
- package/dist/bundle/chunks/chunk-RDZVAGPR.js +1 -0
- package/dist/bundle/chunks/chunk-S3GGRYIO.js +5 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +1 -0
- package/dist/bundle/chunks/chunk-TRDNDS6A.js +3 -0
- package/dist/bundle/chunks/chunk-USJZMAIR.js +1 -0
- package/dist/bundle/chunks/chunk-UTB4DTYQ.js +1 -0
- package/dist/bundle/chunks/chunk-WXULTH2D.js +1 -0
- package/dist/bundle/chunks/chunk-YKF7PQCJ.js +1 -0
- package/dist/bundle/chunks/chunk-YTERFI73.js +1 -0
- package/dist/bundle/chunks/chunk-ZBURYEWF.js +1 -0
- package/dist/bundle/chunks/chunk-ZKDITC7J.js +35 -0
- package/dist/bundle/chunks/cli-2LJMKSUZ.js +50 -0
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-6WEJUIW2.js +1 -0
- package/dist/bundle/chunks/codemode-worker.js +470 -0
- package/dist/bundle/chunks/dist-37IE4EWG.js +10 -0
- package/dist/bundle/chunks/easter-egg-3d-GHWWTBZN.js +1 -0
- package/dist/bundle/chunks/execute-JU22LJZT.js +489 -0
- package/dist/bundle/chunks/github-copilot.js +1 -0
- package/dist/bundle/chunks/google-generative-ai-RFPHNE43.js +1 -0
- package/dist/bundle/chunks/google-vertex-QDNCMHLE.js +1 -0
- package/dist/bundle/chunks/http-proxy-6TR4MP55.js +1 -0
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +12 -0
- package/dist/bundle/chunks/image-resize-worker.js +1 -0
- package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +20 -0
- package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +1 -0
- package/dist/bundle/chunks/kimi-coding.js +1 -0
- package/dist/bundle/chunks/lib-TEDK3E5I.js +8 -0
- package/dist/bundle/chunks/llama-cpp-classify-FYN623RH.js +21 -0
- package/dist/bundle/chunks/meta.js +1 -0
- package/dist/bundle/chunks/mistral-conversations-YHX5TRKG.js +4 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +2 -0
- package/dist/bundle/chunks/node-N5BSDOA5.js +15 -0
- package/dist/bundle/chunks/node-TWVVAGPO.js +1 -0
- package/dist/bundle/chunks/openai-chatgpt.js +74 -0
- package/dist/bundle/chunks/openai-codex-responses-UZEMMAYZ.js +9 -0
- package/dist/bundle/chunks/openai-codex.js +74 -0
- package/dist/bundle/chunks/openai-completions-H6WMELZZ.js +6 -0
- package/dist/bundle/chunks/openai-decisions-URHWCZPN.js +4 -0
- package/dist/bundle/chunks/openai-responses-7X65PCAB.js +2 -0
- package/dist/bundle/chunks/openrouter-images-DUPG5DZO.js +1 -0
- package/dist/bundle/chunks/openrouter.js +74 -0
- package/dist/bundle/chunks/pi-messages-YHKPQIHC.js +7 -0
- package/dist/bundle/chunks/radius.js +74 -0
- package/dist/bundle/chunks/runtime-LLITCT4N.js +1 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +3 -0
- package/dist/bundle/chunks/typesafe-system-one-N7PKHI2N.js +1 -0
- package/dist/bundle/chunks/virtual-modules-H32OTUCD.js +1 -0
- package/dist/bundle/chunks/xai.js +1 -0
- package/dist/bundle/cli-runtime.js +2 -0
- package/dist/bundle/cli.js +2 -0
- package/dist/bundle/index.js +1 -0
- package/dist/bundle/rpc-entry.js +2 -0
- package/dist/core/key-id-schema.js +1 -0
- package/dist/core/keybindings-schema.js +1 -0
- package/dist/core/settings-defaults.js +1 -0
- package/dist/core/settings-schema.js +1 -0
- package/dist/core/system-prompt.js +9 -9
- package/dist/modes/interactive/components/daxnuts.js +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.js +31 -31
- package/dist/modes/interactive/theme/theme-schema.js +12 -0
- package/dist/modes/interactive/theme/theme-tokens.js +1 -0
- package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-guard/src/index.js +1 -1
- package/dist/node_modules/@dalcode/dal-guard/src/mode.js +2 -0
- package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-lsp/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
- package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +1 -1
- package/dist/node_modules/@dalcode/dal-plugins/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
- package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
- package/dist/node_modules/@dalcode/dal-telemetry/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
- package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
- package/dist/node_modules/@dalcode/dal-workflow/src/check-in.js +2 -0
- package/dist/node_modules/@dalcode/dal-workflow/src/index.js +4 -4
- package/dist/node_modules/@dalcode/dal-workflow/src/todo.js +2 -2
- package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
- package/dist/node_modules/@earendil-works/chord/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/compat-schema.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/node_modules/@earendil-works/pi-ai/dist/providers/model-schema.js +1 -0
- package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
- package/dist/node_modules/@earendil-works/pi-server/package.json +3 -3
- package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/dist/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +132 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/dist/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
- package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var f=Object.defineProperty;var c=(o,r)=>f(o,"name",{value:r,configurable:!0});import{Type as e}from"typebox";import{Compile as g}from"typebox/compile";import{THEME_TOKENS as u}from"./theme-tokens.js";function s(o){return e.Union([e.String({description:"Hex color (#RGB or #RRGGBB), OKLCH or OKHSL color, variable reference, or empty string for terminal default"}),e.Integer({minimum:0,maximum:255,description:"256-color palette index (0-255)"})],o?{description:o}:{})}c(s,"colorValue");const b=s();function O(o){const r={};for(const[l,n]of Object.entries(o)){const i=s(n.description);r[l]=n.fallback===void 0?i:e.Optional(i)}return r}c(O,"themeTokenProperties");const k=e.Unsafe(e.Object(O(u),{description:"Theme color definitions (scrollbar, thinkingMax, and search highlight colors are optional and use compatible fallbacks)",additionalProperties:!1})),P=e.Object({$schema:e.Optional(e.String({description:"JSON schema reference"})),name:e.String({pattern:"^[^/]+$",description:"Theme name. Must not contain '/' because it is reserved for automatic light/dark theme settings."}),appearance:e.Optional(e.Union([e.Literal("dark"),e.Literal("light")],{description:"Background the theme is designed for. Detected from the theme colors when omitted."})),vars:e.Optional(e.Record(e.String(),b,{description:"Reusable color variables"})),colors:k,export:e.Optional(e.Object({pageBg:e.Optional(s("Page background color")),cardBg:e.Optional(s("Card/container background color")),infoBg:e.Optional(s("Info sections background (system prompt, notices)"))},{description:"Optional colors for HTML export (defaults derived from userMessageBg if not specified)",additionalProperties:!1}))},{title:"Pi Coding Agent Theme",description:"Theme schema for Pi coding agent",additionalProperties:!1}),m=g(P);function x(o,r){if(typeof r=="object"&&r!==null&&"name"in r&&typeof r.name=="string"&&r.name.includes("/"))throw new Error(`Invalid theme name "${r.name}": theme names cannot contain "/" because it is reserved for automatic light/dark theme settings.`);if(!m.Check(r)){const l=Array.from(m.Errors(r)),n=new Set,i=[];for(const t of l){if(t.keyword==="required"&&t.instancePath==="/colors"){const p=t.params.requiredProperties;for(const h of p??[])n.add(h);continue}const d=t.instancePath||"/";i.push(` - ${d}: ${t.message}`)}let a=`Invalid theme "${o}":
|
|
2
|
+
`;throw n.size>0&&(a+=`
|
|
3
|
+
Missing required color tokens:
|
|
4
|
+
`,a+=Array.from(n).sort().map(t=>` - ${t}`).join(`
|
|
5
|
+
`),a+=`
|
|
6
|
+
|
|
7
|
+
Please add these colors to your theme's "colors" object.`,a+=`
|
|
8
|
+
See the built-in themes (dark.json, light.json) for reference values.`),i.length>0&&(a+=`
|
|
9
|
+
|
|
10
|
+
Other errors:
|
|
11
|
+
${i.join(`
|
|
12
|
+
`)}`),new Error(a)}return r}c(x,"validateThemeJson");export{b as ColorValueSchema,P as ThemeJsonSchema,x as validateThemeJson};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var n=(o,t)=>i(o,"name",{value:t,configurable:!0});function s(o){for(const[t,e]of Object.entries(o)){if(e.fallback===void 0)continue;const r=o[e.fallback];if(r===void 0)throw new Error(`Theme token ${t} has unknown fallback ${e.fallback}`);if(r.slot!==e.slot)throw new Error(`Theme token ${t} has fallback ${e.fallback} in a different color slot`)}return o}n(s,"defineThemeTokens");const l=s({accent:{slot:"foreground",description:"Primary accent color (logo, selected items, cursor)"},border:{slot:"foreground",description:"Normal borders"},borderAccent:{slot:"foreground",description:"Highlighted borders"},borderMuted:{slot:"foreground",description:"Subtle borders"},success:{slot:"foreground",description:"Success states"},error:{slot:"foreground",description:"Error states"},warning:{slot:"foreground",description:"Warning states"},muted:{slot:"foreground",description:"Secondary/dimmed text"},dim:{slot:"foreground",description:"Very dimmed text (more subtle than muted)"},text:{slot:"foreground",description:"Default text color (usually empty string)"},thinkingText:{slot:"foreground",description:"Thinking block text color"},scrollbarTrack:{slot:"foreground",description:"Fullscreen scrollbar track foreground (falls back to muted when omitted)",fallback:"muted"},scrollbarThumb:{slot:"foreground",description:"Fullscreen scrollbar thumb foreground (falls back to text when omitted)",fallback:"text"},selectedBg:{slot:"background",description:"Selected item background"},searchMatchBg:{slot:"background",description:"Transcript search match background and current-match text (falls back to selectedBg when omitted)",fallback:"selectedBg"},searchMatchText:{slot:"foreground",description:"Transcript search match text and current-match background (falls back to text when omitted)",fallback:"text"},userMessageBg:{slot:"background",description:"User message background"},userMessageText:{slot:"foreground",description:"User message text color"},customMessageBg:{slot:"background",description:"Custom message background (hook-injected messages)"},customMessageText:{slot:"foreground",description:"Custom message text color"},customMessageLabel:{slot:"foreground",description:"Custom message type label color"},toolPendingBg:{slot:"background",description:"Tool execution box (pending state)"},toolSuccessBg:{slot:"background",description:"Tool execution box (success state)"},toolErrorBg:{slot:"background",description:"Tool execution box (error state)"},toolTitle:{slot:"foreground",description:"Tool execution box title color"},toolOutput:{slot:"foreground",description:"Tool execution box output text color"},mdHeading:{slot:"foreground",description:"Markdown heading text"},mdLink:{slot:"foreground",description:"Markdown link text"},mdLinkUrl:{slot:"foreground",description:"Markdown link URL"},mdCode:{slot:"foreground",description:"Markdown inline code"},mdCodeBlock:{slot:"foreground",description:"Markdown code block content"},mdCodeBlockBorder:{slot:"foreground",description:"Markdown code block fences"},mdQuote:{slot:"foreground",description:"Markdown blockquote text"},mdQuoteBorder:{slot:"foreground",description:"Markdown blockquote border"},mdHr:{slot:"foreground",description:"Markdown horizontal rule"},mdListBullet:{slot:"foreground",description:"Markdown list bullets/numbers"},toolDiffAdded:{slot:"foreground",description:"Added lines in tool diffs"},toolDiffRemoved:{slot:"foreground",description:"Removed lines in tool diffs"},toolDiffContext:{slot:"foreground",description:"Context lines in tool diffs"},syntaxComment:{slot:"foreground",description:"Syntax highlighting: comments"},syntaxKeyword:{slot:"foreground",description:"Syntax highlighting: keywords"},syntaxFunction:{slot:"foreground",description:"Syntax highlighting: function names"},syntaxVariable:{slot:"foreground",description:"Syntax highlighting: variable names"},syntaxString:{slot:"foreground",description:"Syntax highlighting: string literals"},syntaxNumber:{slot:"foreground",description:"Syntax highlighting: number literals"},syntaxType:{slot:"foreground",description:"Syntax highlighting: type names"},syntaxOperator:{slot:"foreground",description:"Syntax highlighting: operators"},syntaxPunctuation:{slot:"foreground",description:"Syntax highlighting: punctuation"},thinkingOff:{slot:"foreground",description:"Thinking level border: off"},thinkingMinimal:{slot:"foreground",description:"Thinking level border: minimal"},thinkingLow:{slot:"foreground",description:"Thinking level border: low"},thinkingMedium:{slot:"foreground",description:"Thinking level border: medium"},thinkingHigh:{slot:"foreground",description:"Thinking level border: high"},thinkingXhigh:{slot:"foreground",description:"Thinking level border: xhigh"},thinkingMax:{slot:"foreground",description:"Thinking level border: max (falls back to thinkingXhigh when omitted)",fallback:"thinkingXhigh"},bashMode:{slot:"foreground",description:"Editor border color in bash mode"}});export{l as THEME_TOKENS};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
21
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
22
22
|
"typebox": "1.3.7"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-gateway",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dalcode/deepailab": "1.0.
|
|
20
|
+
"@dalcode/deepailab": "1.0.30"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@earendil-works/pi-coding-agent": "^1.0.9"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-guard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
22
|
-
"@dalcode/dal-bridge": "1.0.
|
|
23
|
-
"@dalcode/dal-halo": "1.0.
|
|
21
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
22
|
+
"@dalcode/dal-bridge": "1.0.30",
|
|
23
|
+
"@dalcode/dal-halo": "1.0.30"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@earendil-works/pi-coding-agent": "^1.0.9"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var U=Object.defineProperty;var l=(u,s)=>U(u,"name",{value:s,configurable:!0});var H=Object.defineProperty,r=l((u,s)=>H(u,"name",{value:s,configurable:!0}),"a");import{realpathSync as N}from"node:fs";import{basename as L,dirname as V,isAbsolute as G,join as q,relative as W,resolve as C,sep as J}from"node:path";import{readBridgeConfig as c}from"@dalcode/dal-bridge/client";import{getOwnTty as K,requestHaloApproval as Z}from"@dalcode/dal-halo";import{hasChosenLanguage as Q,t as e}from"@dalcode/dal-pi-kit";import{DAL_HOOK_NOTIFICATION_CHANNEL as X,getAgentDir as A,registerSandboxEscalationHandler as Y}from"@earendil-works/pi-coding-agent";import{credentialBlockReason as uu,namesDalCredential as eu,redactContent as au}from"./credentials.js";import{exportGuardMode as su,saveGuardMode as I,shouldAskGuardMode as tu,startupGuardMode as ou}from"./mode.js";import{reviewBashCommand as ru}from"./review.js";import{dalSecretValues as nu,namesDalCredential as iu,REDACTED as lu,redactContent as Fu,redactDalSecrets as du}from"./credentials.js";import{GUARD_MODE_ENV as Eu,savedGuardMode as cu,saveGuardMode as Au,shouldAskGuardMode as Du,startupGuardMode as mu}from"./mode.js";import{reviewBashCommand as Bu,suspicionFor as fu}from"./review.js";function g(u){try{return N(u)}catch{try{return q(N(V(u)),L(u))}catch{return u}}}l(g,"x"),r(g,"realPathBestEffort");const F=r(u=>s=>u.test(s),"has"),pu=[{id:"sudo",label:e("\u7279\u6743\u6267\u884C\uFF08sudo/doas\uFF09"),test:F(/(^|[;&|\n]\s*)(sudo|doas)\s/)},{id:"force-push",label:e("\u5F3A\u5236\u63A8\u9001\u5C06\u6539\u5199\u8FDC\u7A0B\u5386\u53F2"),test:F(/git\s+push\b[^;&|]*(--force\b|--force-with-lease\b|\s-f\b)/)},{id:"hard-reset",label:e("\u786C\u91CD\u7F6E\u4F1A\u4E22\u5F03\u672C\u5730\u6539\u52A8"),test:F(/git\s+reset\b[^;&|]*--hard/)},{id:"git-clean",label:e("git clean \u4F1A\u5220\u9664\u672A\u8DDF\u8E2A\u6587\u4EF6"),test:F(/git\s+clean\b[^;&|]*(-[a-z]*f|--force)/)},{id:"pipe-to-shell",label:e("\u5C06\u4E0B\u8F7D\u5185\u5BB9\u76F4\u63A5\u7BA1\u9053\u6267\u884C"),test:F(/(curl|wget)\b[^;&|]*\|\s*(ba|z|da|fi)?sh\b/)},{id:"exec-download",label:e("\u6267\u884C\u4E0B\u8F7D\u7684\u811A\u672C"),test:F(/\b(ba|z|da|fi)?sh\s+<\(\s*(curl|wget)\b|eval\b[^;&|\n]*\$\(\s*(curl|wget)\b/)},{id:"recursive-perms",label:e("\u9012\u5F52\u4FEE\u6539\u6743\u9650/\u5C5E\u4E3B"),test:F(/(chmod|chown)\b[^;&|]*-[a-zA-Z]*R/)},{id:"publish",label:e("\u53D1\u5E03\u8F6F\u4EF6\u5305"),test:F(/(npm|pnpm|yarn)\s+publish\b/)},{id:"kill",label:e("\u6309\u540D\u79F0\u7ED3\u675F\u8FDB\u7A0B"),test:F(/(^|[;&|\n]\s*)(killall|pkill)\s/)},{id:"disk",label:e("\u5E95\u5C42\u78C1\u76D8\u64CD\u4F5C"),test:F(/(^|[;&|\n]\s*)(dd|mkfs\w*|diskutil|fdisk)\s/)}];function h(u){return pu.find(s=>s.test(u))}l(h,"X"),r(h,"riskForBash");function b(u,s){const t=g(G(u)?C(u):C(s,u)),a=g(C(s)),o=W(a,t);return o===".."||o.startsWith(`..${J}`)||G(o)}l(b,"Y"),r(b,"pathOutsideProject");function y(u,s){if(u.toolName.startsWith("mcp__")){const t=u.toolName.split("__")[1]||"unknown",a=JSON.stringify(u.input??{});return{ruleId:`mcp:${t}`,title:`${e("\u7B2C\u4E09\u65B9 MCP \u5DE5\u5177\u8C03\u7528\uFF08")}${t}${e("\uFF09")}`,detail:`${u.toolName} ${a.length>200?`${a.slice(0,200)}\u2026`:a}`}}if(u.toolName==="bash"){const t=String(u.input.command??""),a=h(t);return a?{ruleId:`bash:${a.id}`,title:a.label,detail:t}:void 0}if(u.toolName==="edit"||u.toolName==="write"){const t=String(u.input.path??u.input.file_path??"");if(t&&b(t,s))return{ruleId:`${u.toolName}:outside-project`,title:e("\u9879\u76EE\u76EE\u5F55\u4E4B\u5916\u7684\u6587\u4EF6\u6539\u52A8"),detail:t}}}l(y,"ee"),r(y,"classify");async function S(u,s){if(u.toolName!=="bash")return;const t=String(u.input.command??""),a=await ru(t,s);if(a)return{ruleId:`bash:jev-${a.suspicion.id}`,title:`${e("jev \u590D\u6838\u5224\u5B9A\u53EF\u7591")} (${Math.round(a.confidence*100)}%)`,detail:t}}l(S,"oe"),r(S,"secondOpinion");const Cu=r(()=>e("\u4EC5\u672C\u6B21\u5141\u8BB8"),"allowOnce"),gu=r(()=>e("\u672C\u6B21\u4F1A\u8BDD\u5185\u5141\u8BB8\uFF08\u540C\u7C7B\u64CD\u4F5C\uFF09"),"allowSession"),hu=r(()=>e("\u62D2\u7EDD"),"deny"),O=Symbol.for("dalcode.guard.state"),T=globalThis;T[O]??={mode:"default",sessionAllows:new Set};const i=T[O];function D(u){i.mode=u,su(u)}l(D,"w"),r(D,"setGuardMode");function P(){i.escalationApprover||(i.escalationApprover=Y(()=>{if(!(i.mode!=="yolo"||c(process.env)))return{approved:!0,scope:"once"}}))}l(P,"re"),r(P,"registerEscalationApprover");const m=i.sessionAllows;async function v(u,s,t,a,o,d=process.env,B){if(eu(u,s))return{block:!0,reason:uu()};if(i.mode==="yolo"||c(d))return;const n=y(u,s)??await S(u,s);if(!n||m.has(n.ruleId))return;if(!t||!a)return{block:!0,reason:`${e('dal-guard\uFF1A"')}${n.title}${e('"\u9700\u8981\u4EA4\u4E92\u5F0F\u5BA1\u6279\uFF08')}${n.detail}${e("\uFF09\u3002\u8BF7\u5728\u4EA4\u4E92\u6A21\u5F0F\u4E0B\u91CD\u8BD5\uFF0C\u6216\u7528 /guard yolo \u5173\u95ED\u5BA1\u6279\u95E8\u3002")}`};const f=o?Z({session_id:o.sessionId,cwd:s,event:"PermissionRequest",status:"waiting_for_approval",pid:process.pid,tty:K(),tool:u.toolName,tool_input:{command:n.detail},tool_use_id:u.toolCallId,productName:"dal"}):void 0;B?.({type:"permission_prompt",message:`DAL needs your permission to use ${u.toolName}`});const $=new AbortController,[p,w,_]=[Cu(),gu(),hu()],R=a.select(`${e("\u9700\u8981\u5BA1\u6279\uFF1A")}${n.title} \u2014 ${n.detail}`,[p,w,_],{signal:$.signal}).then(E=>({surface:"terminal",choice:E})),z=f?f.decision.then(E=>E===void 0?new Promise(()=>{}):{surface:"halo",choice:E==="allow"?p:_}):new Promise(()=>{}),M=await Promise.race([R,z]);M.surface==="halo"?$.abort():f?.cancel();const k=M.choice;if(k!==p){if(k===w){m.add(n.ruleId);return}return{block:!0,reason:`${e("dal-guard\uFF1A\u7528\u6237\u5DF2\u62D2\u7EDD\uFF08")}${n.title}${e("\uFF09\u3002")}`}}}l(v,"ae"),r(v,"evaluateToolCall");async function j(u){const s=e("\u5168\u81EA\u52A8\uFF1A\u4E0D\u518D\u8BE2\u95EE\uFF0C\u53EA\u62E6\u622A\u7834\u574F\u6027\u547D\u4EE4\uFF08\u63A8\u8350\u719F\u6089\u7684\u7528\u6237\uFF09"),t=e("\u6BCF\u6B21\u8BE2\u95EE\uFF1A\u9AD8\u98CE\u9669\u64CD\u4F5C\u548C\u8D8A\u51FA\u6C99\u7BB1\u524D\u5148\u95EE\u6211"),a=await u.ui.select(e("\u9009\u62E9 dal \u7684\u5DE5\u4F5C\u65B9\u5F0F\uFF08\u4EE5\u540E\u53EF\u7528 /guard \u4FEE\u6539\uFF09"),[s,t]);if(a===void 0)return;const o=a===s?"yolo":"default";D(o);try{I(A(),o)}catch(d){u.ui.notify(`${e("\u4FDD\u5B58\u5931\u8D25\uFF1A")}${d instanceof Error?d.message:String(d)}`,"error");return}u.ui.notify(o==="yolo"?e("\u5DF2\u8BBE\u4E3A\u5168\u81EA\u52A8\u3002\u6539\u56DE\u6BCF\u6B21\u8BE2\u95EE\uFF1A/guard default save"):e("\u5DF2\u8BBE\u4E3A\u6BCF\u6B21\u8BE2\u95EE\u3002\u6539\u6210\u5168\u81EA\u52A8\uFF1A/guard yolo save"),"info")}l(j,"ie"),r(j,"askGuardModeOnce");function x(u){u.registerFlag("yolo",{description:e("\u4EE5\u5168\u81EA\u52A8\u6A21\u5F0F\u542F\u52A8\uFF1A\u4E0D\u518D\u5F39\u51FA\u4EFB\u4F55\u5BA1\u6279\uFF08\u542B\u6C99\u7BB1\u8D8A\u6743\uFF09\uFF0C\u53EA\u62E6\u622A\u7834\u574F\u6027\u547D\u4EE4\u548C\u767B\u5F55\u51ED\u636E"),type:"boolean",default:!1}),P();let s="default";u.on("session_start",async(t,a)=>{if(s="default",i.started)return;i.started=!0;const o=u.getFlag("yolo")===!0;D(ou(A(),o)),t.reason==="startup"&&tu({agentDir:A(),mode:a.mode,hasUI:a.hasUI,flag:o,underDalCode:!!c(process.env),languageChosen:Q()})&&await j(a)}),u.on("before_agent_start",async()=>{if(!(i.mode===s||c(process.env)))return s=i.mode,{message:{customType:"dal-guard-mode",content:i.mode==="yolo"?e("[\u5168\u81EA\u52A8\u6A21\u5F0F] \u7528\u6237\u5F00\u542F\u4E86\u5168\u81EA\u52A8\uFF1A\u6240\u6709\u5BA1\u6279\uFF08\u5305\u62EC sandbox_escalation \u8D8A\u6743\uFF09\u90FD\u4F1A\u81EA\u52A8\u901A\u8FC7\uFF0C\u4E0D\u4F1A\u6709\u4EBA\u6765\u786E\u8BA4\u3002\u547D\u4EE4\u88AB\u6C99\u7BB1\u6321\u4F4F\u3001\u800C\u4EFB\u52A1\u786E\u5B9E\u9700\u8981\u65F6\uFF0C\u76F4\u63A5\u5E26 sandbox_escalation \u91CD\u8BD5\uFF0C\u4E0D\u8981\u505C\u4E0B\u6765\u95EE\u7528\u6237\u8981\u4E0D\u8981\u653E\u884C\u3002\u7834\u574F\u6027\u547D\u4EE4\u548C\u767B\u5F55\u51ED\u636E\u4ECD\u4F1A\u88AB\u62E6\u622A\u3002"):e("[\u5BA1\u6279\u5DF2\u6062\u590D] \u5168\u81EA\u52A8\u5DF2\u5173\u95ED\uFF1A\u8D8A\u6743\u548C\u9AD8\u98CE\u9669\u547D\u4EE4\u4F1A\u5148\u8BE2\u95EE\u7528\u6237\u3002"),display:!1}}}),u.on("tool_call",async(t,a)=>v(t,a.cwd,a.hasUI,a.ui,{sessionId:a.sessionManager.getSessionId()},process.env,o=>u.events.emit(X,o))),u.on("tool_result",async t=>{const a=au(t.content);return a?{content:a}:void 0}),u.registerCommand("guard",{description:e("\u67E5\u770B\u6216\u5207\u6362\u5BA1\u6279\u95E8\uFF08default | yolo\uFF0C\u52A0 save \u8BB0\u4E3A\u9ED8\u8BA4\uFF09"),handler:r(async(t,a)=>{const[o,d]=t.trim().split(/\s+/);if((o==="yolo"||o==="default")&&(D(o),d==="save"))try{I(A(),o),a.ui.notify(o==="yolo"?e("\u5DF2\u8BBE\u4E3A\u9ED8\u8BA4\uFF1A\u4EE5\u540E\u542F\u52A8\u90FD\u662F\u5168\u81EA\u52A8"):e("\u5DF2\u6062\u590D\u9ED8\u8BA4\uFF1A\u4EE5\u540E\u542F\u52A8\u90FD\u4F1A\u8BE2\u95EE"),"info")}catch(n){a.ui.notify(`${e("\u4FDD\u5B58\u5931\u8D25\uFF1A")}${n instanceof Error?n.message:String(n)}`,"error")}const B=m.size?`${e(" \xB7 \u672C\u6B21\u4F1A\u8BDD\u5DF2\u5141\u8BB8\uFF1A")}${[...m].join(", ")}`:"";a.ui.notify(`${e("dal-guard \u6A21\u5F0F\uFF1A")}${i.mode}${B}`,i.mode==="yolo"?"warning":"info")},"handler")})}l(x,"le"),r(x,"default");export{Eu as GUARD_MODE_ENV,lu as REDACTED,y as classify,nu as dalSecretValues,x as default,v as evaluateToolCall,iu as namesDalCredential,b as pathOutsideProject,Fu as redactContent,du as redactDalSecrets,Bu as reviewBashCommand,h as riskForBash,Au as saveGuardMode,cu as savedGuardMode,Du as shouldAskGuardMode,mu as startupGuardMode,fu as suspicionFor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var g=Object.defineProperty;var n=(o,r)=>g(o,"name",{value:r,configurable:!0});var G=Object.defineProperty,t=n((o,r)=>G(o,"name",{value:r,configurable:!0}),"o");import{existsSync as M,readFileSync as m,renameSync as D,writeFileSync as S}from"node:fs";import{join as h}from"node:path";const a="DAL_GUARD_MODE";function d(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}n(d,"u"),t(d,"isRecord");function u(o){try{const r=JSON.parse(m(o,"utf8"));return d(r)?r:void 0}catch{return}}n(u,"s"),t(u,"readJson");function i(o){return h(o,"settings.json")}n(i,"i"),t(i,"userSettingsPath");function c(o){const r=u(i(o))?.guard,e=d(r)?r.mode:void 0;return e==="yolo"||e==="default"?e:void 0}n(c,"f"),t(c,"savedGuardMode");function f(o,r,e=process.env){return r||e[a]==="yolo"?"yolo":c(o)??"default"}n(f,"m"),t(f,"startupGuardMode");function v(o,r){const e=i(o);if(M(e)&&u(e)===void 0)throw new Error(`${e} is not valid JSON; not overwriting it`);const s=u(e)??{};s.guard={...d(s.guard)?s.guard:{},mode:r};const l=`${e}.${process.pid}.tmp`;S(l,`${JSON.stringify(s,null,2)}
|
|
2
|
+
`),D(l,e)}n(v,"D"),t(v,"saveGuardMode");function p(o,r=process.env){o==="yolo"?r[a]="yolo":delete r[a]}n(p,"x"),t(p,"exportGuardMode");function y(o){const r=o.env??process.env;return o.mode!=="tui"||!o.hasUI||o.flag||o.underDalCode||r[a]||r.DAL_SUBAGENT_DEPTH||!o.languageChosen?!1:c(o.agentDir)===void 0}n(y,"h"),t(y,"shouldAskGuardMode");export{a as GUARD_MODE_ENV,p as exportGuardMode,v as saveGuardMode,c as savedGuardMode,y as shouldAskGuardMode,f as startupGuardMode,i as userSettingsPath};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-interactive",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Terminal-UI conveniences adopted from pi's example extensions: the questionnaire tool (the model asks you questions), /handoff (carry context into a new session) and interactive ! commands (vim, git rebase -i, htop). Active only in the TUI; stands down under DAL Code.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
22
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
23
23
|
"typebox": "1.3.7"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-lang",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
21
|
-
"@dalcode/dal-bridge": "1.0.
|
|
20
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
21
|
+
"@dalcode/dal-bridge": "1.0.30"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@earendil-works/pi-coding-agent": "^1.0.9"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-lsp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@dalcode/dal-bridge": "1.0.
|
|
23
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
22
|
+
"@dalcode/dal-bridge": "1.0.30",
|
|
23
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
24
24
|
"cross-spawn": "7.0.6",
|
|
25
25
|
"typebox": "1.3.7"
|
|
26
26
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dalcode/dal-bridge": "1.0.
|
|
30
|
-
"@dalcode/dal-guard": "1.0.
|
|
31
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
32
|
-
"@dalcode/deepailab": "1.0.
|
|
29
|
+
"@dalcode/dal-bridge": "1.0.30",
|
|
30
|
+
"@dalcode/dal-guard": "1.0.30",
|
|
31
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
32
|
+
"@dalcode/deepailab": "1.0.30",
|
|
33
33
|
"cross-spawn": "7.0.6"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalcode/dal-office",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dalcode/dal-pi-kit": "1.0.
|
|
20
|
+
"@dalcode/dal-pi-kit": "1.0.30",
|
|
21
21
|
"docx": "9.7.1",
|
|
22
22
|
"echarts": "6.1.0",
|
|
23
23
|
"exceljs": "4.4.0",
|