dal-code 1.0.32 → 1.0.34

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/NOTICE +8 -0
  3. package/dist/core/agent-session.d.ts +3 -0
  4. package/dist/core/agent-session.js +8 -8
  5. package/dist/core/bash-executor.js +1 -1
  6. package/dist/core/bug-report.js +4 -4
  7. package/dist/core/compaction/branch-summarization.js +2 -2
  8. package/dist/core/compaction/compaction.d.ts +4 -2
  9. package/dist/core/compaction/compaction.js +13 -13
  10. package/dist/core/compaction/index.d.ts +1 -0
  11. package/dist/core/compaction/index.js +1 -1
  12. package/dist/core/compaction/tool-output-pruning.d.ts +19 -0
  13. package/dist/core/compaction/tool-output-pruning.js +7 -0
  14. package/dist/core/compaction/utils.d.ts +1 -0
  15. package/dist/core/compaction/utils.js +9 -9
  16. package/dist/core/sdk.js +1 -1
  17. package/dist/core/settings-manager.d.ts +11 -2
  18. package/dist/core/settings-manager.js +1 -1
  19. package/dist/core/source-info.d.ts +1 -0
  20. package/dist/core/source-info.js +1 -1
  21. package/dist/core/system-prompt.d.ts +3 -0
  22. package/dist/core/system-prompt.js +19 -13
  23. package/dist/core/tools/bash.d.ts +1 -1
  24. package/dist/core/tools/bash.js +19 -15
  25. package/dist/core/tools/output-accumulator.js +3 -3
  26. package/dist/core/tools/output-condense.js +3 -0
  27. package/dist/core/tools/powershell.d.ts +1 -1
  28. package/dist/core/tools/powershell.js +1 -1
  29. package/dist/dal/manifest.js +1 -1
  30. package/dist/modes/interactive/interactive-mode.js +13 -13
  31. package/dist/node_modules/@dalcode/dal-bridge/package.json +2 -2
  32. package/dist/node_modules/@dalcode/dal-gateway/package.json +2 -2
  33. package/dist/node_modules/@dalcode/dal-goal/LICENSE +45 -0
  34. package/dist/node_modules/@dalcode/dal-goal/package.json +35 -0
  35. package/dist/node_modules/@dalcode/dal-goal/src/core.js +10 -0
  36. package/dist/node_modules/@dalcode/dal-goal/src/index.js +7 -0
  37. package/dist/node_modules/@dalcode/dal-guard/package.json +4 -4
  38. package/dist/node_modules/@dalcode/dal-halo/package.json +1 -1
  39. package/dist/node_modules/@dalcode/dal-interactive/package.json +2 -2
  40. package/dist/node_modules/@dalcode/dal-lang/package.json +3 -3
  41. package/dist/node_modules/@dalcode/dal-lsp/package.json +4 -3
  42. package/dist/node_modules/@dalcode/dal-lsp/src/checkers.js +4 -0
  43. package/dist/node_modules/@dalcode/dal-lsp/src/index.js +8 -6
  44. package/dist/node_modules/@dalcode/dal-mcp/package.json +5 -5
  45. package/dist/node_modules/@dalcode/dal-office/package.json +2 -2
  46. package/dist/node_modules/@dalcode/dal-pi-kit/dist/i18n.js +3 -2
  47. package/dist/node_modules/@dalcode/dal-pi-kit/package.json +1 -1
  48. package/dist/node_modules/@dalcode/dal-pi-kit/src/i18n.js +3 -2
  49. package/dist/node_modules/@dalcode/dal-plugins/package.json +4 -2
  50. package/dist/node_modules/@dalcode/dal-plugins/src/brand.d.ts +17 -0
  51. package/dist/node_modules/@dalcode/dal-plugins/src/brand.js +1 -1
  52. package/dist/node_modules/@dalcode/dal-plugins/src/index.js +12 -8
  53. package/dist/node_modules/@dalcode/dal-plugins/src/manage.js +8 -8
  54. package/dist/node_modules/@dalcode/dal-plugins/src/market.js +4 -0
  55. package/dist/node_modules/@dalcode/dal-plugins/src/settings.js +1 -1
  56. package/dist/node_modules/@dalcode/dal-review/package.json +3 -3
  57. package/dist/node_modules/@dalcode/dal-rewind/LICENSE +24 -0
  58. package/dist/node_modules/@dalcode/dal-rewind/package.json +2 -2
  59. package/dist/node_modules/@dalcode/dal-router/package.json +4 -4
  60. package/dist/node_modules/@dalcode/dal-router/src/index.js +4 -4
  61. package/dist/node_modules/@dalcode/dal-skills/package.json +3 -3
  62. package/dist/node_modules/@dalcode/dal-subagent/package.json +5 -5
  63. package/dist/node_modules/@dalcode/dal-subagent/src/index.js +14 -13
  64. package/dist/node_modules/@dalcode/dal-subagent/src/process-runner.js +3 -3
  65. package/dist/node_modules/@dalcode/dal-telemetry/package.json +2 -2
  66. package/dist/node_modules/@dalcode/dal-terminal/package.json +2 -2
  67. package/dist/node_modules/@dalcode/dal-tool-catalog/package.json +2 -2
  68. package/dist/node_modules/@dalcode/dal-web/package.json +3 -3
  69. package/dist/node_modules/@dalcode/dal-workflow/package.json +2 -2
  70. package/dist/node_modules/@dalcode/deepailab/package.json +3 -3
  71. package/dist/node_modules/@dalcode/deepailab/src/index.js +3 -3
  72. package/dist/node_modules/@earendil-works/chord/package.json +1 -1
  73. package/dist/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  74. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  75. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  76. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
  77. package/dist/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  78. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +1 -0
  79. package/dist/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +1 -1
  80. package/dist/node_modules/@earendil-works/pi-ai/package.json +2 -2
  81. package/dist/node_modules/@earendil-works/pi-client/package.json +3 -3
  82. package/dist/node_modules/@earendil-works/pi-codemode/package.json +1 -1
  83. package/dist/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
  84. package/dist/node_modules/@earendil-works/pi-mcp/package.json +1 -1
  85. package/dist/node_modules/@earendil-works/pi-protocol/package.json +2 -2
  86. package/dist/node_modules/@earendil-works/pi-server/package.json +3 -3
  87. package/dist/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  88. package/dist/node_modules/@earendil-works/pi-tui/package.json +1 -1
  89. package/dist/sdk/index.d.ts +1 -0
  90. package/dist/sdk/index.js +1 -1
  91. package/dist/utils/clipboard-image.js +1 -1
  92. package/dist/utils/clipboard.js +1 -1
  93. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  94. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  95. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  96. package/examples/extensions/gondolin/package-lock.json +2 -2
  97. package/examples/extensions/gondolin/package.json +1 -1
  98. package/examples/extensions/sandbox/package-lock.json +2 -2
  99. package/examples/extensions/sandbox/package.json +1 -1
  100. package/examples/extensions/with-deps/package-lock.json +2 -2
  101. package/examples/extensions/with-deps/package.json +1 -1
  102. package/npm-shrinkwrap.json +2 -2
  103. package/package.json +1 -1
@@ -14,3 +14,4 @@ export interface RetryCallbacks {
14
14
  }
15
15
  export declare function retryAssistantCall(produce: () => Promise<AssistantMessage>, policy: RetryPolicy | undefined, signal: AbortSignal | undefined, callbacks?: RetryCallbacks): Promise<AssistantMessage>;
16
16
  export declare function isRetryableAssistantError(message: AssistantMessage): boolean;
17
+ export declare function isAccountLimitAssistantError(message: Pick<AssistantMessage, "stopReason" | "errorMessage">): boolean;
@@ -1 +1 @@
1
- var R=Object.defineProperty;var n=(e,r)=>R(e,"name",{value:r,configurable:!0});function f(e){return new RegExp(e.join("|"),"i")}n(f,"buildProviderErrorPattern");const y=f(["GoUsageLimitError","FreeUsageLimitError","Monthly usage limit reached","available balance","insufficient_quota","out of budget","quota exceeded","billing","subscription_sharing_usage_limit_exceeded"]),p=f(["overloaded","server_busy","servers are currently busy","currently experiencing high demand","model is at capacity","rate.?limit","too many requests","429","500","502","503","504","520","524","service.?unavailable","server.?error","internal.?error","empty response","provider.?returned.?error","exceeded request buffer limit while retrying upstream","network.?error","connection.?error","connection.?refused","connection.?lost","other side closed","fetch failed","getaddrinfo","ENOTFOUND","EAI_AGAIN","upstream.?connect","reset before headers","socket hang up","socket connection was closed","timed? out","timeout","terminated","websocket.?closed","websocket.?error","ended without","stream ended before message_stop","stream ended before a terminal response event","http2 request did not get a response","pending stream has been canceled","retry delay","you can retry your request","try your request again","please retry your request","ResourceExhausted","subscription_sharing_usage_unavailable","subscription_sharing_user_unavailable"]),_=6e4;function g(e,r){const a=e.baseDelayMs*2**Math.max(0,r-1),t=Number.isSafeInteger(a)?a:Number.MAX_SAFE_INTEGER;return Math.min(t,e.maxAgentDelayMs??_)}n(g,"retryDelayMs");class d extends Error{static{n(this,"RetrySleepAbortError")}constructor(){super("Aborted")}}function E(e,r){return new Promise((a,t)=>{if(r?.aborted){t(new d);return}const u=setTimeout(a,e);r?.addEventListener("abort",()=>{clearTimeout(u),t(new d)},{once:!0})})}n(E,"sleep");async function w(e,r,a,t){const u=r?.enabled?r.maxRetries:0;let i=0,s;for(;;){const o=await e();if(o.stopReason==="aborted")return s&&await t?.onRetryFinished?.(!1,s.attempt),o;if(o.stopReason!=="error")return s&&await t?.onRetryFinished?.(!0,s.attempt),o;if(i>=u||!b(o))return s&&await t?.onRetryFinished?.(!1,s.attempt,o.errorMessage),o;i++,s={attempt:i,errorMessage:o.errorMessage||"Unknown error"};const c=g(r,i);await t?.onRetryScheduled?.(i,u,c,s.errorMessage);try{await E(c,a)}catch(l){if(await t?.onRetryFinished?.(!1,i,s.errorMessage),l instanceof d){const{errorMessage:h,...m}=o;return{...m,stopReason:"aborted"}}throw l}await t?.onRetryAttemptStart?.()}}n(w,"retryAssistantCall");function b(e){if(e.stopReason!=="error"||!e.errorMessage)return!1;const r=e.errorMessage;return y.test(r)?!1:p.test(r)}n(b,"isRetryableAssistantError");export{_ as DEFAULT_MAX_AGENT_RETRY_DELAY_MS,b as isRetryableAssistantError,w as retryAssistantCall,g as retryDelayMs};
1
+ var R=Object.defineProperty;var n=(e,r)=>R(e,"name",{value:r,configurable:!0});function f(e){return new RegExp(e.join("|"),"i")}n(f,"buildProviderErrorPattern");const p=f(["GoUsageLimitError","FreeUsageLimitError","Monthly usage limit reached","available balance","insufficient_quota","out of budget","quota exceeded","billing","^\\s*(?:error:?\\s*)?402\\b","\\b(?:status|http|code)\\W{0,3}402\\b","payment.?required","insufficient.?(?:balance|credits?|funds)","credit balance is too low","exceeded your current quota","quota.?exhausted","\u4F59\u989D\u4E0D\u8DB3","subscription_sharing_usage_limit_exceeded"]),m=f(["overloaded","server_busy","servers are currently busy","currently experiencing high demand","model is at capacity","rate.?limit","too many requests","\\b(?:429|500|502|503|504|520|524)\\b","service.?unavailable","server.?error","internal.?error","empty response","provider.?returned.?error","exceeded request buffer limit while retrying upstream","network.?error","connection.?error","connection.?refused","connection.?lost","other side closed","fetch failed","getaddrinfo","ENOTFOUND","EAI_AGAIN","upstream.?connect","reset before headers","socket hang up","socket connection was closed","timed? out","timeout","terminated","websocket.?closed","websocket.?error","ended without","stream ended before message_stop","stream ended before a terminal response event","http2 request did not get a response","pending stream has been canceled","retry delay","you can retry your request","try your request again","please retry your request","ResourceExhausted","subscription_sharing_usage_unavailable","subscription_sharing_user_unavailable"]),b=6e4;function _(e,r){const a=e.baseDelayMs*2**Math.max(0,r-1),t=Number.isSafeInteger(a)?a:Number.MAX_SAFE_INTEGER;return Math.min(t,e.maxAgentDelayMs??b)}n(_,"retryDelayMs");class d extends Error{static{n(this,"RetrySleepAbortError")}constructor(){super("Aborted")}}function g(e,r){return new Promise((a,t)=>{if(r?.aborted){t(new d);return}const u=setTimeout(a,e);r?.addEventListener("abort",()=>{clearTimeout(u),t(new d)},{once:!0})})}n(g,"sleep");async function A(e,r,a,t){const u=r?.enabled?r.maxRetries:0;let i=0,s;for(;;){const o=await e();if(o.stopReason==="aborted")return s&&await t?.onRetryFinished?.(!1,s.attempt),o;if(o.stopReason!=="error")return s&&await t?.onRetryFinished?.(!0,s.attempt),o;if(i>=u||!E(o))return s&&await t?.onRetryFinished?.(!1,s.attempt,o.errorMessage),o;i++,s={attempt:i,errorMessage:o.errorMessage||"Unknown error"};const c=_(r,i);await t?.onRetryScheduled?.(i,u,c,s.errorMessage);try{await g(c,a)}catch(l){if(await t?.onRetryFinished?.(!1,i,s.errorMessage),l instanceof d){const{errorMessage:h,...y}=o;return{...y,stopReason:"aborted"}}throw l}await t?.onRetryAttemptStart?.()}}n(A,"retryAssistantCall");function E(e){if(e.stopReason!=="error"||!e.errorMessage)return!1;const r=e.errorMessage;return p.test(r)?!1:m.test(r)}n(E,"isRetryableAssistantError");function w(e){return e.stopReason!=="error"||!e.errorMessage?!1:p.test(e.errorMessage)}n(w,"isAccountLimitAssistantError");export{b as DEFAULT_MAX_AGENT_RETRY_DELAY_MS,w as isAccountLimitAssistantError,E as isRetryableAssistantError,A as retryAssistantCall,_ as retryDelayMs};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-ai",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Unified LLM API with automatic model discovery and provider configuration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "@anthropic-ai/sdk": "0.129.0",
60
60
  "@aws-sdk/client-bedrock-runtime": "3.1127.0",
61
- "@earendil-works/pi-telemetry": "^1.0.32",
61
+ "@earendil-works/pi-telemetry": "^1.0.34",
62
62
  "@google/genai": "2.21.0",
63
63
  "@opentelemetry/api": "1.9.0",
64
64
  "@smithy/node-http-handler": "4.12.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-client",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Transport-neutral client for remote pi sessions over framed CBOR bytes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "node": ">=22.19.0"
41
41
  },
42
42
  "dependencies": {
43
- "@earendil-works/chord": "^1.0.32",
44
- "@earendil-works/pi-protocol": "^1.0.32"
43
+ "@earendil-works/chord": "^1.0.34",
44
+ "@earendil-works/pi-protocol": "^1.0.34"
45
45
  }
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-codemode",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Sandboxed JavaScript execution where the only capability is calling injected tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-coding-agent",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "private": true,
5
5
  "description": "Self-reference to the package's own dist/index.js for the bundled extensions.",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-mcp",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Standalone Model Context Protocol client for pi and other applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-protocol",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Transport-neutral CBOR protocol for remote pi sessions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "node": ">=22.19.0"
34
34
  },
35
35
  "dependencies": {
36
- "@earendil-works/chord": "^1.0.32",
36
+ "@earendil-works/chord": "^1.0.34",
37
37
  "typebox": "1.3.27"
38
38
  }
39
39
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-server",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "experimental server package for pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "node": ">=22.19.0"
40
40
  },
41
41
  "dependencies": {
42
- "@earendil-works/chord": "^1.0.32",
43
- "@earendil-works/pi-protocol": "^1.0.32"
42
+ "@earendil-works/chord": "^1.0.34",
43
+ "@earendil-works/pi-protocol": "^1.0.34"
44
44
  }
45
45
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-telemetry",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Vendor-neutral telemetry contracts and typed schema utilities for pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earendil-works/pi-tui",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,3 +1,4 @@
1
+ export { brandText } from "@dalcode/dal-plugins/brand";
1
2
  export { TERMINAL_CAPABILITY, TERMINAL_CAPABILITY_VERSION, type TerminalInfo, type TerminalListResult, type TerminalReadParams, type TerminalReadResult, } from "@dalcode/dal-terminal/contract";
2
3
  export { CONFIG_DIR_NAME, getAgentDir, getExamplesPath, SHARED_SKILL_CONFIG_DIRS, VERSION } from "../config.ts";
3
4
  export type { AgentSessionEvent } from "../core/agent-session.ts";
package/dist/sdk/index.js CHANGED
@@ -1 +1 @@
1
- import{TERMINAL_CAPABILITY as r,TERMINAL_CAPABILITY_VERSION as e}from"@dalcode/dal-terminal/contract";import{CONFIG_DIR_NAME as i,getAgentDir as l,getExamplesPath as E,SHARED_SKILL_CONFIG_DIRS as p,VERSION as s}from"../config.js";import{HOST_CAPABILITIES_ENV as m,HOST_TOKEN_ENV as n,HOST_TOKEN_HEADER as A,HOST_URL_ENV as S}from"../core/host-capabilities.js";import{ModelRuntime as x}from"../core/model-runtime.js";import{DefaultPackageManager as I}from"../core/package-manager.js";import{buildProjectMap as O,formatProjectMapPrompt as D}from"../core/project-map.js";import{loadProjectContextFiles as L}from"../core/resource-loader.js";import{parseSessionEntries as R,SessionManager as g}from"../core/session-manager.js";import{SettingsManager as M}from"../core/settings-manager.js";import{loadSkills as c}from"../core/skills.js";import{DAL_HOOK_ENTRY_TYPE as k,dalHookActivity as B,isDalHookActivity as K,loadDalHooks as V,runDalHookEvent as b,runNotificationHooks as F,runUserPromptSubmitHooks as Y}from"../dal/hooks/index.js";import{BUNDLED_EXTENSION_PACKAGES as v,DAL_TOOL_NAMES as y,listBundledExtensions as G,listToolCatalog as U,toolDisplayLabel as h}from"../dal/manifest.js";import{RpcClient as q}from"../modes/rpc/rpc-client.js";import{parseFrontmatter as z}from"../utils/frontmatter.js";import{listBuiltinSubagents as Q}from"./subagents.js";export{v as BUNDLED_EXTENSION_PACKAGES,i as CONFIG_DIR_NAME,k as DAL_HOOK_ENTRY_TYPE,y as DAL_TOOL_NAMES,I as DefaultPackageManager,m as HOST_CAPABILITIES_ENV,n as HOST_TOKEN_ENV,A as HOST_TOKEN_HEADER,S as HOST_URL_ENV,x as ModelRuntime,q as RpcClient,p as SHARED_SKILL_CONFIG_DIRS,g as SessionManager,M as SettingsManager,r as TERMINAL_CAPABILITY,e as TERMINAL_CAPABILITY_VERSION,s as VERSION,O as buildProjectMap,B as dalHookActivity,D as formatProjectMapPrompt,l as getAgentDir,E as getExamplesPath,K as isDalHookActivity,Q as listBuiltinSubagents,G as listBundledExtensions,U as listToolCatalog,V as loadDalHooks,L as loadProjectContextFiles,c as loadSkills,z as parseFrontmatter,R as parseSessionEntries,b as runDalHookEvent,F as runNotificationHooks,Y as runUserPromptSubmitHooks,h as toolDisplayLabel};
1
+ import{brandText as r}from"@dalcode/dal-plugins/brand";import{TERMINAL_CAPABILITY as a,TERMINAL_CAPABILITY_VERSION as i}from"@dalcode/dal-terminal/contract";import{CONFIG_DIR_NAME as p,getAgentDir as E,getExamplesPath as m,SHARED_SKILL_CONFIG_DIRS as n,VERSION as s}from"../config.js";import{HOST_CAPABILITIES_ENV as x,HOST_TOKEN_ENV as f,HOST_TOKEN_HEADER as A,HOST_URL_ENV as S}from"../core/host-capabilities.js";import{ModelRuntime as I}from"../core/model-runtime.js";import{DefaultPackageManager as O}from"../core/package-manager.js";import{buildProjectMap as H,formatProjectMapPrompt as L}from"../core/project-map.js";import{loadProjectContextFiles as R}from"../core/resource-loader.js";import{parseSessionEntries as u,SessionManager as M}from"../core/session-manager.js";import{SettingsManager as C}from"../core/settings-manager.js";import{loadSkills as k}from"../core/skills.js";import{DAL_HOOK_ENTRY_TYPE as b,dalHookActivity as K,isDalHookActivity as V,loadDalHooks as F,runDalHookEvent as Y,runNotificationHooks as j,runUserPromptSubmitHooks as v}from"../dal/hooks/index.js";import{BUNDLED_EXTENSION_PACKAGES as G,DAL_TOOL_NAMES as U,listBundledExtensions as h,listToolCatalog as X,toolDisplayLabel as q}from"../dal/manifest.js";import{RpcClient as z}from"../modes/rpc/rpc-client.js";import{parseFrontmatter as Q}from"../utils/frontmatter.js";import{listBuiltinSubagents as Z}from"./subagents.js";export{G as BUNDLED_EXTENSION_PACKAGES,p as CONFIG_DIR_NAME,b as DAL_HOOK_ENTRY_TYPE,U as DAL_TOOL_NAMES,O as DefaultPackageManager,x as HOST_CAPABILITIES_ENV,f as HOST_TOKEN_ENV,A as HOST_TOKEN_HEADER,S as HOST_URL_ENV,I as ModelRuntime,z as RpcClient,n as SHARED_SKILL_CONFIG_DIRS,M as SessionManager,C as SettingsManager,a as TERMINAL_CAPABILITY,i as TERMINAL_CAPABILITY_VERSION,s as VERSION,r as brandText,H as buildProjectMap,K as dalHookActivity,L as formatProjectMapPrompt,E as getAgentDir,m as getExamplesPath,V as isDalHookActivity,Z as listBuiltinSubagents,h as listBundledExtensions,X as listToolCatalog,F as loadDalHooks,R as loadProjectContextFiles,k as loadSkills,Q as parseFrontmatter,u as parseSessionEntries,Y as runDalHookEvent,j as runNotificationHooks,v as runUserPromptSubmitHooks,q as toolDisplayLabel};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var a=(e,n)=>d(e,"name",{value:n,configurable:!0});import{getNativeClipboard as g}from"@earendil-works/pi-tui";import{randomUUID as y}from"crypto";import{readFileSync as w,unlinkSync as S}from"fs";import{tmpdir as b}from"os";import{join as T}from"path";import{t as I}from"../dal/i18n.js";import{runClipboardCommand as o}from"./clipboard-command.js";import{detectSupportedImageMimeType as h}from"./mime.js";import{loadPhoton as P}from"./photon.js";import{isWSL as _}from"./wsl.js";const p=["image/png","image/jpeg","image/webp","image/gif"],u=1e3,M=5e3;function C(e=process.env){return!!e.WAYLAND_DISPLAY||e.XDG_SESSION_TYPE==="wayland"}a(C,"isWaylandSession");function s(e){return e.split(";")[0]?.trim().toLowerCase()??e.toLowerCase()}a(s,"baseMimeType");function G(e){switch(s(e)){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";default:return null}}a(G,"extensionForImageMimeType");function f(e){const n=e.map(t=>t.trim()).filter(Boolean).map(t=>({raw:t,base:s(t)}));for(const t of p){const r=n.find(l=>l.base===t);if(r)return r.raw}return n.find(t=>t.base.startsWith("image/"))?.raw??null}a(f,"selectPreferredImageMimeType");function E(e){const n=s(e);return p.some(i=>i===n)}a(E,"isSupportedImageMimeType");async function A(e){const n=await P();if(!n)return null;try{const i=n.PhotonImage.new_from_byteslice(e);try{return i.get_bytes()}finally{i.free()}}catch{return null}}a(A,"convertToPng");async function W(){const e=await o("wl-paste",["--list-types"],{timeoutMs:u});if(e===void 0)return;const n=e.toString("utf-8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean),i=f(n);if(!i)return null;const t=await o("wl-paste",["--type",i,"--no-newline"]);if(t!==void 0)return t.length===0?null:{bytes:t,mimeType:s(i)}}a(W,"readClipboardImageViaWlPaste");async function N(){const e=T(b(),`pi-wsl-clip-${y()}.png`);try{const n=await o("wslpath",["-w",e],{timeoutMs:u});if(n===void 0)return null;const i=n.toString("utf-8").trim();if(!i)return null;const r=["Add-Type -AssemblyName System.Windows.Forms","Add-Type -AssemblyName System.Drawing",`$path = '${i.replaceAll("'","''")}'`,"$img = [System.Windows.Forms.Clipboard]::GetImage()","if ($img) { $img.Save($path, [System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'ok' } else { Write-Output 'empty' }"].join("; "),l=await o("powershell.exe",["-NoProfile","-Command",r],{timeoutMs:M});if(l===void 0||l.toString("utf-8").trim()!=="ok")return null;const m=w(e);return m.length===0?null:{bytes:new Uint8Array(m),mimeType:"image/png"}}catch{return null}finally{try{S(e)}catch{}}}a(N,"readClipboardImageViaPowerShell");async function L(){const e=await o("xclip",["-selection","clipboard","-t","TARGETS","-o"],{timeoutMs:u});if(e===void 0)return;const n=e.toString("utf-8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean),i=f(n);if(!i)return null;const t=await o("xclip",["-selection","clipboard","-t",i,"-o"]);if(t!==void 0)return t.length===0?null:{bytes:t,mimeType:s(i)}}a(L,"readClipboardImageViaXclip");async function c(){const e=await g()?.getImage();if(e!==void 0)return e?.length?{bytes:e,mimeType:h(e)??"application/octet-stream"}:null}a(c,"readClipboardImageViaNativeClipboard");async function H(e){const n=e?.env??process.env,i=e?.platform??process.platform;if(n.TERMUX_VERSION)return null;let t;if(i==="linux"){const r=_(n);(C(n)||r)&&(t=await W()),t===void 0&&(t=await L()),!t&&r&&(t=await N()??t),t===void 0&&(t=await c())}else t=await c();if(!t)return null;if(!E(t.mimeType)){const r=await A(t.bytes);return r?{bytes:r,mimeType:"image/png"}:null}return t}a(H,"readClipboardImage");function k(e=process.env){if(!(!e.SSH_CONNECTION&&!e.SSH_TTY))return I("\u8FDC\u7A0B\u4F1A\u8BDD\u8BFB\u4E0D\u5230\u672C\u673A\u526A\u8D34\u677F\uFF1A\u628A\u56FE\u7247\u62D6\u8FDB\u7F16\u8F91\u5668\u5DE6\u4FA7\u6587\u4EF6\u680F\u4E0A\u4F20\u5230\u670D\u52A1\u5668\uFF0C\u518D\u8F93\u5165 @ \u9009\u4E2D\u5B83")}a(k,"remoteClipboardHint");export{G as extensionForImageMimeType,C as isWaylandSession,H as readClipboardImage,k as remoteClipboardHint};
1
+ var d=Object.defineProperty;var a=(e,n)=>d(e,"name",{value:n,configurable:!0});import{getNativeClipboard as g}from"@earendil-works/pi-tui";import{randomUUID as y}from"crypto";import{readFileSync as w,unlinkSync as S}from"fs";import{tmpdir as b}from"os";import{join as T}from"path";import{t as I}from"../dal/i18n.js";import{runClipboardCommand as o}from"./clipboard-command.js";import{detectSupportedImageMimeType as h}from"./mime.js";import{loadPhoton as P}from"./photon.js";import{isWSL as _}from"./wsl.js";const p=["image/png","image/jpeg","image/webp","image/gif"],u=1e3,M=5e3;function C(e=process.env){return!!e.WAYLAND_DISPLAY||e.XDG_SESSION_TYPE==="wayland"}a(C,"isWaylandSession");function s(e){return e.split(";")[0]?.trim().toLowerCase()??e.toLowerCase()}a(s,"baseMimeType");function G(e){switch(s(e)){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";default:return null}}a(G,"extensionForImageMimeType");function f(e){const n=e.map(t=>t.trim()).filter(Boolean).map(t=>({raw:t,base:s(t)}));for(const t of p){const r=n.find(l=>l.base===t);if(r)return r.raw}return n.find(t=>t.base.startsWith("image/"))?.raw??null}a(f,"selectPreferredImageMimeType");function E(e){const n=s(e);return p.some(i=>i===n)}a(E,"isSupportedImageMimeType");async function A(e){const n=await P();if(!n)return null;try{const i=n.PhotonImage.new_from_byteslice(e);try{return i.get_bytes()}finally{i.free()}}catch{return null}}a(A,"convertToPng");async function W(){const e=await o("wl-paste",["--list-types"],{timeoutMs:u});if(e===void 0)return;const n=e.toString("utf-8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean),i=f(n);if(!i)return null;const t=await o("wl-paste",["--type",i,"--no-newline"]);if(t!==void 0)return t.length===0?null:{bytes:t,mimeType:s(i)}}a(W,"readClipboardImageViaWlPaste");async function N(){const e=T(b(),`dal-wsl-clip-${y()}.png`);try{const n=await o("wslpath",["-w",e],{timeoutMs:u});if(n===void 0)return null;const i=n.toString("utf-8").trim();if(!i)return null;const r=["Add-Type -AssemblyName System.Windows.Forms","Add-Type -AssemblyName System.Drawing",`$path = '${i.replaceAll("'","''")}'`,"$img = [System.Windows.Forms.Clipboard]::GetImage()","if ($img) { $img.Save($path, [System.Drawing.Imaging.ImageFormat]::Png); Write-Output 'ok' } else { Write-Output 'empty' }"].join("; "),l=await o("powershell.exe",["-NoProfile","-Command",r],{timeoutMs:M});if(l===void 0||l.toString("utf-8").trim()!=="ok")return null;const m=w(e);return m.length===0?null:{bytes:new Uint8Array(m),mimeType:"image/png"}}catch{return null}finally{try{S(e)}catch{}}}a(N,"readClipboardImageViaPowerShell");async function L(){const e=await o("xclip",["-selection","clipboard","-t","TARGETS","-o"],{timeoutMs:u});if(e===void 0)return;const n=e.toString("utf-8").split(/\r?\n/).map(r=>r.trim()).filter(Boolean),i=f(n);if(!i)return null;const t=await o("xclip",["-selection","clipboard","-t",i,"-o"]);if(t!==void 0)return t.length===0?null:{bytes:t,mimeType:s(i)}}a(L,"readClipboardImageViaXclip");async function c(){const e=await g()?.getImage();if(e!==void 0)return e?.length?{bytes:e,mimeType:h(e)??"application/octet-stream"}:null}a(c,"readClipboardImageViaNativeClipboard");async function H(e){const n=e?.env??process.env,i=e?.platform??process.platform;if(n.TERMUX_VERSION)return null;let t;if(i==="linux"){const r=_(n);(C(n)||r)&&(t=await W()),t===void 0&&(t=await L()),!t&&r&&(t=await N()??t),t===void 0&&(t=await c())}else t=await c();if(!t)return null;if(!E(t.mimeType)){const r=await A(t.bytes);return r?{bytes:r,mimeType:"image/png"}:null}return t}a(H,"readClipboardImage");function k(e=process.env){if(!(!e.SSH_CONNECTION&&!e.SSH_TTY))return I("\u8FDC\u7A0B\u4F1A\u8BDD\u8BFB\u4E0D\u5230\u672C\u673A\u526A\u8D34\u677F\uFF1A\u628A\u56FE\u7247\u62D6\u8FDB\u7F16\u8F91\u5668\u5DE6\u4FA7\u6587\u4EF6\u680F\u4E0A\u4F20\u5230\u670D\u52A1\u5668\uFF0C\u518D\u8F93\u5165 @ \u9009\u4E2D\u5B83")}a(k,"remoteClipboardHint");export{G as extensionForImageMimeType,C as isWaylandSession,H as readClipboardImage,k as remoteClipboardHint};
@@ -1 +1 @@
1
- var w=Object.defineProperty;var n=(t,e)=>w(t,"name",{value:e,configurable:!0});import{randomUUID as S}from"node:crypto";import{unlinkSync as b,writeFileSync as h}from"node:fs";import{platform as p,tmpdir as x}from"node:os";import{join as C}from"node:path";import{getNativeClipboard as s}from"@earendil-works/pi-tui";import{runClipboardCommand as l}from"./clipboard-command.js";import{isWSL as E}from"./wsl.js";const y=1e5;function A(t){return!!(t.SSH_CONNECTION||t.SSH_CLIENT||t.MOSH_CONNECTION)}n(A,"isRemoteSession");function u(t){const e=Buffer.from(t).toString("base64");return e.length>y?!1:(process.stdout.write(`\x1B]52;c;${e}\x07`),!0)}n(u,"emitOsc52");async function N(t){const e=C(x(),`pi-wsl-clip-${S()}.txt`);try{h(e,t,{encoding:"utf8",mode:384});const i=(await l("wslpath",["-w",e],{timeoutMs:1e3}))?.toString("utf8").trim();if(!i)return!1;const r=`Set-Clipboard -Value ([System.IO.File]::ReadAllText('${i.replaceAll("'","''")}', [System.Text.Encoding]::UTF8))`;return await l("powershell.exe",["-NoProfile","-Command",r],{timeoutMs:5e3})!==void 0}catch{return!1}finally{try{b(e)}catch{}}}n(N,"copyViaWindowsClipboard");async function Y(){const t=[];process.env.TERMUX_VERSION&&t.push(["termux-clipboard-get",[]]),p()==="linux"&&(process.env.WAYLAND_DISPLAY&&t.push(["wl-paste",["--no-newline","--type","text"]]),process.env.DISPLAY&&t.push(["xclip",["-selection","clipboard","-out"]],["xsel",["--clipboard","--output"]]));for(const[e,i]of t){const r=await l(e,i,{timeoutMs:5e3});if(r!==void 0)return r.toString("utf8")||null}try{return await s()?.getText()||null}catch{return null}}n(Y,"readClipboardText");async function v(){const t=await s()?.getFilePaths?.();return t?.length?t:null}n(v,"readClipboardFilePaths");async function M(t){const e=p(),i=process.env;let r=!1;if(e!=="linux")try{const o=s();o?.setText&&(await o.setText(t),r=!0)}catch{}if(!r){const o=[];e==="darwin"?o.push(["pbcopy",[]]):e==="win32"?o.push(["clip",[]]):(i.TERMUX_VERSION&&o.push(["termux-clipboard-set",[]]),i.WAYLAND_DISPLAY&&o.push(["wl-copy",[]]),i.DISPLAY&&o.push(["xclip",["-selection","clipboard"]],["xsel",["--clipboard","--input"]]));for(const[d,m]of o)if(await l(d,m,{input:t,timeoutMs:5e3})!==void 0){r=!0;break}}let a=!1;!r&&e==="linux"&&E(i)&&(i.WT_SESSION&&(a=u(t)),r=a||await N(t));const f=e==="linux"&&!i.DISPLAY&&!i.WAYLAND_DISPLAY&&!i.TERMUX_VERSION;let c=!1;if(!a&&(A(i)||!r&&f)&&(u(t)?r=!0:c=!0),!r){if(c)throw new Error("Clipboard unavailable: text exceeds the OSC 52 size limit");if(i.TERMUX_VERSION)throw new Error("Clipboard unavailable: install the Termux:API app and `termux-api` package");if(e==="linux"){if(i.WAYLAND_DISPLAY)throw new Error("Clipboard unavailable: install `wl-clipboard` (`wl-copy`) or check Wayland access");if(i.DISPLAY)throw new Error("Clipboard unavailable: install `xclip` or `xsel`, or check X11 access")}throw new Error("Clipboard unavailable")}}n(M,"copyToClipboard");export{M as copyToClipboard,v as readClipboardFilePaths,Y as readClipboardText};
1
+ var w=Object.defineProperty;var n=(t,e)=>w(t,"name",{value:e,configurable:!0});import{randomUUID as S}from"node:crypto";import{unlinkSync as b,writeFileSync as h}from"node:fs";import{platform as p,tmpdir as x}from"node:os";import{join as C}from"node:path";import{getNativeClipboard as s}from"@earendil-works/pi-tui";import{runClipboardCommand as l}from"./clipboard-command.js";import{isWSL as E}from"./wsl.js";const y=1e5;function A(t){return!!(t.SSH_CONNECTION||t.SSH_CLIENT||t.MOSH_CONNECTION)}n(A,"isRemoteSession");function u(t){const e=Buffer.from(t).toString("base64");return e.length>y?!1:(process.stdout.write(`\x1B]52;c;${e}\x07`),!0)}n(u,"emitOsc52");async function N(t){const e=C(x(),`dal-wsl-clip-${S()}.txt`);try{h(e,t,{encoding:"utf8",mode:384});const i=(await l("wslpath",["-w",e],{timeoutMs:1e3}))?.toString("utf8").trim();if(!i)return!1;const r=`Set-Clipboard -Value ([System.IO.File]::ReadAllText('${i.replaceAll("'","''")}', [System.Text.Encoding]::UTF8))`;return await l("powershell.exe",["-NoProfile","-Command",r],{timeoutMs:5e3})!==void 0}catch{return!1}finally{try{b(e)}catch{}}}n(N,"copyViaWindowsClipboard");async function Y(){const t=[];process.env.TERMUX_VERSION&&t.push(["termux-clipboard-get",[]]),p()==="linux"&&(process.env.WAYLAND_DISPLAY&&t.push(["wl-paste",["--no-newline","--type","text"]]),process.env.DISPLAY&&t.push(["xclip",["-selection","clipboard","-out"]],["xsel",["--clipboard","--output"]]));for(const[e,i]of t){const r=await l(e,i,{timeoutMs:5e3});if(r!==void 0)return r.toString("utf8")||null}try{return await s()?.getText()||null}catch{return null}}n(Y,"readClipboardText");async function v(){const t=await s()?.getFilePaths?.();return t?.length?t:null}n(v,"readClipboardFilePaths");async function M(t){const e=p(),i=process.env;let r=!1;if(e!=="linux")try{const o=s();o?.setText&&(await o.setText(t),r=!0)}catch{}if(!r){const o=[];e==="darwin"?o.push(["pbcopy",[]]):e==="win32"?o.push(["clip",[]]):(i.TERMUX_VERSION&&o.push(["termux-clipboard-set",[]]),i.WAYLAND_DISPLAY&&o.push(["wl-copy",[]]),i.DISPLAY&&o.push(["xclip",["-selection","clipboard"]],["xsel",["--clipboard","--input"]]));for(const[d,m]of o)if(await l(d,m,{input:t,timeoutMs:5e3})!==void 0){r=!0;break}}let a=!1;!r&&e==="linux"&&E(i)&&(i.WT_SESSION&&(a=u(t)),r=a||await N(t));const f=e==="linux"&&!i.DISPLAY&&!i.WAYLAND_DISPLAY&&!i.TERMUX_VERSION;let c=!1;if(!a&&(A(i)||!r&&f)&&(u(t)?r=!0:c=!0),!r){if(c)throw new Error("Clipboard unavailable: text exceeds the OSC 52 size limit");if(i.TERMUX_VERSION)throw new Error("Clipboard unavailable: install the Termux:API app and `termux-api` package");if(e==="linux"){if(i.WAYLAND_DISPLAY)throw new Error("Clipboard unavailable: install `wl-clipboard` (`wl-copy`) or check Wayland access");if(i.DISPLAY)throw new Error("Clipboard unavailable: install `xclip` or `xsel`, or check X11 access")}throw new Error("Clipboard unavailable")}}n(M,"copyToClipboard");export{M as copyToClipboard,v as readClipboardFilePaths,Y as readClipboardText};
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.1.30",
9
+ "version": "0.1.32",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.1.30",
9
+ "version": "0.1.32",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "1.15.30",
3
+ "version": "1.15.32",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "1.15.30",
9
+ "version": "1.15.32",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "1.15.30",
4
+ "version": "1.15.32",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.1.30",
9
+ "version": "0.1.32",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "dal-code",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "dal-code",
9
- "version": "1.0.32",
9
+ "version": "1.0.34",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@agentclientprotocol/sdk": "1.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dal-code",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "DAL Code terminal",
5
5
  "type": "module",
6
6
  "piConfig": {