happy-imou-cloud 2.1.30 → 2.1.32

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 (25) hide show
  1. package/dist/{BaseReasoningProcessor-Ch9R4qmn.cjs → BaseReasoningProcessor-CQQrYyo3.cjs} +4 -3
  2. package/dist/{BaseReasoningProcessor-C1iacoJW.mjs → BaseReasoningProcessor-CfibmGoR.mjs} +4 -3
  3. package/dist/{ProviderSelectionHandler-2siFKlgs.mjs → ProviderSelectionHandler-C1q60HP6.mjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-Dx6x0Nd4.cjs → ProviderSelectionHandler-D9Bd_S25.cjs} +2 -2
  5. package/dist/{api-C68U-kRs.mjs → api-DIFbsA6t.mjs} +21 -3
  6. package/dist/{api-DK1gyZAZ.cjs → api-DeDVledu.cjs} +21 -3
  7. package/dist/{command-Cb9nikZh.cjs → command-Cl7kVs7K.cjs} +2 -2
  8. package/dist/{command-D32x08k9.mjs → command-ZJ5yPOv4.mjs} +2 -2
  9. package/dist/{index-DQ76ZTNL.mjs → index-CFH8qcTw.mjs} +209 -21
  10. package/dist/{index-BLeiCte-.cjs → index-CT1dgGsX.cjs} +211 -23
  11. package/dist/index.cjs +2 -2
  12. package/dist/index.mjs +2 -2
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +30 -0
  15. package/dist/lib.d.mts +30 -0
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-DD9uUk4w.cjs → registerKillSessionHandler-9O3r5bEa.cjs} +18 -5
  18. package/dist/{registerKillSessionHandler-CadrzRgP.mjs → registerKillSessionHandler-DxpGgu6u.mjs} +18 -5
  19. package/dist/{runClaude-U9sxsnU-.cjs → runClaude-BmW-_Yrl.cjs} +8 -6
  20. package/dist/{runClaude-CkY6XYJa.mjs → runClaude-BvRjHUgF.mjs} +8 -6
  21. package/dist/{runCodex-C6kV0jfX.mjs → runCodex-B-B9MfOf.mjs} +21 -12
  22. package/dist/{runCodex-Beikmv-L.cjs → runCodex-dmjiaB1v.cjs} +21 -12
  23. package/dist/{runGemini-IEzJdhc-.mjs → runGemini-B9W7nfow.mjs} +4 -4
  24. package/dist/{runGemini-BTyqf5MR.cjs → runGemini-CyERhKhw.cjs} +4 -4
  25. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var persistence = require('./api-DK1gyZAZ.cjs');
4
+ var persistence = require('./api-DeDVledu.cjs');
5
5
  var z = require('zod');
6
6
  var fs$2 = require('fs/promises');
7
7
  var os$1 = require('os');
@@ -72,7 +72,7 @@ async function openBrowser(url) {
72
72
  }
73
73
  }
74
74
 
75
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BLeiCte-.cjs', document.baseURI).href)));
75
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CT1dgGsX.cjs', document.baseURI).href)));
76
76
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
77
77
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
78
78
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -637,7 +637,7 @@ function setupCleanupHandlers() {
637
637
  });
638
638
  }
639
639
 
640
- const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BLeiCte-.cjs', document.baseURI).href))));
640
+ const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CT1dgGsX.cjs', document.baseURI).href))));
641
641
  function projectPath() {
642
642
  const path = path$1.resolve(__dirname$2, "..");
643
643
  return path;
@@ -2517,14 +2517,177 @@ async function closeProviderSession(session, opts = {}) {
2517
2517
  }
2518
2518
  }
2519
2519
 
2520
+ const HOME_DOC_FILENAMES = ["IDENTITY.md", "AGENT.md", "SOUL.md", "USER.md", "TOOLS.md"];
2521
+ const MAX_HOME_DOC_CHARS = 4e3;
2522
+ function pathExists(targetPath) {
2523
+ return fs.existsSync(targetPath);
2524
+ }
2525
+ function normalizePathKey(targetPath) {
2526
+ const normalizedPath = path.normalize(path.resolve(targetPath));
2527
+ return process.platform === "win32" ? normalizedPath.toLowerCase() : normalizedPath;
2528
+ }
2529
+ function readTextIfExists(targetPath) {
2530
+ if (!pathExists(targetPath)) {
2531
+ return null;
2532
+ }
2533
+ try {
2534
+ return fs.readFileSync(targetPath, "utf8");
2535
+ } catch {
2536
+ return null;
2537
+ }
2538
+ }
2539
+ function isLegacyHappyOrgRoot(rootPath) {
2540
+ return pathExists(path.join(rootPath, "ORGANIZATION.md")) && pathExists(path.join(rootPath, "agents"));
2541
+ }
2542
+ function isLocalRepoHappyOrgRoot(rootPath) {
2543
+ return pathExists(path.join(rootPath, "ORGANIZATION.json")) || pathExists(path.join(rootPath, "MIGRATION.json"));
2544
+ }
2545
+ function isHappyOrgRoot(rootPath) {
2546
+ return isLegacyHappyOrgRoot(rootPath) || isLocalRepoHappyOrgRoot(rootPath);
2547
+ }
2548
+ function isCeoHomePath(homePath) {
2549
+ return pathExists(path.join(homePath, "IDENTITY.md")) || pathExists(path.join(homePath, "AGENT.md"));
2550
+ }
2551
+ function deriveOrganizationRootFromHomePath(homePath) {
2552
+ const resolvedHomePath = path.resolve(homePath);
2553
+ const homeDirName = path.resolve(homePath).split(/[\\/]/).pop()?.toLowerCase();
2554
+ const parentPath = path.dirname(resolvedHomePath);
2555
+ const parentDirName = parentPath.split(/[\\/]/).pop()?.toLowerCase();
2556
+ if (homeDirName !== "ceo" || parentDirName !== "positions" && parentDirName !== "agents" || !isCeoHomePath(resolvedHomePath)) {
2557
+ return null;
2558
+ }
2559
+ return path.dirname(parentPath);
2560
+ }
2561
+ function collectCandidateRoots(startPath) {
2562
+ const candidates = /* @__PURE__ */ new Map();
2563
+ const addCandidate = (candidateRootPath) => {
2564
+ if (!candidateRootPath || !isHappyOrgRoot(candidateRootPath)) {
2565
+ return;
2566
+ }
2567
+ candidates.set(normalizePathKey(candidateRootPath), path.resolve(candidateRootPath));
2568
+ };
2569
+ let currentPath = path.resolve(startPath);
2570
+ while (true) {
2571
+ addCandidate(currentPath);
2572
+ addCandidate(deriveOrganizationRootFromHomePath(currentPath));
2573
+ const parentPath = path.dirname(currentPath);
2574
+ if (parentPath === currentPath) {
2575
+ break;
2576
+ }
2577
+ currentPath = parentPath;
2578
+ }
2579
+ addCandidate(path.join(startPath, "happy-org", "happy_org"));
2580
+ addCandidate(path.join(startPath, "happy_org"));
2581
+ return [...candidates.values()];
2582
+ }
2583
+ function resolveHomeFromRoot(rootPath) {
2584
+ const positionHomePath = path.join(rootPath, "positions", "ceo");
2585
+ if (isCeoHomePath(positionHomePath)) {
2586
+ return {
2587
+ homePath: positionHomePath,
2588
+ source: "position-home"
2589
+ };
2590
+ }
2591
+ const legacyHomePath = path.join(rootPath, "agents", "ceo");
2592
+ if (isCeoHomePath(legacyHomePath)) {
2593
+ return {
2594
+ homePath: legacyHomePath,
2595
+ source: "legacy-agent-home"
2596
+ };
2597
+ }
2598
+ return null;
2599
+ }
2600
+ function readHomeDocSection(homePath, fileName) {
2601
+ const content = readTextIfExists(path.join(homePath, fileName))?.trim();
2602
+ if (!content) {
2603
+ return null;
2604
+ }
2605
+ const limitedContent = content.length > MAX_HOME_DOC_CHARS ? `${content.slice(0, MAX_HOME_DOC_CHARS).trimEnd()}
2606
+ [truncated]` : content;
2607
+ return [
2608
+ `<HOME_DOC name="${fileName}">`,
2609
+ limitedContent,
2610
+ "</HOME_DOC>"
2611
+ ].join("\n");
2612
+ }
2613
+ function extractIdentityField(markdown, fieldName) {
2614
+ if (!markdown) {
2615
+ return null;
2616
+ }
2617
+ const pattern = new RegExp(`(?:^|\\n)-\\s*${fieldName}:\\s*\`?([^\\n\`]+?)\`?\\s*(?:$|\\n)`, "i");
2618
+ const match = markdown.match(pattern);
2619
+ return match?.[1]?.trim() || null;
2620
+ }
2621
+ function extractHeading(markdown) {
2622
+ if (!markdown) {
2623
+ return null;
2624
+ }
2625
+ const match = markdown.match(/^#\s+(.+)$/m);
2626
+ return match?.[1]?.trim() || null;
2627
+ }
2628
+ function resolveDisplayName(identityMarkdown, agentMarkdown) {
2629
+ return extractIdentityField(identityMarkdown, "display_name") || extractHeading(agentMarkdown) || "Happy CEO";
2630
+ }
2631
+ function buildIdentityPrompt(opts) {
2632
+ const identityMarkdown = readTextIfExists(path.join(opts.homePath, "IDENTITY.md"));
2633
+ const homeSections = HOME_DOC_FILENAMES.map((fileName) => readHomeDocSection(opts.homePath, fileName)).filter((value) => Boolean(value));
2634
+ if (homeSections.length === 0) {
2635
+ return null;
2636
+ }
2637
+ const role = extractIdentityField(identityMarkdown, "role") || "ceo";
2638
+ return [
2639
+ "[HAPPY_LOCAL_HOME_STARTUP]",
2640
+ "You are starting inside a local Happy Org CEO home, not a generic repository session.",
2641
+ "Bind this runtime to the local CEO home below and follow these home documents as startup identity context until a more specific Happy Org task prompt overrides them.",
2642
+ `organization_root_path=${opts.organizationRootPath}`,
2643
+ `home_path=${opts.homePath}`,
2644
+ `role=${role}`,
2645
+ `display_name=${opts.displayName}`,
2646
+ `source=${opts.source}`,
2647
+ "",
2648
+ ...homeSections,
2649
+ "[/HAPPY_LOCAL_HOME_STARTUP]"
2650
+ ].join("\n");
2651
+ }
2652
+ function resolveHappyOrgStartupBinding(startPath) {
2653
+ const candidateRoots = collectCandidateRoots(startPath);
2654
+ if (candidateRoots.length !== 1) {
2655
+ return null;
2656
+ }
2657
+ const organizationRootPath = candidateRoots[0];
2658
+ const home = resolveHomeFromRoot(organizationRootPath);
2659
+ if (!home) {
2660
+ return null;
2661
+ }
2662
+ const identityMarkdown = readTextIfExists(path.join(home.homePath, "IDENTITY.md"));
2663
+ const agentMarkdown = readTextIfExists(path.join(home.homePath, "AGENT.md"));
2664
+ const displayName = resolveDisplayName(identityMarkdown, agentMarkdown);
2665
+ return {
2666
+ organizationRootPath,
2667
+ homePath: home.homePath,
2668
+ role: "ceo",
2669
+ displayName,
2670
+ source: home.source,
2671
+ identityPrompt: buildIdentityPrompt({
2672
+ organizationRootPath,
2673
+ homePath: home.homePath,
2674
+ displayName,
2675
+ source: home.source
2676
+ })
2677
+ };
2678
+ }
2679
+
2520
2680
  function createSessionMetadata(opts) {
2521
2681
  const state = {
2522
2682
  controlledByUser: false
2523
2683
  };
2524
- const metadataPath = opts.path ?? process.cwd();
2684
+ const requestedMetadataPath = opts.path ?? process.cwd();
2685
+ const happyOrgStartupBinding = resolveHappyOrgStartupBinding(requestedMetadataPath);
2686
+ const metadataPath = happyOrgStartupBinding?.homePath ?? requestedMetadataPath;
2525
2687
  const metadataHostPid = opts.hostPid === void 0 ? process.pid : opts.hostPid;
2526
2688
  const metadata = {
2527
2689
  path: metadataPath,
2690
+ ...happyOrgStartupBinding?.displayName ? { name: happyOrgStartupBinding.displayName } : {},
2528
2691
  host: os.hostname(),
2529
2692
  version: persistence.packageJson.version,
2530
2693
  os: os.platform(),
@@ -2541,7 +2704,11 @@ function createSessionMetadata(opts) {
2541
2704
  flavor: opts.flavor,
2542
2705
  ...metadataHostPid == null ? {} : { hostPid: metadataHostPid }
2543
2706
  };
2544
- return { state, metadata };
2707
+ return {
2708
+ state,
2709
+ metadata,
2710
+ happyOrgStartupBinding
2711
+ };
2545
2712
  }
2546
2713
 
2547
2714
  async function archiveManagedSessionById(opts) {
@@ -6881,21 +7048,26 @@ function appendToolOutput(existing, next) {
6881
7048
  DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES,
6882
7049
  DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES
6883
7050
  ) : existing.preview;
7051
+ let emittedChunk = null;
6884
7052
  if (shouldReplace) {
6885
7053
  preview.append(next);
6886
7054
  } else {
6887
7055
  const textToAppend = getToolOutputDelta(existing?.lastRawText, next);
6888
7056
  if (textToAppend.length > 0) {
6889
7057
  preview.append(textToAppend);
7058
+ emittedChunk = textToAppend;
6890
7059
  }
6891
7060
  }
6892
7061
  return {
6893
- preview,
6894
- // ACP runtimes sometimes resend the entire cumulative stdout snapshot.
6895
- // Keep only a bounded summary for dedupe so long tool runs cannot retain
6896
- // every historical snapshot in memory.
6897
- lastRawText: buildToolOutputSnapshot(next),
6898
- updateCount: (existing?.updateCount ?? 0) + 1
7062
+ accumulator: {
7063
+ preview,
7064
+ // ACP runtimes sometimes resend the entire cumulative stdout snapshot.
7065
+ // Keep only a bounded summary for dedupe so long tool runs cannot retain
7066
+ // every historical snapshot in memory.
7067
+ lastRawText: buildToolOutputSnapshot(next),
7068
+ updateCount: (existing?.updateCount ?? 0) + 1
7069
+ },
7070
+ emittedChunk
6899
7071
  };
6900
7072
  }
6901
7073
  function renderToolOutput(accumulator) {
@@ -6920,6 +7092,13 @@ function extractTerminalOutputMeta(update) {
6920
7092
  const toolCallId = typeof update.toolCallId === "string" && update.toolCallId.length > 0 ? update.toolCallId : terminalId;
6921
7093
  return toolCallId ? { toolCallId, data } : null;
6922
7094
  }
7095
+ function isTerminalLikeToolKind(toolKind) {
7096
+ if (typeof toolKind !== "string" || toolKind.length === 0) {
7097
+ return false;
7098
+ }
7099
+ const normalized = toolKind.toLowerCase();
7100
+ return normalized === "execute" || normalized.includes("bash") || normalized.includes("shell") || normalized.includes("terminal") || normalized.includes("command");
7101
+ }
6923
7102
  function formatToolCallTimeoutLimit(timeoutMs) {
6924
7103
  if (timeoutMs < 1e3) {
6925
7104
  return `${timeoutMs}ms`;
@@ -7264,11 +7443,8 @@ function handleToolCallUpdate(update, ctx, options) {
7264
7443
  }
7265
7444
  const toolKind = update.kind || ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
7266
7445
  let toolCallCountSincePrompt = ctx.toolCallCountSincePrompt;
7446
+ const hasSupplementalTerminalOutput = typeof options?.supplementalOutputChunk === "string" && options.supplementalOutputChunk.length > 0;
7267
7447
  const outputChunk = extractToolOutputChunk(update.content) ?? options?.supplementalOutputChunk ?? null;
7268
- if (outputChunk) {
7269
- const nextOutput = appendToolOutput(ctx.toolCallOutputs.get(toolCallId), outputChunk);
7270
- ctx.toolCallOutputs.set(toolCallId, nextOutput);
7271
- }
7272
7448
  if (status === "in_progress" || status === "pending") {
7273
7449
  if (!ctx.activeToolCalls.has(toolCallId)) {
7274
7450
  toolCallCountSincePrompt++;
@@ -7276,7 +7452,19 @@ function handleToolCallUpdate(update, ctx, options) {
7276
7452
  } else {
7277
7453
  persistence.logger.debug(`[AcpBackend] Tool call ${toolCallId} already tracked, status: ${status}`);
7278
7454
  }
7279
- } else if (status === "completed") {
7455
+ }
7456
+ if (outputChunk) {
7457
+ const nextOutput = appendToolOutput(ctx.toolCallOutputs.get(toolCallId), outputChunk);
7458
+ ctx.toolCallOutputs.set(toolCallId, nextOutput.accumulator);
7459
+ if (ctx.activeToolCalls.has(toolCallId) && nextOutput.emittedChunk && (hasSupplementalTerminalOutput || isTerminalLikeToolKind(toolKind))) {
7460
+ ctx.emit({
7461
+ type: "terminal-output",
7462
+ data: nextOutput.emittedChunk,
7463
+ callId: toolCallId
7464
+ });
7465
+ }
7466
+ }
7467
+ if (status === "completed") {
7280
7468
  completeToolCall(toolCallId, toolKind, update.content, ctx);
7281
7469
  } else if (status === "failed" || status === "cancelled") {
7282
7470
  failToolCall(toolCallId, status, toolKind, update.content, ctx);
@@ -10062,7 +10250,7 @@ class AbortError extends Error {
10062
10250
  }
10063
10251
  }
10064
10252
 
10065
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BLeiCte-.cjs', document.baseURI).href)));
10253
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CT1dgGsX.cjs', document.baseURI).href)));
10066
10254
  const __dirname$1 = path.join(__filename$1, "..");
10067
10255
  function getGlobalClaudeVersion() {
10068
10256
  try {
@@ -11385,14 +11573,14 @@ var launch = /*#__PURE__*/Object.freeze({
11385
11573
  const unifiedProviderExecutors = {
11386
11574
  claude: async (opts) => {
11387
11575
  const claudeOptions = opts.claudeOptions ?? {};
11388
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-U9sxsnU-.cjs'); });
11576
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-BmW-_Yrl.cjs'); });
11389
11577
  await runClaude(opts.credentials, {
11390
11578
  ...claudeOptions,
11391
11579
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
11392
11580
  });
11393
11581
  },
11394
11582
  codex: async (opts) => {
11395
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Beikmv-L.cjs'); });
11583
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-dmjiaB1v.cjs'); });
11396
11584
  await runCodex({
11397
11585
  credentials: opts.credentials,
11398
11586
  startedBy: opts.startedBy,
@@ -11401,7 +11589,7 @@ const unifiedProviderExecutors = {
11401
11589
  });
11402
11590
  },
11403
11591
  gemini: async (opts) => {
11404
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BTyqf5MR.cjs'); });
11592
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CyERhKhw.cjs'); });
11405
11593
  await runGemini({
11406
11594
  credentials: opts.credentials,
11407
11595
  startedBy: opts.startedBy
@@ -11484,7 +11672,7 @@ function shouldRunMainClaudeFlow(opts) {
11484
11672
  return;
11485
11673
  } else if (subcommand === "runtime") {
11486
11674
  if (args[1] === "providers") {
11487
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Cb9nikZh.cjs'); });
11675
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Cl7kVs7K.cjs'); });
11488
11676
  console.log(renderRuntimeProviders());
11489
11677
  return;
11490
11678
  }
@@ -11690,8 +11878,8 @@ function shouldRunMainClaudeFlow(opts) {
11690
11878
  const projectId = args[3];
11691
11879
  try {
11692
11880
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11693
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-DK1gyZAZ.cjs'); }).then(function (n) { return n.persistence; });
11694
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DK1gyZAZ.cjs'); }).then(function (n) { return n.api; });
11881
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-DeDVledu.cjs'); }).then(function (n) { return n.persistence; });
11882
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DeDVledu.cjs'); }).then(function (n) { return n.api; });
11695
11883
  let userEmail = void 0;
11696
11884
  try {
11697
11885
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-DK1gyZAZ.cjs');
4
+ require('./api-DeDVledu.cjs');
5
5
  require('zod');
6
- require('./index-BLeiCte-.cjs');
6
+ require('./index-CT1dgGsX.cjs');
7
7
  require('node:child_process');
8
8
  require('node:fs');
9
9
  require('cross-spawn');
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import 'chalk';
2
- import './api-C68U-kRs.mjs';
2
+ import './api-DIFbsA6t.mjs';
3
3
  import 'zod';
4
- import './index-DQ76ZTNL.mjs';
4
+ import './index-CFH8qcTw.mjs';
5
5
  import 'node:child_process';
6
6
  import 'node:fs';
7
7
  import 'cross-spawn';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./api-DK1gyZAZ.cjs');
3
+ var persistence = require('./api-DeDVledu.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
package/dist/lib.d.cts CHANGED
@@ -291,6 +291,7 @@ type RawJSONLines = z.infer<typeof RawJSONLinesSchema>;
291
291
  declare const HappyOrgTurnReportSchema: z.ZodObject<{
292
292
  taskId: z.ZodString;
293
293
  organizationId: z.ZodString;
294
+ organizationRootPath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
294
295
  memberAgentId: z.ZodString;
295
296
  supervisorAgentId: z.ZodString;
296
297
  positionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -302,6 +303,7 @@ declare const HappyOrgTurnReportSchema: z.ZodObject<{
302
303
  blockerCode: z.ZodNullable<z.ZodString>;
303
304
  decisionNeeded: z.ZodNullable<z.ZodString>;
304
305
  targetArtifact: z.ZodNullable<z.ZodString>;
306
+ accessChannelState: z.ZodNullable<z.ZodEnum<["ok", "reattach_required", "runtime_replaced"]>>;
305
307
  repeatFingerprint: z.ZodNullable<z.ZodString>;
306
308
  replyContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
307
309
  dispatchId: z.ZodString;
@@ -355,7 +357,9 @@ declare const HappyOrgTurnReportSchema: z.ZodObject<{
355
357
  blockerCode: string | null;
356
358
  decisionNeeded: string | null;
357
359
  targetArtifact: string | null;
360
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
358
361
  repeatFingerprint: string | null;
362
+ organizationRootPath?: string | null | undefined;
359
363
  positionId?: string | null | undefined;
360
364
  responsibilityId?: string | null | undefined;
361
365
  replyContext?: {
@@ -384,7 +388,9 @@ declare const HappyOrgTurnReportSchema: z.ZodObject<{
384
388
  blockerCode: string | null;
385
389
  decisionNeeded: string | null;
386
390
  targetArtifact: string | null;
391
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
387
392
  repeatFingerprint: string | null;
393
+ organizationRootPath?: string | null | undefined;
388
394
  positionId?: string | null | undefined;
389
395
  responsibilityId?: string | null | undefined;
390
396
  replyContext?: {
@@ -408,6 +414,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
408
414
  taskContext: z.ZodOptional<z.ZodObject<{
409
415
  taskId: z.ZodString;
410
416
  organizationId: z.ZodString;
417
+ organizationRootPath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
411
418
  memberAgentId: z.ZodString;
412
419
  supervisorAgentId: z.ZodString;
413
420
  positionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -417,6 +424,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
417
424
  organizationId: string;
418
425
  memberAgentId: string;
419
426
  supervisorAgentId: string;
427
+ organizationRootPath?: string | null | undefined;
420
428
  positionId?: string | null | undefined;
421
429
  responsibilityId?: string | null | undefined;
422
430
  }, {
@@ -424,6 +432,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
424
432
  organizationId: string;
425
433
  memberAgentId: string;
426
434
  supervisorAgentId: string;
435
+ organizationRootPath?: string | null | undefined;
427
436
  positionId?: string | null | undefined;
428
437
  responsibilityId?: string | null | undefined;
429
438
  }>>;
@@ -550,6 +559,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
550
559
  lastTurnReport: z.ZodOptional<z.ZodObject<{
551
560
  taskId: z.ZodString;
552
561
  organizationId: z.ZodString;
562
+ organizationRootPath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
553
563
  memberAgentId: z.ZodString;
554
564
  supervisorAgentId: z.ZodString;
555
565
  positionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -561,6 +571,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
561
571
  blockerCode: z.ZodNullable<z.ZodString>;
562
572
  decisionNeeded: z.ZodNullable<z.ZodString>;
563
573
  targetArtifact: z.ZodNullable<z.ZodString>;
574
+ accessChannelState: z.ZodNullable<z.ZodEnum<["ok", "reattach_required", "runtime_replaced"]>>;
564
575
  repeatFingerprint: z.ZodNullable<z.ZodString>;
565
576
  replyContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
566
577
  dispatchId: z.ZodString;
@@ -614,7 +625,9 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
614
625
  blockerCode: string | null;
615
626
  decisionNeeded: string | null;
616
627
  targetArtifact: string | null;
628
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
617
629
  repeatFingerprint: string | null;
630
+ organizationRootPath?: string | null | undefined;
618
631
  positionId?: string | null | undefined;
619
632
  responsibilityId?: string | null | undefined;
620
633
  replyContext?: {
@@ -643,7 +656,9 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
643
656
  blockerCode: string | null;
644
657
  decisionNeeded: string | null;
645
658
  targetArtifact: string | null;
659
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
646
660
  repeatFingerprint: string | null;
661
+ organizationRootPath?: string | null | undefined;
647
662
  positionId?: string | null | undefined;
648
663
  responsibilityId?: string | null | undefined;
649
664
  replyContext?: {
@@ -668,6 +683,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
668
683
  organizationId: string;
669
684
  memberAgentId: string;
670
685
  supervisorAgentId: string;
686
+ organizationRootPath?: string | null | undefined;
671
687
  positionId?: string | null | undefined;
672
688
  responsibilityId?: string | null | undefined;
673
689
  } | undefined;
@@ -724,7 +740,9 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
724
740
  blockerCode: string | null;
725
741
  decisionNeeded: string | null;
726
742
  targetArtifact: string | null;
743
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
727
744
  repeatFingerprint: string | null;
745
+ organizationRootPath?: string | null | undefined;
728
746
  positionId?: string | null | undefined;
729
747
  responsibilityId?: string | null | undefined;
730
748
  replyContext?: {
@@ -749,6 +767,7 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
749
767
  organizationId: string;
750
768
  memberAgentId: string;
751
769
  supervisorAgentId: string;
770
+ organizationRootPath?: string | null | undefined;
752
771
  positionId?: string | null | undefined;
753
772
  responsibilityId?: string | null | undefined;
754
773
  } | undefined;
@@ -805,7 +824,9 @@ declare const HappyOrgMetadataSchema: z.ZodObject<{
805
824
  blockerCode: string | null;
806
825
  decisionNeeded: string | null;
807
826
  targetArtifact: string | null;
827
+ accessChannelState: "ok" | "reattach_required" | "runtime_replaced" | null;
808
828
  repeatFingerprint: string | null;
829
+ organizationRootPath?: string | null | undefined;
809
830
  positionId?: string | null | undefined;
810
831
  responsibilityId?: string | null | undefined;
811
832
  replyContext?: {
@@ -1982,6 +2003,7 @@ declare const UserMessageSchema: z.ZodObject<{
1982
2003
  taskContext: z.ZodOptional<z.ZodObject<{
1983
2004
  taskId: z.ZodString;
1984
2005
  organizationId: z.ZodString;
2006
+ organizationRootPath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1985
2007
  memberAgentId: z.ZodString;
1986
2008
  supervisorAgentId: z.ZodString;
1987
2009
  positionId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -1991,6 +2013,7 @@ declare const UserMessageSchema: z.ZodObject<{
1991
2013
  organizationId: string;
1992
2014
  memberAgentId: string;
1993
2015
  supervisorAgentId: string;
2016
+ organizationRootPath?: string | null | undefined;
1994
2017
  positionId?: string | null | undefined;
1995
2018
  responsibilityId?: string | null | undefined;
1996
2019
  }, {
@@ -1998,6 +2021,7 @@ declare const UserMessageSchema: z.ZodObject<{
1998
2021
  organizationId: string;
1999
2022
  memberAgentId: string;
2000
2023
  supervisorAgentId: string;
2024
+ organizationRootPath?: string | null | undefined;
2001
2025
  positionId?: string | null | undefined;
2002
2026
  responsibilityId?: string | null | undefined;
2003
2027
  }>>;
@@ -2045,6 +2069,7 @@ declare const UserMessageSchema: z.ZodObject<{
2045
2069
  organizationId: string;
2046
2070
  memberAgentId: string;
2047
2071
  supervisorAgentId: string;
2072
+ organizationRootPath?: string | null | undefined;
2048
2073
  positionId?: string | null | undefined;
2049
2074
  responsibilityId?: string | null | undefined;
2050
2075
  } | undefined;
@@ -2068,6 +2093,7 @@ declare const UserMessageSchema: z.ZodObject<{
2068
2093
  organizationId: string;
2069
2094
  memberAgentId: string;
2070
2095
  supervisorAgentId: string;
2096
+ organizationRootPath?: string | null | undefined;
2071
2097
  positionId?: string | null | undefined;
2072
2098
  responsibilityId?: string | null | undefined;
2073
2099
  } | undefined;
@@ -2101,6 +2127,7 @@ declare const UserMessageSchema: z.ZodObject<{
2101
2127
  organizationId: string;
2102
2128
  memberAgentId: string;
2103
2129
  supervisorAgentId: string;
2130
+ organizationRootPath?: string | null | undefined;
2104
2131
  positionId?: string | null | undefined;
2105
2132
  responsibilityId?: string | null | undefined;
2106
2133
  } | undefined;
@@ -2134,6 +2161,7 @@ declare const UserMessageSchema: z.ZodObject<{
2134
2161
  organizationId: string;
2135
2162
  memberAgentId: string;
2136
2163
  supervisorAgentId: string;
2164
+ organizationRootPath?: string | null | undefined;
2137
2165
  positionId?: string | null | undefined;
2138
2166
  responsibilityId?: string | null | undefined;
2139
2167
  } | undefined;
@@ -2175,6 +2203,7 @@ declare const UserMessageSchema: z.ZodObject<{
2175
2203
  organizationId: string;
2176
2204
  memberAgentId: string;
2177
2205
  supervisorAgentId: string;
2206
+ organizationRootPath?: string | null | undefined;
2178
2207
  positionId?: string | null | undefined;
2179
2208
  responsibilityId?: string | null | undefined;
2180
2209
  } | undefined;
@@ -2216,6 +2245,7 @@ declare const UserMessageSchema: z.ZodObject<{
2216
2245
  organizationId: string;
2217
2246
  memberAgentId: string;
2218
2247
  supervisorAgentId: string;
2248
+ organizationRootPath?: string | null | undefined;
2219
2249
  positionId?: string | null | undefined;
2220
2250
  responsibilityId?: string | null | undefined;
2221
2251
  } | undefined;