@runeya/runeya 2.0.140 → 2.0.142

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 (123) hide show
  1. package/agent/index.js.map +1 -1
  2. package/agent-manager-M4NA5YFD.js +11 -0
  3. package/{chat-L7RRHXX5.js → chat-X3X527EX.js} +9 -7
  4. package/{chunk-GOMF7NWS.js → chunk-7L6AQUBR.js} +2 -2
  5. package/{chunk-O2KOX4LU.js → chunk-C2BGNVBT.js} +35 -9
  6. package/chunk-C2BGNVBT.js.map +1 -0
  7. package/{chunk-SYCUQDA4.js → chunk-GXE5TLLJ.js} +10 -4
  8. package/chunk-GXE5TLLJ.js.map +1 -0
  9. package/{chunk-EV3TBM7E.js → chunk-IXO5KIO5.js} +9 -2
  10. package/{chunk-EV3TBM7E.js.map → chunk-IXO5KIO5.js.map} +1 -1
  11. package/{chunk-QWX6R6AW.js → chunk-NSS47H26.js} +71 -16
  12. package/chunk-NSS47H26.js.map +1 -0
  13. package/{chunk-G4TOLDZB.js → chunk-P73PTVII.js} +95 -63
  14. package/chunk-P73PTVII.js.map +1 -0
  15. package/{chunk-6HSZPK2W.js → chunk-UR3HL373.js} +3 -3
  16. package/{companion-LQVLEHU7.js → companion-2LHKU577.js} +5 -5
  17. package/{desktop-installer-page-OKE4WY5Q.js → desktop-installer-page-6JDSXK2E.js} +226 -33
  18. package/desktop-installer-page-6JDSXK2E.js.map +1 -0
  19. package/{free-port-565NMFIZ.js → free-port-5UNHDWGE.js} +2 -2
  20. package/index.js +70 -22
  21. package/index.js.map +1 -1
  22. package/install-gate-2NNH7RM2.js +60 -0
  23. package/install-gate-2NNH7RM2.js.map +1 -0
  24. package/mcp-server/index.js +84 -10
  25. package/mcp-server/index.js.map +1 -1
  26. package/mcp-server/launch.d.ts +5 -4
  27. package/mcp-server/launch.js.map +1 -1
  28. package/package.json +1 -1
  29. package/settings-manager-32SVMAFN.js +10 -0
  30. package/{src-NVQHFMTQ.js → src-5TEXF3SU.js} +938 -809
  31. package/src-5TEXF3SU.js.map +1 -0
  32. package/{vault-resolver-B5P2OUI5.js → vault-resolver-VK6W5J6W.js} +2 -2
  33. package/web/assets/{AgentScalarChatInterface.vue-Dgobg9wk.js → AgentScalarChatInterface.vue-uNy1P-l4.js} +1 -1
  34. package/web/assets/{AgentTerminalPage-B43nSPSz.js → AgentTerminalPage-CFnALyb1.js} +1 -1
  35. package/web/assets/{AiChatModals-CVZ5ilmt.js → AiChatModals-B6svb69W.js} +1 -1
  36. package/web/assets/{AppLayout-B5yKLUj9.js → AppLayout-BKlJtfuQ.js} +1 -1
  37. package/web/assets/{AuditPage-KR5ydSRG.js → AuditPage-BsSpX2TJ.js} +1 -1
  38. package/web/assets/{CloudAccountPage-RNosmi99.js → CloudAccountPage-DabrwDsa.js} +1 -1
  39. package/web/assets/{CloudMessagingPage-Dp-FDdoH.js → CloudMessagingPage-BtOJO5FB.js} +1 -1
  40. package/web/assets/{DashboardPage-Bjj11oP_.js → DashboardPage-DMByzpgW.js} +1 -1
  41. package/web/assets/{DirectoryPickerDialog-C28UH35_.js → DirectoryPickerDialog-CDyk4Z_Q.js} +1 -1
  42. package/web/assets/{EnvironmentForm-Dj2T2DuS.js → EnvironmentForm-BlGWpU2_.js} +1 -1
  43. package/web/assets/{EnvironmentFormPage-B4Bt1bXS.js → EnvironmentFormPage-B-dpyO0_.js} +1 -1
  44. package/web/assets/{EnvironmentListPage-B_V9mEhR.js → EnvironmentListPage-BlaOiTVh.js} +1 -1
  45. package/web/assets/{KanbanBoardPage-CQLiin5v.js → KanbanBoardPage-C52zM-Zw.js} +3 -3
  46. package/web/assets/{KanbanListPage-ChD0Zj0Y.js → KanbanListPage-BmNdd1aP.js} +1 -1
  47. package/web/assets/{LaunchProjectPage-ByIfq7ka.js → LaunchProjectPage-B5sXxaet.js} +1 -1
  48. package/web/assets/{LaunchServicesPage-BweD0CWu.js → LaunchServicesPage-C1u6lV4l.js} +1 -1
  49. package/web/assets/{LaunchShell-C9jV0DDh.js → LaunchShell-CeyVMzL2.js} +1 -1
  50. package/web/assets/{LogViewer-Cv024Meq.js → LogViewer-CAvRwSZu.js} +2 -2
  51. package/web/assets/{OrgKeyPrompt-D95Zm3Tl.js → OrgKeyPrompt-NDfCQ-In.js} +1 -1
  52. package/web/assets/{ProcessControls-84xtt8ud.js → ProcessControls-D23gTUiv.js} +1 -1
  53. package/web/assets/{ProcessDetailPage-CqMk8XQv.js → ProcessDetailPage-vHpK0Eer.js} +1 -1
  54. package/web/assets/{ProjectCreateDialog-C4rLTHw0.js → ProjectCreateDialog-2PZX7tq2.js} +1 -1
  55. package/web/assets/{ProjectLocationGate-BtI0T-GU.js → ProjectLocationGate-fMAxwT0y.js} +1 -1
  56. package/web/assets/{ProjectPublishDialog-v5xz8t4N.js → ProjectPublishDialog-BylWoa0n.js} +1 -1
  57. package/web/assets/{RandomJobTestPage-CzT3LSMu.js → RandomJobTestPage-DUclmkBw.js} +1 -1
  58. package/web/assets/ScenarioEditorPage-DbEsfuZa.js +14 -0
  59. package/web/assets/{SendToChatDialog-BtsCq9hv.js → SendToChatDialog-DGuOMMrS.js} +1 -1
  60. package/web/assets/{ServiceControlsBar-BFemdioZ.js → ServiceControlsBar-D6M8hYFk.js} +1 -1
  61. package/web/assets/{ServiceDetailPage-DsGHPdUc.js → ServiceDetailPage-G-A9ryZD.js} +1 -1
  62. package/web/assets/{ServiceFormPage-x3jtyV1A.js → ServiceFormPage-BgHSW1XX.js} +1 -1
  63. package/web/assets/{SettingsPage-3tVWDaUN.js → SettingsPage-CPFBr7QE.js} +6 -6
  64. package/web/assets/{UnlockPage-CPcll-ov.js → UnlockPage-B4VEN9LN.js} +1 -1
  65. package/web/assets/{VaultMigrationPage-BMS4BcsA.js → VaultMigrationPage-9qDGbF9X.js} +1 -1
  66. package/web/assets/VersionBadge-CqHdCnuJ.js +1 -0
  67. package/web/assets/VersionBadge-CtFji3sv.css +1 -0
  68. package/web/assets/{WikiPage-CM1-hJvF.js → WikiPage-Pjosr1Vn.js} +1 -1
  69. package/web/assets/{WikiView-MQLuO7ey.js → WikiView-Bcxq2mQW.js} +1 -1
  70. package/web/assets/{add-scalar-classes-BDJ0Zhvc.js → add-scalar-classes-BnJYThbS.js} +2 -2
  71. package/web/assets/{agent.store-CEmOZ8XE.js → agent.store-DTyu_McS.js} +1 -1
  72. package/web/assets/auth-D_pCPFq7.js +2 -0
  73. package/web/assets/{cloud-chat.store-DhCEhagv.js → cloud-chat.store-CMklOB48.js} +1 -1
  74. package/web/assets/{cloud-client-CmrptmtM.js → cloud-client-CX0pW7Kt.js} +2 -2
  75. package/web/assets/cloud-session-ja0-uvVS.js +2 -0
  76. package/web/assets/{editor.store-Be5P5Eur.js → editor.store-BAjGG8Ji.js} +1 -1
  77. package/web/assets/i18n-CXvcscXP.js +1 -0
  78. package/web/assets/{index-CXnyET_X.js → index-DTrxphh3.js} +101 -101
  79. package/web/assets/index-eb4FRryj.css +1 -0
  80. package/web/assets/{modal-9BC14oRF.js → modal-Cvv2YgUo.js} +1 -1
  81. package/web/assets/{project-launch.store-cO8Wr508.js → project-launch.store-C7xfTlMc.js} +1 -1
  82. package/web/assets/{project.store-CpUEwUgF.js → project.store-ZpH_PaSy.js} +1 -1
  83. package/web/assets/scenario.store-F78cizck.js +7 -0
  84. package/web/assets/{service.store-ve_P4_2O.js → service.store-Dti7eDhR.js} +1 -1
  85. package/web/assets/{settings-scope-CcYu-GYo.js → settings-scope-CUuHrUpc.js} +1 -1
  86. package/web/assets/{settings.store-CdCOUAsL.js → settings.store-De1-3IG8.js} +1 -1
  87. package/web/assets/{src-T5uKA02c.js → src-C0KK-qsF.js} +1 -1
  88. package/web/assets/{src-RO7PD0gR.js → src-DXlxwMXe.js} +1 -1
  89. package/web/assets/{theme-CPaZfI9r.js → theme-BZCAxfJD.js} +1 -1
  90. package/web/assets/trpc-B5Yw_z6v.js +3 -0
  91. package/web/assets/{useCloudOrg-DaFUgt9j.js → useCloudOrg-QzX8ryg1.js} +1 -1
  92. package/web/assets/{useEnvVarAutocomplete-CXlyG01r.js → useEnvVarAutocomplete-BdGgINv9.js} +1 -1
  93. package/web/assets/{useProjectCatalog-1vLcCQlh.js → useProjectCatalog-Cr90BND4.js} +1 -1
  94. package/web/assets/{useProjectCloudOrg-MAfohLuM.js → useProjectCloudOrg-2wwByg2k.js} +1 -1
  95. package/web/assets/{useServiceUrlHost-D9k9s21s.js → useServiceUrlHost-CxbARDeg.js} +1 -1
  96. package/web/assets/{vue-draggable-plus-SmOauPHy.js → vue-draggable-plus-pTwVkhnN.js} +1 -1
  97. package/web/favicon.svg +1 -5
  98. package/web/index.html +18 -18
  99. package/agent-manager-RZI65MSV.js +0 -11
  100. package/chunk-G4TOLDZB.js.map +0 -1
  101. package/chunk-O2KOX4LU.js.map +0 -1
  102. package/chunk-QWX6R6AW.js.map +0 -1
  103. package/chunk-SYCUQDA4.js.map +0 -1
  104. package/desktop-installer-page-OKE4WY5Q.js.map +0 -1
  105. package/settings-manager-5JHSSKQ2.js +0 -10
  106. package/src-NVQHFMTQ.js.map +0 -1
  107. package/web/assets/ScenarioEditorPage-DrWcVOHg.js +0 -14
  108. package/web/assets/VersionBadge-54viPqlY.css +0 -1
  109. package/web/assets/VersionBadge-prnLNUGg.js +0 -1
  110. package/web/assets/auth-BpxI0N26.js +0 -2
  111. package/web/assets/cloud-session-ByODsQrA.js +0 -2
  112. package/web/assets/i18n-m0G6Pfwe.js +0 -1
  113. package/web/assets/index-Dsh11_J0.css +0 -1
  114. package/web/assets/scenario.store-B5uv1DSO.js +0 -7
  115. package/web/assets/trpc-BFA-mSM8.js +0 -3
  116. /package/{agent-manager-RZI65MSV.js.map → agent-manager-M4NA5YFD.js.map} +0 -0
  117. /package/{chat-L7RRHXX5.js.map → chat-X3X527EX.js.map} +0 -0
  118. /package/{chunk-GOMF7NWS.js.map → chunk-7L6AQUBR.js.map} +0 -0
  119. /package/{chunk-6HSZPK2W.js.map → chunk-UR3HL373.js.map} +0 -0
  120. /package/{companion-LQVLEHU7.js.map → companion-2LHKU577.js.map} +0 -0
  121. /package/{free-port-565NMFIZ.js.map → free-port-5UNHDWGE.js.map} +0 -0
  122. /package/{settings-manager-5JHSSKQ2.js.map → settings-manager-32SVMAFN.js.map} +0 -0
  123. /package/{vault-resolver-B5P2OUI5.js.map → vault-resolver-VK6W5J6W.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  settingsManager
3
- } from "./chunk-6HSZPK2W.js";
3
+ } from "./chunk-UR3HL373.js";
4
4
  import {
5
5
  COMPANION_SIGNATURE,
6
6
  activeSessionRegistry,
@@ -31,10 +31,11 @@ import {
31
31
  resolveConversationCwd,
32
32
  resolveWorkspaceCwd,
33
33
  runCompanionNow,
34
+ signJwt,
34
35
  stopCompanion,
35
36
  syncConversationFromClaudeTranscript,
36
37
  verifyJwt
37
- } from "./chunk-QWX6R6AW.js";
38
+ } from "./chunk-NSS47H26.js";
38
39
  import {
39
40
  StoreDiskCoordinator,
40
41
  agentManager,
@@ -53,7 +54,7 @@ import {
53
54
  recordLocalRemoval,
54
55
  refsOfProjectId,
55
56
  serviceStore
56
- } from "./chunk-SYCUQDA4.js";
57
+ } from "./chunk-GXE5TLLJ.js";
57
58
  import {
58
59
  atomicWriteJsonSecure,
59
60
  atomicWriteSecure,
@@ -64,7 +65,7 @@ import {
64
65
  renameWithRetry,
65
66
  resolveConversationRunDir,
66
67
  wasRead
67
- } from "./chunk-GOMF7NWS.js";
68
+ } from "./chunk-7L6AQUBR.js";
68
69
  import {
69
70
  AGENT_STOP_FETCH_TIMEOUT,
70
71
  ApiKeysFileSchema,
@@ -105,7 +106,7 @@ import {
105
106
  machineRoot,
106
107
  orgVaultRoot,
107
108
  vaultIdOfRoot
108
- } from "./chunk-EV3TBM7E.js";
109
+ } from "./chunk-IXO5KIO5.js";
109
110
  import {
110
111
  isCliAvailable,
111
112
  resolveCliInvocation
@@ -2355,16 +2356,19 @@ async function runCapability(cap, baseUrl, params, authToken, fetchImpl = fetch)
2355
2356
 
2356
2357
  // ../../packages/ai-capabilities/src/project-anchor.ts
2357
2358
  function applyProjectAnchor(cap, params, anchor) {
2358
- if (!anchor.projectId) return params;
2359
2359
  const accepts = (name) => cap.params.some((p) => p.name === name);
2360
- if (!accepts("projectId") || params["projectId"]) return params;
2361
- return {
2362
- ...params,
2363
- projectId: anchor.projectId,
2364
- // L'organisation n'accompagne le projet que si la capability la comprend :
2365
- // ailleurs, ce serait un champ de trop, refusé par le schéma de la route.
2366
- ...anchor.orgId && accepts("orgId") && !params["orgId"] ? { orgId: anchor.orgId } : {}
2367
- };
2360
+ const anchored = { ...params };
2361
+ const mayAnchorOrg = !params["projectId"] || params["projectId"] === anchor.projectId;
2362
+ if (anchor.projectId && accepts("projectId") && !anchored["projectId"]) {
2363
+ anchored["projectId"] = anchor.projectId;
2364
+ }
2365
+ if (mayAnchorOrg && anchor.orgId && !anchored["orgId"] && accepts("orgId")) {
2366
+ anchored["orgId"] = anchor.orgId;
2367
+ }
2368
+ if (mayAnchorOrg && anchor.orgId && !anchored["organizationId"] && accepts("organizationId")) {
2369
+ anchored["organizationId"] = anchor.orgId;
2370
+ }
2371
+ return anchored;
2368
2372
  }
2369
2373
 
2370
2374
  // ../server/src/services/llms-txt-generator.ts
@@ -4253,12 +4257,12 @@ function getCloudApiUrl() {
4253
4257
  return (env.CLOUD_URL ?? DEFAULT_CLOUD_API_URL).replace(/\/+$/, "");
4254
4258
  }
4255
4259
  async function orgCloudUrl(orgId) {
4256
- const { readOrgClouds } = await import("./vault-resolver-B5P2OUI5.js");
4260
+ const { readOrgClouds } = await import("./vault-resolver-VK6W5J6W.js");
4257
4261
  const clouds = await readOrgClouds();
4258
4262
  return (clouds[orgId] ?? getCloudApiUrl()).replace(/\/+$/, "");
4259
4263
  }
4260
4264
  async function accountForOrg(orgId) {
4261
- const { readOrgAccounts, readOrgClouds } = await import("./vault-resolver-B5P2OUI5.js");
4265
+ const { readOrgAccounts, readOrgClouds } = await import("./vault-resolver-VK6W5J6W.js");
4262
4266
  const [stampedAccounts, stampedClouds, accounts] = await Promise.all([
4263
4267
  readOrgAccounts(),
4264
4268
  readOrgClouds(),
@@ -4475,7 +4479,7 @@ var cloudAuthRouter = router({
4475
4479
  * du projet ouvert, sous quel compte il se synchronise.
4476
4480
  */
4477
4481
  accounts: protectedProcedure.query(async () => {
4478
- const { readOrgAccounts } = await import("./vault-resolver-B5P2OUI5.js");
4482
+ const { readOrgAccounts } = await import("./vault-resolver-VK6W5J6W.js");
4479
4483
  return { accounts: await cloudSessionStore.list(), orgAccounts: await readOrgAccounts() };
4480
4484
  }),
4481
4485
  /** The cloud session (user + org), fetched with the stored token. */
@@ -4493,7 +4497,7 @@ var cloudAuthRouter = router({
4493
4497
  const identity = await readCloudIdentity(account.cloudUrl, await cloudSessionStore.getToken(accountId) ?? "");
4494
4498
  if (identity) {
4495
4499
  const settled = await cloudSessionStore.describe(accountId, identity);
4496
- const { renameOrgAccount } = await import("./vault-resolver-B5P2OUI5.js");
4500
+ const { renameOrgAccount } = await import("./vault-resolver-VK6W5J6W.js");
4497
4501
  await renameOrgAccount(accountId, settled);
4498
4502
  }
4499
4503
  }
@@ -5059,7 +5063,14 @@ function formatSize(bytes) {
5059
5063
  if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} Ko`;
5060
5064
  return `${(bytes / (1024 * 1024)).toFixed(1).replace(".", ",")} Mo`;
5061
5065
  }
5062
- function generateKanbanSystemPrompt(board, cardId, history, links) {
5066
+ function appendMcpScope(lines, boardId, scope, cardId) {
5067
+ if (scope?.projectId) lines.push(`- **projectId** : \`${scope.projectId}\``);
5068
+ if (scope?.orgId) lines.push(`- **organizationId** : \`${scope.orgId}\``);
5069
+ lines.push(`- **boardId** (tableau concern\xE9, pour les outils qui l\u2019acceptent) : \`${boardId}\``);
5070
+ if (cardId) lines.push(`- **cardId** (carte actuelle) : \`${cardId}\``);
5071
+ lines.push("");
5072
+ }
5073
+ function generateKanbanSystemPrompt(board, cardId, history, links, scope) {
5063
5074
  let currentColTitle = "";
5064
5075
  let card = null;
5065
5076
  for (const col of board.columns) {
@@ -5151,8 +5162,8 @@ function generateKanbanSystemPrompt(board, cardId, history, links) {
5151
5162
  }
5152
5163
  lines.push("### Outils Kanban disponibles");
5153
5164
  lines.push("");
5154
- lines.push(`- **boardId** (\xE0 passer dans tous les outils) : \`${board.id}\``);
5155
- if (card) lines.push(`- **cardId** (carte actuelle) : \`${card.id}\``);
5165
+ appendMcpScope(lines, board.id, scope, cardId);
5166
+ lines.push("R\xE9utilise directement les identifiants ci-dessus dans les outils Kanban qui les acceptent. Pour relire cette carte, appelle `kanban_get_card` avec son `boardId` et son `cardId` ; pour `kanban_list_boards` et `kanban_search_cards`, le param\xE8tre d\u2019organisation s\u2019appelle `organizationId`.");
5156
5167
  lines.push("");
5157
5168
  lines.push("Tu disposes des outils suivants pour interagir avec le board :");
5158
5169
  lines.push("- `kanban_move_card(boardId, cardId, targetColumn)` \u2014 D\xE9placer la carte vers une autre colonne");
@@ -5182,18 +5193,21 @@ function generateKanbanSystemPrompt(board, cardId, history, links) {
5182
5193
  lines.push("");
5183
5194
  return lines.join("\n");
5184
5195
  }
5185
- async function buildKanbanCardPrompt(board, cardId) {
5196
+ async function buildKanbanCardPrompt(board, cardId, scope) {
5186
5197
  const [history, links] = await Promise.all([
5187
5198
  kanbanStore.cardHistory(board.id, cardId),
5188
5199
  kanbanStore.cardLinks(board.id).then((r) => r.links)
5189
5200
  ]);
5190
- return generateKanbanSystemPrompt(board, cardId, history, links);
5201
+ return generateKanbanSystemPrompt(board, cardId, history, links, scope);
5191
5202
  }
5192
- function generateKanbanPopulatePrompt(board) {
5203
+ function generateKanbanPopulatePrompt(board, scope) {
5193
5204
  const lines = [];
5194
5205
  lines.push("## Kanban Board \u2014 Mode Populate");
5195
5206
  lines.push("");
5196
5207
  lines.push(`Tu es en mode **populate** sur le tableau Kanban **"${board.name}"**.`);
5208
+ lines.push("");
5209
+ lines.push("### Identifiants MCP \xE0 r\xE9utiliser");
5210
+ appendMcpScope(lines, board.id, scope);
5197
5211
  lines.push(`Tu es un outil de gestion de projet. Quand l'utilisateur dit "cr\xE9er une card", "ajouter une t\xE2che", "cr\xE9er une carte", ou toute demande similaire, il parle EXCLUSIVEMENT d'une carte Kanban \xE0 ajouter au tableau \u2014 PAS d'un composant UI, PAS de code HTML ou CSS, PAS d'un composant React/Vue/Angular.`);
5198
5212
  lines.push("");
5199
5213
  lines.push("Ton UNIQUE r\xF4le est de cr\xE9er des cartes Kanban pertinentes en r\xE9ponse \xE0 la demande de l'utilisateur.");
@@ -5224,8 +5238,6 @@ function generateKanbanPopulatePrompt(board) {
5224
5238
  lines.push("");
5225
5239
  lines.push("### Outil disponible");
5226
5240
  lines.push("");
5227
- lines.push(`- **boardId** (\xE0 passer dans tous les outils) : \`${board.id}\``);
5228
- lines.push("");
5229
5241
  lines.push("Pour chaque carte \xE0 cr\xE9er, appelle l'outil `kanban_add_card(boardId, column, title, content)` :");
5230
5242
  lines.push("- `column` : nom exact de la colonne cible");
5231
5243
  lines.push("- `title` : titre concis de la carte");
@@ -5415,7 +5427,7 @@ function tailTranscript(opts) {
5415
5427
 
5416
5428
  // ../server/src/services/ai-runners/claude-pty-runner.ts
5417
5429
  async function getAgentManager() {
5418
- const { agentManager: agentManager2 } = await import("./agent-manager-RZI65MSV.js");
5430
+ const { agentManager: agentManager2 } = await import("./agent-manager-M4NA5YFD.js");
5419
5431
  return agentManager2;
5420
5432
  }
5421
5433
  function buildPtyArgs(params, sessionId, opts) {
@@ -6109,7 +6121,7 @@ async function shutdownCodexAppServer() {
6109
6121
  }
6110
6122
  }
6111
6123
  async function getAgentManager2() {
6112
- const { agentManager: agentManager2 } = await import("./agent-manager-RZI65MSV.js");
6124
+ const { agentManager: agentManager2 } = await import("./agent-manager-M4NA5YFD.js");
6113
6125
  return agentManager2;
6114
6126
  }
6115
6127
  function parseRuneyaCurlCommand(command) {
@@ -6178,6 +6190,7 @@ var CodexRunner = class {
6178
6190
  // ── Run via agent (app-server JSON-RPC via agent tRPC routes) ───────────
6179
6191
  async runViaAgent(params) {
6180
6192
  const { agentId, prompt, systemContext, signal, model, effort, isResume, images, skipTokenInstructions, apiBaseUrl, apiToken, injectedEnv } = params;
6193
+ const fullDeveloperInstructions = [systemContext, ...skipTokenInstructions ? [] : [TOKEN_INSTRUCTIONS]].filter(Boolean).join("\n\n");
6181
6194
  const agentMgr = await getAgentManager2();
6182
6195
  if (isResume && params.sessionId && !this.lastThreadId) {
6183
6196
  this.lastThreadId = params.sessionId;
@@ -6193,7 +6206,10 @@ var CodexRunner = class {
6193
6206
  if (isResume && this.lastThreadId) {
6194
6207
  const res = await agentMgr.agentMutation(agentId, "ai.codexRequest", {
6195
6208
  method: "thread/resume",
6196
- params: { threadId: this.lastThreadId },
6209
+ params: {
6210
+ threadId: this.lastThreadId,
6211
+ developerInstructions: fullDeveloperInstructions
6212
+ },
6197
6213
  env: codexEnv
6198
6214
  });
6199
6215
  threadId = res.result.thread.id;
@@ -6204,7 +6220,8 @@ var CodexRunner = class {
6204
6220
  model: model || void 0,
6205
6221
  cwd: params.cwd ?? process.cwd(),
6206
6222
  approvalPolicy: "never",
6207
- sandbox: "danger-full-access"
6223
+ sandbox: "danger-full-access",
6224
+ developerInstructions: fullDeveloperInstructions
6208
6225
  },
6209
6226
  env: codexEnv
6210
6227
  });
@@ -6212,20 +6229,13 @@ var CodexRunner = class {
6212
6229
  this.lastThreadId = threadId;
6213
6230
  params.onThreadId?.(threadId);
6214
6231
  }
6215
- const systemParts = [systemContext, ...skipTokenInstructions ? [] : [TOKEN_INSTRUCTIONS]].filter(Boolean);
6216
- const fullSystemContext = systemParts.join("\n\n");
6217
- const fullPrompt = isResume && this.lastThreadId ? prompt : `${fullSystemContext}
6218
-
6219
- ---
6220
-
6221
- ${prompt}`;
6222
6232
  const input = [];
6223
6233
  if (images && images.length > 0) {
6224
6234
  for (const img of images) {
6225
6235
  input.push({ type: "image", url: `data:${img.mimeType};base64,${img.base64}` });
6226
6236
  }
6227
6237
  }
6228
- input.push({ type: "text", text: fullPrompt });
6238
+ input.push({ type: "text", text: prompt });
6229
6239
  const turnRef = { id: null };
6230
6240
  return new Promise((resolve2, reject) => {
6231
6241
  let settled = false;
@@ -6380,6 +6390,7 @@ ${prompt}`;
6380
6390
  // ── Run locally via app-server client ────────────────────────────────────
6381
6391
  async runLocal(params) {
6382
6392
  const { prompt, systemContext, signal, model, effort, isResume, images, skipTokenInstructions, apiBaseUrl, apiToken } = params;
6393
+ const fullDeveloperInstructions = [systemContext, ...skipTokenInstructions ? [] : [TOKEN_INSTRUCTIONS]].filter(Boolean).join("\n\n");
6383
6394
  if (isResume && params.sessionId && !this.lastThreadId) {
6384
6395
  this.lastThreadId = params.sessionId;
6385
6396
  }
@@ -6391,33 +6402,30 @@ ${prompt}`;
6391
6402
  });
6392
6403
  let threadId;
6393
6404
  if (isResume && this.lastThreadId) {
6394
- const res = await client.sendRequest("thread/resume", { threadId: this.lastThreadId });
6405
+ const res = await client.sendRequest("thread/resume", {
6406
+ threadId: this.lastThreadId,
6407
+ developerInstructions: fullDeveloperInstructions
6408
+ });
6395
6409
  threadId = res.thread.id;
6396
6410
  } else {
6397
6411
  const res = await client.sendRequest("thread/start", {
6398
6412
  model: model || void 0,
6399
6413
  cwd: params.cwd ?? process.cwd(),
6400
6414
  approvalPolicy: "never",
6401
- sandbox: "danger-full-access"
6415
+ sandbox: "danger-full-access",
6416
+ developerInstructions: fullDeveloperInstructions
6402
6417
  });
6403
6418
  threadId = res.thread.id;
6404
6419
  this.lastThreadId = threadId;
6405
6420
  params.onThreadId?.(threadId);
6406
6421
  }
6407
- const systemParts = [systemContext, ...skipTokenInstructions ? [] : [TOKEN_INSTRUCTIONS]].filter(Boolean);
6408
- const fullSystemContext = systemParts.join("\n\n");
6409
- const fullPrompt = isResume && this.lastThreadId ? prompt : `${fullSystemContext}
6410
-
6411
- ---
6412
-
6413
- ${prompt}`;
6414
6422
  const input = [];
6415
6423
  if (images && images.length > 0) {
6416
6424
  for (const img of images) {
6417
6425
  input.push({ type: "image", url: `data:${img.mimeType};base64,${img.base64}` });
6418
6426
  }
6419
6427
  }
6420
- input.push({ type: "text", text: fullPrompt });
6428
+ input.push({ type: "text", text: prompt });
6421
6429
  const turnRes = await client.sendRequest("turn/start", {
6422
6430
  threadId,
6423
6431
  input,
@@ -6547,6 +6555,10 @@ ${prompt}`;
6547
6555
  };
6548
6556
 
6549
6557
  // ../server/src/trpc/routers/chat.ts
6558
+ function toConversationSummary(conv) {
6559
+ const { messages, ...rest } = conv;
6560
+ return { ...rest, messages: [], messagesOmitted: true, messageCount: messages.length };
6561
+ }
6550
6562
  var MessageSchema = z9.object({
6551
6563
  role: z9.enum(["user", "assistant"]),
6552
6564
  content: z9.string().max(1e5)
@@ -6791,11 +6803,16 @@ async function* drainSession(session, signal, isReconnect) {
6791
6803
  if (signal?.aborted) return;
6792
6804
  }
6793
6805
  }
6794
- async function kanbanContextFor(conv) {
6806
+ async function kanbanContextFor(conv, scope) {
6795
6807
  if (!conv?.kanbanBoardId) return "";
6796
6808
  const kanbanBoard = await kanbanStore.get(conv.kanbanBoardId);
6797
6809
  if (!kanbanBoard) return "";
6798
- return "\n\n" + (conv.kanbanCardId ? await buildKanbanCardPrompt(kanbanBoard, conv.kanbanCardId) : generateKanbanPopulatePrompt(kanbanBoard));
6810
+ return "\n\n" + (conv.kanbanCardId ? await buildKanbanCardPrompt(kanbanBoard, conv.kanbanCardId, scope) : generateKanbanPopulatePrompt(kanbanBoard, scope));
6811
+ }
6812
+ async function cliToken(ctx) {
6813
+ const bearer = ctx.authorization?.startsWith("Bearer ") ? ctx.authorization.slice(7) : void 0;
6814
+ if (!bearer || ctx.callerType !== "app") return bearer;
6815
+ return signJwt();
6799
6816
  }
6800
6817
  async function buildCliSystemContext(conv, jwt) {
6801
6818
  const allServices = await serviceStore.list();
@@ -6805,7 +6822,10 @@ async function buildCliSystemContext(conv, jwt) {
6805
6822
  const resolvedServices = await Promise.all(ownServices.map((s) => resolveServiceVariables(s)));
6806
6823
  let systemContext = generateAdminLlmsTxt(resolvedServices, jwt, project);
6807
6824
  if (!conv?.isCompanion) systemContext += "\n\n" + companionSystemNote();
6808
- systemContext += await kanbanContextFor(conv);
6825
+ systemContext += await kanbanContextFor(conv, {
6826
+ ...ref?.id ? { projectId: ref.id } : {},
6827
+ ...ref?.orgId ? { orgId: ref.orgId } : {}
6828
+ });
6809
6829
  return systemContext;
6810
6830
  }
6811
6831
  async function resolveInjectedEnv(environmentId) {
@@ -6986,7 +7006,7 @@ var chatRouter = router({
6986
7006
  orgId: Id128Schema.nullable().optional()
6987
7007
  }).optional()).subscription(async function* ({ input }) {
6988
7008
  const belongs = input?.projectId ? await conversationStore.matcherForProject({ id: input.projectId, orgId: input.orgId }) : () => true;
6989
- const initial = (await conversationStore.list()).filter(belongs);
7009
+ const initial = (await conversationStore.list()).filter(belongs).map(toConversationSummary);
6990
7010
  yield { type: "initial", conversations: initial };
6991
7011
  const queue = [];
6992
7012
  let resolve2 = null;
@@ -7005,7 +7025,11 @@ var chatRouter = router({
7005
7025
  if (queue.length > 0) {
7006
7026
  const event = queue.shift();
7007
7027
  if (event.type === "reloaded") {
7008
- yield { type: "initial", conversations: (await conversationStore.list()).filter(belongs) };
7028
+ yield { type: "initial", conversations: (await conversationStore.list()).filter(belongs).map(toConversationSummary) };
7029
+ continue;
7030
+ }
7031
+ if (event.type === "updated" && !event.messagesChanged) {
7032
+ yield { type: "updated", conversation: toConversationSummary(event.conversation) };
7009
7033
  continue;
7010
7034
  }
7011
7035
  yield event;
@@ -7034,8 +7058,8 @@ var chatRouter = router({
7034
7058
  orgId: Id128Schema.nullable().optional()
7035
7059
  }).optional()).query(async ({ input }) => {
7036
7060
  const projectId = input?.projectId;
7037
- if (!projectId) return conversationStore.list();
7038
- return conversationStore.listForProject({ id: projectId, orgId: input?.orgId });
7061
+ const convs = projectId ? await conversationStore.listForProject({ id: projectId, orgId: input?.orgId }) : await conversationStore.list();
7062
+ return convs.map(toConversationSummary);
7039
7063
  }),
7040
7064
  get: protectedProcedure.input(z9.object({ id: Id128Schema })).query(async ({ input }) => {
7041
7065
  const conv = await conversationStore.get(input.id);
@@ -7433,7 +7457,7 @@ Return ONLY the improved text, no explanation, no preamble.`;
7433
7457
  const cliPrompt = input.contextNote ? `${input.contextNote}
7434
7458
 
7435
7459
  ${input.prompt}` : input.prompt;
7436
- const jwt = ctx.authorization?.startsWith("Bearer ") ? ctx.authorization.slice(7) : void 0;
7460
+ const jwt = await cliToken(ctx);
7437
7461
  const systemContext = await buildCliSystemContext(conv, jwt);
7438
7462
  const mcpRef = await conversationStore.projectRefOf(conv);
7439
7463
  const mcpConfig = runeyaMcpConfig({
@@ -7540,7 +7564,7 @@ ${imagePaths.map((p) => `Image: ${p}`).join("\n")}` : cliPrompt;
7540
7564
  const cliPrompt = input.contextNote ? `${input.contextNote}
7541
7565
 
7542
7566
  ${input.prompt}` : input.prompt;
7543
- const jwt = ctx.authorization?.startsWith("Bearer ") ? ctx.authorization.slice(7) : void 0;
7567
+ const jwt = await cliToken(ctx);
7544
7568
  const systemContext = await buildCliSystemContext(conv, jwt);
7545
7569
  const resolvedImages = input.imageIds && input.imageIds.length > 0 ? await resolveImagesToBase64(input.imageIds.map((id) => ({ imageId: id, mimeType: "" })), input.conversationId) : [];
7546
7570
  const convId = input.conversationId;
@@ -7632,7 +7656,10 @@ ${input.prompt}` : input.prompt;
7632
7656
  const authToken = ctx.authorization?.replace(/^Bearer\s+/i, "") ?? "";
7633
7657
  let system = await buildSystemPrompt(apiKey);
7634
7658
  system += "\n\n" + TOOL_SAFETY_INSTRUCTION;
7635
- system += await kanbanContextFor(conv);
7659
+ system += await kanbanContextFor(conv, {
7660
+ ...convRef?.id ? { projectId: convRef.id } : {},
7661
+ ...convRef?.orgId ? { orgId: convRef.orgId } : {}
7662
+ });
7636
7663
  const resolvedImages = input.imageIds && input.imageIds.length > 0 ? await resolveImagesToBase64(input.imageIds.map((id) => ({ imageId: id, mimeType: "" })), input.conversationId) : [];
7637
7664
  let session;
7638
7665
  try {
@@ -7783,12 +7810,16 @@ ${input.prompt}` : input.prompt;
7783
7810
  args.push("--dangerously-skip-permissions");
7784
7811
  }
7785
7812
  const ptyRef = (ptyConv ? await conversationStore.projectRefOf(ptyConv) : null) ?? (input.projectId ? { id: input.projectId, orgId: input.orgId ?? null } : null);
7786
- const jwt = ctx.authorization?.startsWith("Bearer ") ? ctx.authorization.slice(7) : void 0;
7787
- if (!isCodex && ptyConv) {
7813
+ const jwt = await cliToken(ctx);
7814
+ if (ptyConv) {
7788
7815
  try {
7789
7816
  const systemContext = await buildCliSystemContext(ptyConv, jwt);
7790
7817
  if (systemContext.trim().length > 0) {
7791
- args.push("--append-system-prompt", systemContext);
7818
+ if (isCodex) {
7819
+ args.unshift("-c", `developer_instructions=${JSON.stringify(systemContext)}`);
7820
+ } else {
7821
+ args.push("--append-system-prompt", systemContext);
7822
+ }
7792
7823
  }
7793
7824
  } catch (err) {
7794
7825
  console.warn("[chat.pty.start] buildCliSystemContext failed:", err.message);
@@ -7826,7 +7857,7 @@ ${input.prompt}` : input.prompt;
7826
7857
  }
7827
7858
  );
7828
7859
  lap("agent ai.spawnPty");
7829
- const contexts = input.attachedContexts ?? [];
7860
+ const contexts = [...input.attachedContexts ?? []];
7830
7861
  if (contexts.length > 0) {
7831
7862
  const body = contexts.map((c) => `### ${c.label}
7832
7863
  ${c.text}`).join("\n\n");
@@ -8178,9 +8209,10 @@ export {
8178
8209
  ClaudeCodeRunner,
8179
8210
  shutdownCodexAppServer,
8180
8211
  CodexRunner,
8212
+ cliToken,
8181
8213
  startClaudeCodeSession,
8182
8214
  startCodexSession,
8183
8215
  startCliSession,
8184
8216
  chatRouter
8185
8217
  };
8186
- //# sourceMappingURL=chunk-G4TOLDZB.js.map
8218
+ //# sourceMappingURL=chunk-P73PTVII.js.map