clawmini 0.0.4 → 0.0.6

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 (70) hide show
  1. package/dist/adapter-discord/index.mjs +1 -1
  2. package/dist/adapter-google-chat/index.mjs +1 -1
  3. package/dist/cli/index.mjs +2 -2
  4. package/dist/cli/lite.mjs +5 -3
  5. package/dist/cli/lite.mjs.map +1 -1
  6. package/dist/cli/propose-policy.mjs +2 -0
  7. package/dist/cli/propose-policy.mjs.map +1 -1
  8. package/dist/daemon/index.mjs +23 -8
  9. package/dist/daemon/index.mjs.map +1 -1
  10. package/dist/{lite-BbCFgEjn.mjs → lite-CBxOT1y5.mjs} +2 -2
  11. package/dist/{lite-BbCFgEjn.mjs.map → lite-CBxOT1y5.mjs.map} +1 -1
  12. package/{web/.svelte-kit/output/client/_app/immutable/chunks/uD5YsQE1.js → dist/web/_app/immutable/chunks/9nfWZDAH.js} +1 -1
  13. package/{web/.svelte-kit/output/client/_app/immutable/chunks/ByezTNKv.js → dist/web/_app/immutable/chunks/zsjBVtme.js} +1 -1
  14. package/dist/web/_app/immutable/entry/{app.Dkba_ZYl.js → app.CDP4hzOl.js} +2 -2
  15. package/dist/web/_app/immutable/entry/start.k4GcE1y3.js +1 -0
  16. package/dist/web/_app/immutable/nodes/{0.CFkkEWLe.js → 0.BK2mQuoD.js} +1 -1
  17. package/dist/web/_app/immutable/nodes/{1.BVylC0w0.js → 1.DsQuFekn.js} +1 -1
  18. package/dist/web/_app/immutable/nodes/{3.DEhhZBsS.js → 3.BZVFNxO-.js} +1 -1
  19. package/dist/web/_app/immutable/nodes/{4.C_OhFIXf.js → 4.L2HPGZB4.js} +1 -1
  20. package/dist/web/_app/immutable/nodes/{5.Bj0bsDBW.js → 5.B4lC9vS4.js} +1 -1
  21. package/dist/web/_app/version.json +1 -1
  22. package/dist/web/index.html +6 -6
  23. package/dist/{workspace-CEdb2nPR.mjs → workspace-BJmJBfKi.mjs} +3 -1
  24. package/dist/workspace-BJmJBfKi.mjs.map +1 -0
  25. package/docs/23_custom_token_env/development_log.md +31 -0
  26. package/docs/23_custom_token_env/notes.md +16 -0
  27. package/docs/23_custom_token_env/prd.md +42 -0
  28. package/docs/23_custom_token_env/questions.md +8 -0
  29. package/docs/23_custom_token_env/tickets.md +54 -0
  30. package/napkin.md +1 -0
  31. package/package.json +1 -1
  32. package/src/adapter-google-chat/client.test.ts +1 -1
  33. package/src/cli/e2e/daemon.test.ts +103 -0
  34. package/src/cli/e2e/messages.test.ts +5 -2
  35. package/src/cli/lite.ts +10 -3
  36. package/src/daemon/agent/agent-session.ts +20 -4
  37. package/src/daemon/utils/spawn.ts +2 -1
  38. package/src/shared/config.ts +2 -0
  39. package/templates/environments/macos/sandbox.sb +8 -0
  40. package/templates/environments/macos-proxy/allowlist.txt +4 -0
  41. package/templates/environments/macos-proxy/proxy.mjs +25 -20
  42. package/templates/environments/macos-proxy/sandbox.sb +8 -0
  43. package/templates/gemini/.gemini/settings.json +6 -1
  44. package/templates/gemini/settings.json +22 -21
  45. package/templates/gemini-claw/.gemini/settings.json +6 -1
  46. package/templates/gemini-claw/GEMINI.md +1 -1
  47. package/templates/gemini-claw/settings.json +26 -25
  48. package/web/.svelte-kit/generated/server/internal.js +1 -1
  49. package/web/.svelte-kit/output/client/.vite/manifest.json +26 -26
  50. package/{dist/web/_app/immutable/chunks/uD5YsQE1.js → web/.svelte-kit/output/client/_app/immutable/chunks/9nfWZDAH.js} +1 -1
  51. package/{dist/web/_app/immutable/chunks/ByezTNKv.js → web/.svelte-kit/output/client/_app/immutable/chunks/zsjBVtme.js} +1 -1
  52. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.Dkba_ZYl.js → app.CDP4hzOl.js} +2 -2
  53. package/web/.svelte-kit/output/client/_app/immutable/entry/start.k4GcE1y3.js +1 -0
  54. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.CFkkEWLe.js → 0.BK2mQuoD.js} +1 -1
  55. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.BVylC0w0.js → 1.DsQuFekn.js} +1 -1
  56. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.DEhhZBsS.js → 3.BZVFNxO-.js} +1 -1
  57. package/web/.svelte-kit/output/client/_app/immutable/nodes/{4.C_OhFIXf.js → 4.L2HPGZB4.js} +1 -1
  58. package/web/.svelte-kit/output/client/_app/immutable/nodes/{5.Bj0bsDBW.js → 5.B4lC9vS4.js} +1 -1
  59. package/web/.svelte-kit/output/client/_app/version.json +1 -1
  60. package/web/.svelte-kit/output/server/chunks/internal.js +1 -1
  61. package/web/.svelte-kit/output/server/manifest-full.js +1 -1
  62. package/web/.svelte-kit/output/server/manifest.js +1 -1
  63. package/web/.svelte-kit/output/server/nodes/0.js +1 -1
  64. package/web/.svelte-kit/output/server/nodes/1.js +1 -1
  65. package/web/.svelte-kit/output/server/nodes/3.js +1 -1
  66. package/web/.svelte-kit/output/server/nodes/4.js +1 -1
  67. package/web/.svelte-kit/output/server/nodes/5.js +1 -1
  68. package/dist/web/_app/immutable/entry/start.B_seWfvF.js +0 -1
  69. package/dist/workspace-CEdb2nPR.mjs.map +0 -1
  70. package/web/.svelte-kit/output/client/_app/immutable/entry/start.B_seWfvF.js +0 -1
@@ -1,5 +1,5 @@
1
- import { C as writeAgentSessionSettings, D as pathIsInsideDir, O as CronJobSchema, S as updateChatSettings, T as writeChatSettings, _ as readEnvironment, b as resolveAgentWorkDir, c as getClawminiDir, d as getSocketPath, f as getWorkspaceRoot, g as readChatSettings, h as readAgentSessionSettings, k as SettingsSchema, l as getEnvironmentPath, m as listAgents, o as getActiveEnvironmentInfo, s as getAgent, u as getSettingsPath, v as readPolicies, y as readSettings } from "../workspace-CEdb2nPR.mjs";
2
- import { c as createChat, f as getDefaultChatId, h as listChats, n as exportLiteToEnvironment, p as getMessages$1, s as appendMessage$1, u as findLastMessage } from "../lite-BbCFgEjn.mjs";
1
+ import { C as writeAgentSessionSettings, D as pathIsInsideDir, O as CronJobSchema, S as updateChatSettings, T as writeChatSettings, _ as readEnvironment, b as resolveAgentWorkDir, c as getClawminiDir, d as getSocketPath, f as getWorkspaceRoot, g as readChatSettings, h as readAgentSessionSettings, k as SettingsSchema, l as getEnvironmentPath, m as listAgents, o as getActiveEnvironmentInfo, s as getAgent, u as getSettingsPath, v as readPolicies, y as readSettings } from "../workspace-BJmJBfKi.mjs";
2
+ import { c as createChat, f as getDefaultChatId, h as listChats, n as exportLiteToEnvironment, p as getMessages$1, s as appendMessage$1, u as findLastMessage } from "../lite-CBxOT1y5.mjs";
3
3
  import fs, { constants } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { execSync, spawn } from "node:child_process";
@@ -814,6 +814,7 @@ var AgentRunner = class {
814
814
  //#region src/daemon/utils/spawn.ts
815
815
  const runCommand = async ({ command, cwd, env, stdin, signal }) => {
816
816
  return new Promise((resolve, reject) => {
817
+ console.log("RUN: ", command);
817
818
  const p = spawn(command, {
818
819
  shell: true,
819
820
  cwd,
@@ -831,11 +832,9 @@ const runCommand = async ({ command, cwd, env, stdin, signal }) => {
831
832
  let stderr = "";
832
833
  if (p.stdout) p.stdout.on("data", (data) => {
833
834
  stdout += data.toString();
834
- if (!stdin) process.stdout.write(data);
835
835
  });
836
836
  if (p.stderr) p.stderr.on("data", (data) => {
837
837
  stderr += data.toString();
838
- if (!stdin) process.stderr.write(data);
839
838
  });
840
839
  p.on("close", (code) => {
841
840
  resolve({
@@ -1289,16 +1288,32 @@ var AgentSession = class {
1289
1288
  Object.keys(routerEnv).forEach((k) => agentSpecificEnvKeys.add(k));
1290
1289
  const apiCtx = getApiContext(this.globalSettings);
1291
1290
  if (apiCtx) {
1292
- env["CLAW_API_URL"] = apiCtx.proxy_host ? `${apiCtx.proxy_host}:${apiCtx.port}` : `http://${apiCtx.host}:${apiCtx.port}`;
1293
- agentSpecificEnvKeys.add("CLAW_API_URL");
1294
- env["CLAW_API_TOKEN"] = generateToken({
1291
+ const proxyUrl = apiCtx.proxy_host ? `${apiCtx.proxy_host}:${apiCtx.port}` : `http://${apiCtx.host}:${apiCtx.port}`;
1292
+ if (currentAgent.apiUrlEnvVar) {
1293
+ env[currentAgent.apiUrlEnvVar] = proxyUrl;
1294
+ agentSpecificEnvKeys.add(currentAgent.apiUrlEnvVar);
1295
+ env["CLAW_LITE_URL_VAR"] = currentAgent.apiUrlEnvVar;
1296
+ agentSpecificEnvKeys.add("CLAW_LITE_URL_VAR");
1297
+ } else {
1298
+ env["CLAW_API_URL"] = proxyUrl;
1299
+ agentSpecificEnvKeys.add("CLAW_API_URL");
1300
+ }
1301
+ const token = generateToken({
1295
1302
  chatId: this.chatId,
1296
1303
  agentId: this.agentId,
1297
1304
  sessionId: this.sessionId,
1298
1305
  ...this.subagentId ? { subagentId: this.subagentId } : {},
1299
1306
  timestamp: Date.now()
1300
1307
  });
1301
- agentSpecificEnvKeys.add("CLAW_API_TOKEN");
1308
+ if (currentAgent.apiTokenEnvVar) {
1309
+ env[currentAgent.apiTokenEnvVar] = token;
1310
+ agentSpecificEnvKeys.add(currentAgent.apiTokenEnvVar);
1311
+ env["CLAW_LITE_API_VAR"] = currentAgent.apiTokenEnvVar;
1312
+ agentSpecificEnvKeys.add("CLAW_LITE_API_VAR");
1313
+ } else {
1314
+ env["CLAW_API_TOKEN"] = token;
1315
+ agentSpecificEnvKeys.add("CLAW_API_TOKEN");
1316
+ }
1302
1317
  }
1303
1318
  let command = initialCommand;
1304
1319
  command = await sandboxExecutionContext(command, env, agentSpecificEnvKeys, this.workDirectory, this.workspaceRoot);