deepline 0.3.574 → 0.3.575

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 (159) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +0 -18
  3. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +8 -0
  4. package/dist/bundling-sources/shared_libs/play-runtime/builtin-pacing.ts +18 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +4 -1
  6. package/dist/bundling-sources/shared_libs/play-runtime/deployment/commands/roll-receipt-gateway.ts +1 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-fly-rollback-alignment.ts +0 -14
  8. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +4 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +45 -7
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +6 -66
  11. package/dist/cli/{agents-7ZZSF4FS.js → agents-BCLO3KQJ.js} +204 -41
  12. package/dist/cli/{agents-6WN5LYUP.mjs → agents-ULGDKUTM.mjs} +182 -19
  13. package/dist/cli/{auth-I2QVO677.mjs → auth-4WCL7A6W.mjs} +5 -5
  14. package/dist/cli/auth-DXUHEL5I.js +44 -0
  15. package/dist/cli/{billing-YPH4GEWU.mjs → billing-7JQ6EUQU.mjs} +9 -9
  16. package/dist/cli/{billing-44QFBUWA.js → billing-BF5LVXOM.js} +102 -102
  17. package/dist/cli/{chunk-MGF3MK27.mjs → chunk-2T7XOKVL.mjs} +5 -5
  18. package/dist/cli/{chunk-7UR57HPJ.js → chunk-2UM3I2MY.js} +1 -1
  19. package/dist/cli/{chunk-SRUNYWQ2.mjs → chunk-3PVKXUSJ.mjs} +1 -1
  20. package/dist/cli/{chunk-W6UCS3O6.mjs → chunk-56N3XAT6.mjs} +5 -5
  21. package/dist/cli/{chunk-LLSCFLFU.mjs → chunk-5D7OJY4W.mjs} +1 -1
  22. package/dist/cli/{chunk-5E2PAGF5.js → chunk-5H6254MJ.js} +21 -21
  23. package/dist/cli/{chunk-VYSUJMB5.js → chunk-5VSHQG5E.js} +8 -8
  24. package/dist/cli/{chunk-SLXCVPN7.js → chunk-636GD4IR.js} +2 -2
  25. package/dist/cli/{chunk-LJLM4BUL.js → chunk-6IKLITVH.js} +6 -6
  26. package/dist/cli/{chunk-D6ZVRKJ2.js → chunk-737Y7QGT.js} +41 -41
  27. package/dist/cli/{chunk-UXIUAIL2.js → chunk-7DLAJ6JJ.js} +53 -53
  28. package/dist/cli/{chunk-2QYU57RG.js → chunk-AO56MZ7D.js} +3 -3
  29. package/dist/cli/{chunk-BUBOZKH2.js → chunk-AS5XGOZY.js} +2 -2
  30. package/dist/cli/{chunk-XVBEEGI4.mjs → chunk-BM536WWR.mjs} +1 -1
  31. package/dist/cli/{chunk-DX646HO7.mjs → chunk-BONMEBWZ.mjs} +4 -4
  32. package/dist/cli/{chunk-S22FSNNC.mjs → chunk-BQUAE6LQ.mjs} +1 -1
  33. package/dist/cli/{chunk-G7OR3GVD.mjs → chunk-CVY4MBXH.mjs} +5 -5
  34. package/dist/cli/{chunk-KSHZY52O.js → chunk-DMPGJCNZ.js} +72 -10
  35. package/dist/cli/{chunk-Q3A53SWK.mjs → chunk-DWUESXDD.mjs} +1 -1
  36. package/dist/cli/{chunk-IA2LTIWO.mjs → chunk-E4RYSSXX.mjs} +2 -2
  37. package/dist/cli/{chunk-VLUBEMWM.js → chunk-EV3OPDHF.js} +20 -20
  38. package/dist/cli/{chunk-ECLCRE5P.js → chunk-EZIXKNKM.js} +3 -3
  39. package/dist/cli/{chunk-JCO226JM.mjs → chunk-FDCU3VAJ.mjs} +72 -10
  40. package/dist/cli/{chunk-6B5EZOI3.js → chunk-FXXERR52.js} +10 -10
  41. package/dist/cli/{chunk-L2NXB4WG.mjs → chunk-FYKHAT2F.mjs} +64 -3
  42. package/dist/cli/{chunk-NDDGFX4X.js → chunk-G2H6SQQY.js} +11 -11
  43. package/dist/cli/{chunk-I62ZBEKH.js → chunk-G4WPDCXA.js} +48 -48
  44. package/dist/cli/{chunk-G2HW2SAP.js → chunk-GB4IZ5TV.js} +13 -13
  45. package/dist/cli/{chunk-7334X74C.mjs → chunk-GQZFZG6R.mjs} +2 -2
  46. package/dist/cli/{chunk-JY7RKJ65.mjs → chunk-H3CG72RZ.mjs} +13 -13
  47. package/dist/cli/{chunk-N6I3BB2O.js → chunk-H6JMRLAZ.js} +274 -274
  48. package/dist/cli/{chunk-6GZIT3TH.js → chunk-HEOM3FAC.js} +20 -20
  49. package/dist/cli/{chunk-DG56RWI2.js → chunk-HO76C7AE.js} +2 -2
  50. package/dist/cli/{chunk-X7RKCAMX.mjs → chunk-IAJ65IDZ.mjs} +4 -4
  51. package/dist/cli/{chunk-ZFXDD7VM.mjs → chunk-IBYMGR5Y.mjs} +1 -1
  52. package/dist/cli/{chunk-LCAXLGAY.mjs → chunk-IOWLFWWG.mjs} +2 -2
  53. package/dist/cli/{chunk-NRVEVKXR.mjs → chunk-JGLCK2XF.mjs} +2 -2
  54. package/dist/cli/{chunk-IB225ZK4.js → chunk-KNCNFL76.js} +4 -4
  55. package/dist/cli/{chunk-QPSBV4FD.mjs → chunk-MN7JLH2T.mjs} +2 -2
  56. package/dist/cli/{chunk-OH6WOID2.mjs → chunk-MWLOBURN.mjs} +2 -2
  57. package/dist/cli/{chunk-AFPGYZBH.js → chunk-MXK4M7HP.js} +17 -17
  58. package/dist/cli/{chunk-MAMGREBW.mjs → chunk-NF722E6C.mjs} +1 -1
  59. package/dist/cli/{chunk-7GQU46SZ.js → chunk-PQYDO72W.js} +26 -26
  60. package/dist/cli/{chunk-4T2U72SP.mjs → chunk-QEDRUURT.mjs} +1 -1
  61. package/dist/cli/{chunk-B2XLIQPH.mjs → chunk-QKP3WYSZ.mjs} +2 -2
  62. package/dist/cli/{chunk-VGIDPJXM.mjs → chunk-RHRRY2BX.mjs} +3 -3
  63. package/dist/cli/{chunk-ZTCP5BHH.mjs → chunk-RW3URFZK.mjs} +2 -2
  64. package/dist/cli/{chunk-XMBTAPHR.js → chunk-SKHUWQZE.js} +7 -7
  65. package/dist/cli/{chunk-OIZUFRTE.mjs → chunk-SYQTBHRX.mjs} +3 -3
  66. package/dist/cli/{chunk-PW6NKI2A.mjs → chunk-TMFR2B45.mjs} +3 -3
  67. package/dist/cli/{chunk-YR4REP4D.mjs → chunk-TTBZ7QXX.mjs} +1 -1
  68. package/dist/cli/{chunk-GMQZFWQU.mjs → chunk-UQZP7XBQ.mjs} +7 -7
  69. package/dist/cli/{chunk-DOZIWA66.js → chunk-V5XLENWK.js} +5 -5
  70. package/dist/cli/{chunk-2TMAKJBT.mjs → chunk-X47J55ZJ.mjs} +2 -2
  71. package/dist/cli/{chunk-ID3LGPOE.js → chunk-XFV353R2.js} +23 -23
  72. package/dist/cli/{chunk-2RPRSTHD.js → chunk-YNAXKA23.js} +5 -5
  73. package/dist/cli/{chunk-IXYVHTRZ.js → chunk-ZO65VJRJ.js} +70 -9
  74. package/dist/cli/{chunk-PP5RMEQQ.js → chunk-ZQXJYO5P.js} +5 -5
  75. package/dist/cli/{chunk-H7PVSG3L.js → chunk-ZS6DT4LD.js} +15 -15
  76. package/dist/cli/{chunk-Z3XFXFRT.js → chunk-ZYSJND73.js} +9 -9
  77. package/dist/cli/command-docs.js +2 -2
  78. package/dist/cli/command-docs.mjs +1 -1
  79. package/dist/cli/{concurrent-runs-help-ROQM6UB3.mjs → concurrent-runs-help-HITK6EOO.mjs} +6 -6
  80. package/dist/cli/concurrent-runs-help-JLWY54WL.js +22 -0
  81. package/dist/cli/{csv-FWGSY4GE.js → csv-RS7XHQ4P.js} +13 -13
  82. package/dist/cli/{csv-R7GV33BC.mjs → csv-V2T23MXT.mjs} +4 -4
  83. package/dist/cli/{db-UWXA4RRV.mjs → db-OQ4RNTGE.mjs} +6 -6
  84. package/dist/cli/{db-OCH35YJG.js → db-WFIVRPKY.js} +27 -27
  85. package/dist/cli/describe-33PBWO5O.js +50 -0
  86. package/dist/cli/{describe-QI4HMUGE.mjs → describe-AXV2EEX3.mjs} +21 -21
  87. package/dist/cli/describe-core.d.mts +10 -1
  88. package/dist/cli/describe-core.d.ts +10 -1
  89. package/dist/cli/describe-core.js +4 -4
  90. package/dist/cli/describe-core.mjs +3 -3
  91. package/dist/cli/{executions-7CFGC24E.js → executions-5H2RIWZ3.js} +8 -8
  92. package/dist/cli/{executions-YF3KMZZN.mjs → executions-THP5ZDBQ.mjs} +6 -6
  93. package/dist/cli/{feedback-DWIWBS7O.mjs → feedback-2EJPILGE.mjs} +6 -6
  94. package/dist/cli/{feedback-YCZHHSBS.js → feedback-UOI6UEGA.js} +14 -14
  95. package/dist/cli/git-2OPYEPYW.js +26 -0
  96. package/dist/cli/{git-XCGMQQOD.mjs → git-DI3LJIAT.mjs} +5 -5
  97. package/dist/cli/index.js +148 -148
  98. package/dist/cli/index.mjs +47 -47
  99. package/dist/cli/{integrations-5ABAJBSW.mjs → integrations-DJYS5VRK.mjs} +7 -7
  100. package/dist/cli/{integrations-IEZA3TGK.js → integrations-TYN2BSQ6.js} +29 -29
  101. package/dist/cli/{legacy-noops-KNFLJ5P2.js → legacy-noops-GXQHNLGJ.js} +9 -9
  102. package/dist/cli/{legacy-noops-OZMY73Y3.mjs → legacy-noops-Z457BB6O.mjs} +6 -6
  103. package/dist/cli/{mcp-WSPFKQPZ.mjs → mcp-NAW3GFNN.mjs} +4 -4
  104. package/dist/cli/{mcp-NLQAO7KP.js → mcp-WMBOOTQL.js} +24 -24
  105. package/dist/cli/{monitors-LPKFFTOX.mjs → monitors-A7NYAXSJ.mjs} +7 -7
  106. package/dist/cli/{monitors-BJYOB4S3.js → monitors-OOQVE7XR.js} +100 -100
  107. package/dist/cli/{org-RYPMUYUW.mjs → org-7YCDUSZE.mjs} +6 -6
  108. package/dist/cli/{org-WIVHI4WT.js → org-D2AMIVBS.js} +121 -121
  109. package/dist/cli/{outcomes-QKX7IE3O.js → outcomes-2FKZDJSQ.js} +14 -14
  110. package/dist/cli/{outcomes-FADJYC4I.mjs → outcomes-TNTKCUEO.mjs} +6 -6
  111. package/dist/cli/{play-4ZKK5Q7U.mjs → play-L6CVHSN4.mjs} +20 -20
  112. package/dist/cli/{play-ID73J3NP.js → play-NWKHCHVZ.js} +349 -349
  113. package/dist/cli/{providers-LURYBSNO.mjs → providers-22LO747B.mjs} +6 -6
  114. package/dist/cli/{providers-WCCGYGW6.js → providers-PZGOI5CN.js} +9 -9
  115. package/dist/cli/{quickstart-KCCSEE5J.mjs → quickstart-3ZRVKGMH.mjs} +4 -4
  116. package/dist/cli/{quickstart-LVPOU25V.js → quickstart-LLWOC2GR.js} +6 -6
  117. package/dist/cli/{run-XXK7DDUF.mjs → run-D46W2GUA.mjs} +48 -27
  118. package/dist/cli/{run-2QMJRCVA.js → run-SNF23STR.js} +70 -49
  119. package/dist/cli/search-H57MZPLF.js +32 -0
  120. package/dist/cli/{search-ZYAWW3CK.mjs → search-XWVCICIX.mjs} +7 -7
  121. package/dist/cli/{search-output-YNXAZSKT.js → search-output-36GHD67U.js} +8 -8
  122. package/dist/cli/{search-output-N45AIOB4.mjs → search-output-YM5QXFQQ.mjs} +5 -5
  123. package/dist/cli/{secrets-7Q3AOUAS.mjs → secrets-7PTZEFRC.mjs} +6 -6
  124. package/dist/cli/{secrets-MHT27L2M.js → secrets-UXCIHG5I.js} +15 -15
  125. package/dist/cli/{sessions-6QKOM7M3.mjs → sessions-DTXJKRP4.mjs} +6 -6
  126. package/dist/cli/sessions-JJZMQSH4.js +23 -0
  127. package/dist/cli/{settings-NPVIDENI.mjs → settings-74B6UOS4.mjs} +12 -12
  128. package/dist/cli/{settings-OP7Q6YX6.js → settings-EYSDZE37.js} +85 -85
  129. package/dist/cli/{setup-OOT3EIMF.mjs → setup-2QRZ36CH.mjs} +9 -9
  130. package/dist/cli/{setup-RT6GHL3W.js → setup-E7PVXBPL.js} +49 -49
  131. package/dist/cli/{skills-TEXI4CLZ.mjs → skills-2WZ7N3UW.mjs} +7 -7
  132. package/dist/cli/skills-RIF2DCZI.js +37 -0
  133. package/dist/cli/tools-7VRQ4GSI.js +57 -0
  134. package/dist/cli/{tools-G5L36M3X.mjs → tools-YK5SCUZD.mjs} +19 -19
  135. package/dist/cli/{update-YNKQTE4D.mjs → update-563YQK53.mjs} +9 -9
  136. package/dist/cli/update-CMZAIAES.js +37 -0
  137. package/dist/cli/{views-IQFMUMLU.mjs → views-ISNCRZUP.mjs} +6 -6
  138. package/dist/cli/{views-OVQ5AQAU.js → views-OLPS6TPG.js} +21 -21
  139. package/dist/cli/{workflow-Y5IFMI7N.mjs → workflow-B3ZKU3OR.mjs} +7 -7
  140. package/dist/cli/{workflow-RCBYXIFZ.js → workflow-CUSCTYMW.js} +17 -17
  141. package/dist/index.js +9 -9
  142. package/dist/index.mjs +6 -6
  143. package/dist/install-integrity.json +122 -122
  144. package/dist/release.d.mts +1 -1
  145. package/dist/release.d.ts +1 -1
  146. package/dist/release.js +2 -2
  147. package/dist/release.mjs +1 -1
  148. package/dist/server.js +5 -5
  149. package/dist/server.mjs +3 -3
  150. package/package.json +1 -1
  151. package/dist/cli/auth-UKPV5U2B.js +0 -44
  152. package/dist/cli/concurrent-runs-help-BFVCUJF4.js +0 -22
  153. package/dist/cli/describe-6OI5K2SH.js +0 -50
  154. package/dist/cli/git-TGLNZRS3.js +0 -26
  155. package/dist/cli/search-AQSAXA6D.js +0 -32
  156. package/dist/cli/sessions-RGD7L4LC.js +0 -23
  157. package/dist/cli/skills-ERAA734H.js +0 -37
  158. package/dist/cli/tools-D5SZSIIH.js +0 -57
  159. package/dist/cli/update-WZ6527EF.js +0 -37
@@ -1,18 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
2
2
 
3
3
 
4
- var _chunkVLUBEMWMjs = require('./chunk-VLUBEMWM.js');
4
+ var _chunkEV3OPDHFjs = require('./chunk-EV3OPDHF.js');
5
5
 
6
6
 
7
- var _chunk2QYU57RGjs = require('./chunk-2QYU57RG.js');
8
- require('./chunk-IB225ZK4.js');
7
+ var _chunkAO56MZ7Djs = require('./chunk-AO56MZ7D.js');
8
+ require('./chunk-KNCNFL76.js');
9
9
  require('./chunk-6VLFQZK6.js');
10
10
  require('./chunk-XNYIZMNQ.js');
11
11
 
12
12
 
13
13
  var _chunkLFQJW4S2js = require('./chunk-LFQJW4S2.js');
14
14
  require('./chunk-CFJFUVX2.js');
15
- require('./chunk-7UR57HPJ.js');
15
+ require('./chunk-2UM3I2MY.js');
16
16
  require('./chunk-OG64RBAC.js');
17
17
  require('./chunk-COGTRVWW.js');
18
18
 
@@ -69,7 +69,33 @@ function firstLine(text, max = 100) {
69
69
  }
70
70
  function describeConversation(conversation) {
71
71
  const where = conversation.platform === "slack" ? `#${conversation.conversationName}` : `test ${conversation.conversationName}`;
72
- return `${where} (${conversation.conversationId})`;
72
+ const settings = [
73
+ ...conversation.model ? [`model ${conversation.model}`] : [],
74
+ ...conversation.outcome ? [
75
+ `${conversation.outcome.role === "home" ? "home of" : "linked to"} outcome ${conversation.outcome.slug}`
76
+ ] : []
77
+ ];
78
+ return `${where} (${conversation.conversationId}${settings.length ? `; ${settings.join("; ")}` : ""})`;
79
+ }
80
+ function parseModel(value) {
81
+ if (value === void 0) return void 0;
82
+ const model = value.trim();
83
+ return model === "" || model.toLowerCase() === "default" ? null : model;
84
+ }
85
+ function describeOutcomeChange(change) {
86
+ const { conversation } = change;
87
+ const where = `#${conversation.conversationName}`;
88
+ if (!conversation.outcome) {
89
+ return [
90
+ change.changed ? `${change.agentName} no longer works toward an outcome in ${where}.` : `${change.agentName} works toward no outcome in ${where}.`
91
+ ];
92
+ }
93
+ const { slug, role } = conversation.outcome;
94
+ return [
95
+ role === "home" ? `${where} is the home of outcome ${slug}: ${change.agentName} works toward it there.` : `${where} is linked to outcome ${slug}: ${change.agentName} answers there with it in view.`,
96
+ role === "linked" ? "It is woken in the outcome\u2019s home channel, not here." : change.woken ? "It is woken when something on the outcome concerns it: a schedule firing, a task for it, an answered ask." : "It is not woken between mentions here: this deployment\u2019s app cannot be rung.",
97
+ `See the outcome with: deepline outcomes describe ${slug}`
98
+ ];
73
99
  }
74
100
  function describeAgentLine(agent) {
75
101
  const channels = agent.conversations.length ? agent.conversations.map(describeConversation).join(", ") : "no channels";
@@ -82,6 +108,7 @@ function describeAgent(agent) {
82
108
  "Instructions:",
83
109
  ...agent.instructions.split("\n").map((line) => ` ${line}`),
84
110
  `Skills: ${agent.skillNames.length ? agent.skillNames.join(", ") : "none"}`,
111
+ `Model: ${_nullishCoalesce(agent.model, () => ( "the default (see deepline agents models)"))}`,
85
112
  agent.conversations.length ? `Channels: ${agent.conversations.map(describeConversation).join(", ")}` : `Channels: none. Bind one with: deepline agents channels add ${agent.name} <channel-id>`
86
113
  ];
87
114
  }
@@ -112,7 +139,7 @@ function describeOverview(overview) {
112
139
  ];
113
140
  }
114
141
  function print(payload, title, lines, options) {
115
- _chunkVLUBEMWMjs.printCommandEnvelope.call(void 0,
142
+ _chunkEV3OPDHFjs.printCommandEnvelope.call(void 0,
116
143
  { ...payload, render: { sections: [{ title, lines }] } },
117
144
  { json: options.json }
118
145
  );
@@ -206,7 +233,7 @@ async function readModelKey() {
206
233
  return Buffer.concat(chunks).toString("utf8").trim();
207
234
  }
208
235
  async function sendTestMessage(input2) {
209
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
236
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
210
237
  return http.post(
211
238
  `${AGENT_PATH}/test`,
212
239
  {
@@ -297,7 +324,7 @@ async function handleChat(channelId, options) {
297
324
  threadId = reply.threadId;
298
325
  const text = describeReply(channelId, reply, true).map((line2) => `agent> ${line2}
299
326
  `).join("");
300
- _chunkVLUBEMWMjs.printCommandEnvelope.call(void 0, reply, { json: false, text });
327
+ _chunkEV3OPDHFjs.printCommandEnvelope.call(void 0, reply, { json: false, text });
301
328
  }
302
329
  } finally {
303
330
  rl.close();
@@ -307,7 +334,7 @@ function registerWorkspaceCommands(agents, readKey) {
307
334
  agents.command("list").description(
308
335
  "Show whether agents are on, their model billing, every agent with its channels, and the skill library."
309
336
  ).option("--json", "Emit JSON output").action(async (options) => {
310
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
337
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
311
338
  const overview = await http.get(AGENT_PATH);
312
339
  print(overview, "deepline agents", describeOverview(overview), options);
313
340
  });
@@ -318,7 +345,7 @@ function registerWorkspaceCommands(agents, readKey) {
318
345
  printDryRun("POST", `${AGENT_PATH}/enable`, {}, options);
319
346
  return;
320
347
  }
321
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
348
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
322
349
  const result = await http.post(
323
350
  `${AGENT_PATH}/enable`,
324
351
  {}
@@ -340,7 +367,7 @@ function registerWorkspaceCommands(agents, readKey) {
340
367
  printDryRun("POST", `${AGENT_PATH}/disable`, {}, options);
341
368
  return;
342
369
  }
343
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
370
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
344
371
  const result = await http.post(
345
372
  `${AGENT_PATH}/disable`,
346
373
  {}
@@ -372,7 +399,7 @@ function registerWorkspaceCommands(agents, readKey) {
372
399
  }
373
400
  const apiKey = await readKey();
374
401
  if (!apiKey) throw new AgentUsageError("No key was given.");
375
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
402
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
376
403
  const overview = await http.put(`${AGENT_PATH}/billing`, {
377
404
  mode: "own_key",
378
405
  provider: _nullishCoalesce(options.provider, () => ( keyProvider(apiKey))),
@@ -381,10 +408,34 @@ function registerWorkspaceCommands(agents, readKey) {
381
408
  print(overview, "agents billing", describeOverview(overview), options);
382
409
  }
383
410
  );
411
+ agents.command("models").description(
412
+ "List the models an agent or one of its channels can run on, and which your workspace\u2019s key can run."
413
+ ).option("--json", "Emit JSON output").action(async (options) => {
414
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
415
+ const result = await http.get(
416
+ `${AGENT_PATH}/models`
417
+ );
418
+ const keySet = result.models.some((model) => model.available);
419
+ print(
420
+ result,
421
+ "agent models",
422
+ [
423
+ ...keySet ? [] : [
424
+ "No model key is set, so no model can run yet. An admin runs: deepline agents billing set < key.txt"
425
+ ],
426
+ ...result.models.map(
427
+ (model) => `${model.id} \u2014 ${model.label}${model.id === result.default ? " (the default)" : ""}; say: ${model.aliases.join(", ")}; ${model.available ? "ready" : keySet ? `runs on an ${MODEL_PROVIDER_NAMES[model.provider]} key, which is not the key your agents run on` : `runs on an ${MODEL_PROVIDER_NAMES[model.provider]} key`}`
428
+ ),
429
+ "Set an agent\u2019s model with: deepline agents update <agent> --model <model>",
430
+ "Set one channel\u2019s with: deepline agents channels set <channel-id> --model <model>, or ask the agent there to switch."
431
+ ],
432
+ options
433
+ );
434
+ });
384
435
  }
385
436
  function registerAgentCommands(agents) {
386
437
  agents.command("get").description("Show one agent: its instructions, skills and channels.").argument("<name>", "Agent name").option("--json", "Emit JSON output").action(async (name, options) => {
387
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
438
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
388
439
  const result = await http.get(
389
440
  `${AGENT_PATH}/agents/${encodeURIComponent(requireArgument(name, "an agent name"))}`
390
441
  );
@@ -392,9 +443,13 @@ function registerAgentCommands(agents) {
392
443
  });
393
444
  agents.command("create").description(
394
445
  "Create an agent you own, with instructions and optional skills from the workspace library."
395
- ).argument("<name>", "Agent name: lower-case letters, digits and dashes").option("--instructions <text>", "What the agent does and never does").option("--instructions-file <path>", "Read the instructions from a file").option("--skills <names>", "Comma-separated library skill names").option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
446
+ ).argument("<name>", "Agent name: lower-case letters, digits and dashes").option("--instructions <text>", "What the agent does and never does").option("--instructions-file <path>", "Read the instructions from a file").option("--skills <names>", "Comma-separated library skill names").option(
447
+ "--model <model>",
448
+ "The model it runs on, from deepline agents models (for example sonnet)"
449
+ ).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
396
450
  async (name, options) => {
397
451
  const instructions = readInstructions(options);
452
+ const model = parseModel(options.model);
398
453
  if (instructions === void 0) {
399
454
  throw new AgentUsageError(
400
455
  'Pass --instructions "<what the agent does>" or --instructions-file <path>.'
@@ -403,13 +458,14 @@ function registerAgentCommands(agents) {
403
458
  const body = {
404
459
  name: requireArgument(name, "an agent name"),
405
460
  instructions,
406
- skills: _nullishCoalesce(parseSkills(options.skills), () => ( []))
461
+ skills: _nullishCoalesce(parseSkills(options.skills), () => ( [])),
462
+ ...typeof model === "string" ? { model } : {}
407
463
  };
408
464
  if (options.dryRun) {
409
465
  printDryRun("POST", `${AGENT_PATH}/agents`, body, options);
410
466
  return;
411
467
  }
412
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
468
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
413
469
  const result = await http.post(
414
470
  `${AGENT_PATH}/agents`,
415
471
  body
@@ -426,29 +482,34 @@ function registerAgentCommands(agents) {
426
482
  }
427
483
  );
428
484
  agents.command("update").description(
429
- "Replace an agent\u2019s instructions or skills (its creator or an admin)."
485
+ "Replace an agent\u2019s instructions, skills or model (its creator or an admin)."
430
486
  ).argument("<name>", "Agent name").option("--instructions <text>", "New instructions").option("--instructions-file <path>", "Read new instructions from a file").option(
431
487
  "--skills <names>",
432
488
  'Comma-separated library skill names; replaces the list ("" clears it)'
489
+ ).option(
490
+ "--model <model>",
491
+ 'The model it runs on, from deepline agents models ("default" returns it to the default)'
433
492
  ).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
434
493
  async (name, options) => {
435
494
  const instructions = readInstructions(options);
436
495
  const skills = parseSkills(options.skills);
437
- if (instructions === void 0 && skills === void 0) {
496
+ const model = parseModel(options.model);
497
+ if (instructions === void 0 && skills === void 0 && model === void 0) {
438
498
  throw new AgentUsageError(
439
- "Pass --instructions, --instructions-file or --skills."
499
+ "Pass --instructions, --instructions-file, --skills or --model."
440
500
  );
441
501
  }
442
502
  const path = `${AGENT_PATH}/agents/${encodeURIComponent(requireArgument(name, "an agent name"))}`;
443
503
  const body = {
444
504
  ...instructions !== void 0 ? { instructions } : {},
445
- ...skills !== void 0 ? { skills } : {}
505
+ ...skills !== void 0 ? { skills } : {},
506
+ ...model !== void 0 ? { model } : {}
446
507
  };
447
508
  if (options.dryRun) {
448
509
  printDryRun("PATCH", path, body, options);
449
510
  return;
450
511
  }
451
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
512
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
452
513
  const result = await http.patch(path, body);
453
514
  print(result, "agent updated", describeAgent(result.agent), options);
454
515
  }
@@ -461,7 +522,7 @@ function registerAgentCommands(agents) {
461
522
  printDryRun("DELETE", path, null, options);
462
523
  return;
463
524
  }
464
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
525
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
465
526
  const result = await http.delete(path);
466
527
  print(
467
528
  result,
@@ -473,40 +534,104 @@ function registerAgentCommands(agents) {
473
534
  }
474
535
  function registerChannelCommands(agents) {
475
536
  const channels = agents.command("channels").description(
476
- "Bind Slack channels to agents. A channel answers @mentions with one agent."
537
+ "Bind Slack channels to agents, and say what an agent runs on and works toward in each. A channel answers @mentions with one agent."
477
538
  );
478
539
  channels.command("add").description(
479
- "Bind a channel the agent\u2019s Slack app was invited to (the agent\u2019s creator or an admin)."
480
- ).argument("<agent>", "Agent name").argument("<channel-id>", "Slack channel id, for example C0123456789").addOption(new (0, _commander.Option)("--test-channel").hideHelp()).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
540
+ "Bind a channel the agent\u2019s Slack app was invited to (the agent\u2019s creator or an admin). With --outcome the channel is where the agent works toward that outcome."
541
+ ).argument("<agent>", "Agent name").argument("<channel-id>", "Slack channel id, for example C0123456789").option(
542
+ "--outcome <outcome>",
543
+ "The outcome the agent works toward here, as deepline outcomes list names it. The channel becomes the outcome\u2019s home: the agent is woken there."
544
+ ).option(
545
+ "--linked",
546
+ "With --outcome: link the channel instead. The agent answers here with the outcome in view; its home channel is another one."
547
+ ).addOption(new (0, _commander.Option)("--test-channel").hideHelp()).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
481
548
  async (agentName, channelId, options) => {
549
+ if (options.linked && options.outcome === void 0) {
550
+ throw new AgentUsageError("--linked goes with --outcome <outcome>.");
551
+ }
482
552
  const body = {
483
553
  agent: requireArgument(agentName, "an agent name"),
484
554
  channel_id: requireArgument(
485
555
  channelId,
486
556
  "a channel id such as C0123456789"
487
557
  ),
488
- ...options.testChannel ? { test_channel: true } : {}
558
+ ...options.testChannel ? { test_channel: true } : {},
559
+ ...options.outcome !== void 0 ? {
560
+ outcome: requireArgument(options.outcome, "an outcome name"),
561
+ outcome_role: options.linked ? "linked" : "home"
562
+ } : {}
489
563
  };
490
564
  if (options.dryRun) {
491
565
  printDryRun("POST", `${AGENT_PATH}/channels`, body, options);
492
566
  return;
493
567
  }
494
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
495
- const result = await http.post(
496
- `${AGENT_PATH}/channels`,
497
- body
498
- );
568
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
569
+ const result = await http.post(`${AGENT_PATH}/channels`, body);
499
570
  print(
500
571
  result,
501
572
  "agent channel",
502
573
  [
503
574
  result.created ? `Bound ${body.channel_id} to ${result.agent.name}.` : `${body.channel_id} already answers with ${result.agent.name}.`,
575
+ ...result.outcome ? describeOutcomeChange(result.outcome) : [],
504
576
  ...describeAgent(result.agent)
505
577
  ],
506
578
  options
507
579
  );
508
580
  }
509
581
  );
582
+ channels.command("set").description(
583
+ "Change what a bound channel\u2019s agent runs on or works toward there (the agent\u2019s creator or an admin)."
584
+ ).argument("<channel-id>", "A bound channel id").option(
585
+ "--model <model>",
586
+ 'This channel\u2019s own model, over its agent\u2019s, from deepline agents models ("default" follows the agent again)'
587
+ ).option(
588
+ "--outcome <outcome>",
589
+ "The outcome the agent works toward here. The channel becomes the outcome\u2019s home."
590
+ ).option(
591
+ "--linked",
592
+ "With --outcome: link the channel instead of making it the home"
593
+ ).option("--no-outcome", "The agent works toward no outcome here").option(
594
+ "--platform <platform>",
595
+ "slack or test, when the id is bound on both"
596
+ ).option("--dry-run", "Print the request without sending it").option("--json", "Emit JSON output").action(
597
+ async (channelId, options) => {
598
+ const platform = requirePlatform(options.platform);
599
+ const model = parseModel(options.model);
600
+ const outcome = typeof options.outcome === "string" ? requireArgument(options.outcome, "an outcome name") : options.outcome === false ? null : void 0;
601
+ if (model === void 0 && outcome === void 0) {
602
+ throw new AgentUsageError(
603
+ "Pass --model, --outcome <outcome> or --no-outcome."
604
+ );
605
+ }
606
+ if (options.linked && typeof outcome !== "string") {
607
+ throw new AgentUsageError("--linked goes with --outcome <outcome>.");
608
+ }
609
+ const id = requireArgument(channelId, "a channel id");
610
+ const path = `${AGENT_PATH}/channels/${encodeURIComponent(id)}${platform ? `?platform=${platform}` : ""}`;
611
+ const body = {
612
+ ...model !== void 0 ? { model } : {},
613
+ ...outcome !== void 0 ? { outcome } : {},
614
+ ...typeof outcome === "string" ? { outcome_role: options.linked ? "linked" : "home" } : {}
615
+ };
616
+ if (options.dryRun) {
617
+ printDryRun("PATCH", path, body, options);
618
+ return;
619
+ }
620
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
621
+ const result = await http.patch(path, body);
622
+ print(
623
+ result,
624
+ "agent channel",
625
+ [
626
+ ...result.model ? [
627
+ result.model.from === "conversation" ? `${id} runs on ${result.model.model.label} (${result.model.model.id}). Its agent\u2019s other channels are unchanged.` : `${id} follows its agent\u2019s model: ${result.model.model.label} (${result.model.model.id}).`
628
+ ] : [],
629
+ ...result.outcome ? describeOutcomeChange(result.outcome) : []
630
+ ],
631
+ options
632
+ );
633
+ }
634
+ );
510
635
  channels.command("remove").description(
511
636
  "Unbind a channel from its agent (the agent\u2019s creator or an admin). Unbound channels are a no-op."
512
637
  ).argument("<channel-id>", "Channel id").option(
@@ -520,7 +645,7 @@ function registerChannelCommands(agents) {
520
645
  printDryRun("DELETE", path, null, options);
521
646
  return;
522
647
  }
523
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
648
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
524
649
  const result = await http.delete(path);
525
650
  print(
526
651
  result,
@@ -541,6 +666,14 @@ function describeSlackInstallation(installation) {
541
666
  const reason = installation.uninstallReason === "tokens_revoked" ? "its token was revoked" : "removed from Slack";
542
667
  return `${team}: not installed since ${new Date(_nullishCoalesce(installation.uninstalledAt, () => ( installation.updatedAt))).toISOString()} (${reason}); install it again to bring its channels back`;
543
668
  }
669
+ function slackLinkCode(value) {
670
+ const text = requireArgument(value, "the code from the link");
671
+ try {
672
+ return _nullishCoalesce(new URL(text).searchParams.get("code"), () => ( text));
673
+ } catch (e2) {
674
+ return text;
675
+ }
676
+ }
544
677
  function registerSlackCommands(agents) {
545
678
  const slack = agents.command("slack").description(
546
679
  "Add the agent to Slack workspaces, each with its own bot token, and see where it is installed."
@@ -548,7 +681,7 @@ function registerSlackCommands(agents) {
548
681
  slack.command("install").description(
549
682
  "Print a link that adds the agent to a Slack workspace (owners and admins). Open it, pick the Slack workspace and approve."
550
683
  ).option("--json", "Emit JSON output").action(async (options) => {
551
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
684
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
552
685
  const result = await http.post(
553
686
  `${AGENT_PATH}/slack/install`,
554
687
  {}
@@ -564,10 +697,40 @@ function registerSlackCommands(agents) {
564
697
  options
565
698
  );
566
699
  });
700
+ slack.command("link").description(
701
+ "Say which Slack user you are, with the code from the link the agent showed you in Slack. Your clicks there (answering an ask, connecting a channel) are then made as you."
702
+ ).argument("<code>", "The code from the link, or the whole link").option("--json", "Emit JSON output").action(async (code, options) => {
703
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
704
+ const result = await http.post(`${AGENT_PATH}/slack/link`, { code: slackLinkCode(code) });
705
+ print(
706
+ result,
707
+ "agent slack link",
708
+ [
709
+ `Linked Slack user ${result.slackUserId} in ${result.slackTeamId} to your Deepline account. Click again in Slack.`
710
+ ],
711
+ options
712
+ );
713
+ });
714
+ slack.command("unlink").description(
715
+ "Forget which Slack user you are in this workspace. Your clicks in Slack decide nothing until you link again."
716
+ ).option("--json", "Emit JSON output").action(async (options) => {
717
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
718
+ const result = await http.delete(
719
+ `${AGENT_PATH}/slack/link`
720
+ );
721
+ print(
722
+ result,
723
+ "agent slack unlink",
724
+ [
725
+ result.removed ? "Unlinked your Slack user." : "No Slack user was linked to your account."
726
+ ],
727
+ options
728
+ );
729
+ });
567
730
  slack.command("status").description(
568
731
  "List the Slack workspaces this workspace installed the agent in."
569
732
  ).option("--json", "Emit JSON output").action(async (options) => {
570
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
733
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
571
734
  const result = await http.get(
572
735
  `${AGENT_PATH}/slack/installations`
573
736
  );
@@ -586,7 +749,7 @@ function registerSkillCommands(agents) {
586
749
  "The workspace\u2019s skill library: markdown an agent loads when its description matches the task."
587
750
  );
588
751
  skills.command("get").description("Show one library skill with its markdown.").argument("<name>", "Skill name").option("--json", "Emit JSON output").action(async (name, options) => {
589
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
752
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
590
753
  const result = await http.get(
591
754
  `${AGENT_PATH}/skills/${encodeURIComponent(requireArgument(name, "a skill name"))}`
592
755
  );
@@ -624,7 +787,7 @@ function registerSkillCommands(agents) {
624
787
  printDryRun("PUT", path, body, options);
625
788
  return;
626
789
  }
627
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
790
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
628
791
  const result = await http.put(path, body);
629
792
  print(
630
793
  result,
@@ -647,7 +810,7 @@ function registerSkillCommands(agents) {
647
810
  printDryRun("DELETE", path, null, options);
648
811
  return;
649
812
  }
650
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
813
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
651
814
  const result = await http.delete(path);
652
815
  print(
653
816
  result,
@@ -701,7 +864,7 @@ function registerFeedbackCommand(agents) {
701
864
  params.set("cursor", requireArgument(options.cursor, "--cursor"));
702
865
  }
703
866
  const query = params.toString();
704
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
867
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
705
868
  const page = await http.get(
706
869
  `${AGENT_PATH}/feedback${query ? `?${query}` : ""}`
707
870
  ).catch((error) => {
@@ -764,7 +927,7 @@ function registerRepliesCommand(agents) {
764
927
  params.set("cursor", requireArgument(options.cursor, "--cursor"));
765
928
  }
766
929
  const query = params.toString();
767
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
930
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
768
931
  const page = await http.get(`${AGENT_PATH}/replies${query ? `?${query}` : ""}`).catch((error) => {
769
932
  if (error instanceof _chunkLFQJW4S2js.DeeplineError && error.code === REPLIES_INVALID_CURSOR) {
770
933
  throw new AgentUsageError(`--cursor: ${error.message}`);
@@ -790,13 +953,13 @@ function registerActivityCommand(agents) {
790
953
  agents.command("activity").description(
791
954
  "Sum each agent's replies over the last 7 days: how many, how they ended, median time, tokens and the last reply."
792
955
  ).option("--json", "Emit JSON output").action(async (options) => {
793
- const { http } = _chunkVLUBEMWMjs.getAuthedHttpClient.call(void 0, );
956
+ const { http } = _chunkEV3OPDHFjs.getAuthedHttpClient.call(void 0, );
794
957
  const activity = await http.get(`${AGENT_PATH}/activity`);
795
958
  print(activity, "agent activity", describeActivity(activity), options);
796
959
  });
797
960
  }
798
961
  function registerAgentsCommands(program, readKey = readModelKey) {
799
- const agents = program.command("agents", { hidden: !_chunk2QYU57RGjs.cliFeatureEnabled.call(void 0, AGENT_FEATURE) }).description(
962
+ const agents = program.command("agents", { hidden: !_chunkAO56MZ7Djs.cliFeatureEnabled.call(void 0, AGENT_FEATURE) }).description(
800
963
  "Deepline agents in Slack: create agents with instructions and skills, bind channels to them, and talk to them."
801
964
  );
802
965
  registerWorkspaceCommands(agents, readKey);