sparkecoder 0.1.129 → 0.1.130

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 (102) hide show
  1. package/dist/agent/index.js +46 -11
  2. package/dist/agent/index.js.map +1 -1
  3. package/dist/cli.js +46 -11
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.js +46 -11
  6. package/dist/index.js.map +1 -1
  7. package/dist/server/index.js +46 -11
  8. package/dist/server/index.js.map +1 -1
  9. package/package.json +1 -1
  10. package/web/.next/BUILD_ID +1 -1
  11. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  12. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  13. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  14. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  15. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  16. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  17. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  18. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  19. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  20. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  21. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  22. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
  23. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  25. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  29. package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
  30. package/web/.next/standalone/web/.next/server/app/agents.rsc +1 -1
  31. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
  33. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
  34. package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +1 -1
  35. package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
  37. package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  39. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
  40. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  46. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  47. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  48. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
  49. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  55. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  56. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  57. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
  58. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
  59. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  64. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  66. package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
  67. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  68. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  72. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  73. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  74. package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
  75. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  76. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  77. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  78. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  80. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  81. package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
  82. package/web/.next/standalone/web/.next/server/app/settings.rsc +1 -1
  83. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +1 -1
  84. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
  85. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +1 -1
  86. package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  87. package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  88. package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  89. package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  90. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  91. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  92. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  93. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  94. /package/web/.next/standalone/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
  95. /package/web/.next/standalone/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
  96. /package/web/.next/standalone/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
  97. /package/web/.next/standalone/web/.next/static/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
  98. /package/web/.next/standalone/web/.next/static/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
  99. /package/web/.next/standalone/web/.next/static/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
  100. /package/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
  101. /package/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
  102. /package/web/.next/static/{JrfYXT7oAfEeygDIQ-mGv → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
package/dist/index.js CHANGED
@@ -7052,20 +7052,50 @@ You are the **orchestrator agent**. You triage everything that comes in, spawn w
7052
7052
 
7053
7053
  <channels>
7054
7054
 
7055
- Every user-message you see is tagged at the front with a channel pill describing where it came from. **You are responsible for routing replies to the correct channel.** Only web messages get replied to "for free" via the open SSE stream; for every other channel you MUST call the \`messenger\` tool to actually deliver a reply, or the user will never see it.
7055
+ Every inbound message starts with a channel pill telling you **exactly where it came from**. You are responsible for routing each reply back to **the same place**, in the same thread when applicable.
7056
7056
 
7057
- Pill formats:
7057
+ ## \u{1F6A8} Critical rule: text alone only reaches the WEB channel
7058
+
7059
+ If the pill is NOT \`[WEB]\` and you respond with only assistant text, **nobody hears you**. The text streams to the orchestrator's hidden web view that nobody is watching. You MUST call the \`messenger\` tool (or the appropriate write API) to actually deliver a reply on that channel. This is the #1 routing bug \u2014 text-only replies to Slack/DMs are silently dropped.
7060
+
7061
+ Quick mental check before every response:
7062
+
7063
+ - Pill says \`[WEB]\` \u2192 reply with text. Done.
7064
+ - Pill says \`[SLACK ...]\` \u2192 **call \`messenger\`** with the channel + threadTs from the pill. Text alone is wrong.
7065
+ - Pill says \`[SYSTEM ...]\` or \`[SCHEDULE ...]\` \u2192 look at the ORIGINATING channel (which is in the pill metadata, the spawn goal, or the schedule's \`replyChannel\`). Route there.
7066
+ - Pill says \`[WEBHOOK ...]\` \u2192 it's external input with no inherent "reply to" channel; decide whether the human who set up the webhook wants a Slack/web/email follow-up.
7067
+
7068
+ ## Pill formats and reply recipes
7069
+
7070
+ - \`[WEB] ...\` \u2014 typed in the web dashboard. Your assistant text streams back automatically. **No tool call needed.**
7071
+
7072
+ - \`[SLACK channel=C0123 thread=1700000000.001 user=Ryan Trattner <@U0123> (ryan@example.com) reply-with=messenger({action:'post',channel:'slack',to:'C0123',threadTs:'1700000000.001',text:'...'})] ...\`
7073
+ - The pill literally contains a \`reply-with=...\` snippet \u2014 **copy the exact \`messenger({...})\` call** (just replace \`'...'\` with your reply text). Channel id, threadTs, all already correct.
7074
+ - DM vs channel post is the same call (Slack auto-routes when \`to\` is a \`D\u2026\` DM id or a \`U\u2026\` user id).
7075
+ - \`threadTs\` is REQUIRED so your reply lands in the same thread the user is reading. Dropping it makes a fresh top-level message that the user has to hunt for.
7076
+ - The \`user=\` field is the speaker enriched in-place. When the bot has the right scopes you get \`<Name> <@U_ID> (email)\`; if scopes are missing you may see just the raw id \u2014 that's not an error, just less context. \`<@U\u2026>\` mentions inside message text are normalized the same way.
7077
+
7078
+ - \`[SYSTEM worker.completed worker-name] ...\` \u2014 a worker you spawned finished. Look back at the conversation: where did the ORIGINAL user request come from?
7079
+ - Original was \`[WEB]\` \u2192 plain text reply is fine (the user is watching).
7080
+ - Original was \`[SLACK ...]\` \u2192 post the result to that Slack thread via \`messenger\` (the channel + threadTs are in the earlier pill, scroll back).
7081
+ - Original was \`[SCHEDULE ...]\` with a \`replyChannel\` \u2192 post there.
7082
+ - Original was \`[WEBHOOK ...]\` \u2192 no automatic reply target; decide based on the webhook's purpose.
7083
+
7084
+ - \`[SYSTEM worker.failed worker-name] ...\` \u2014 same routing logic as completed; tell the user (in the original channel).
7058
7085
 
7059
- - \`[WEB] ...\` \u2014 typed in the web dashboard. Your assistant text streams back automatically. No tool call needed.
7060
- - \`[SLACK channel=C0123 thread=1700000000.001 user=Ryan Trattner <@U0123> (ryan@example.com)] ...\` \u2014 a Slack mention or DM. To reply: \`messenger({action:'post', channel:'slack', to:'C0123', threadTs:'1700000000.001', text:'...'})\`. **Always set \`threadTs\`** so the reply lands in the same thread. The \`user=\` field is enriched in-place: when the bot has the right scopes you get \`<Name> <@U_ID> (email)\`; if scopes are missing you may see just the raw id \u2014 that's not an error, just less context. Any \`<@U\u2026>\` mentions inside the message text are similarly normalized to \`<Name> <@U_ID>\` so you can immediately tell who's being addressed.
7061
- - \`[SYSTEM worker.completed worker-name] ...\` \u2014 a worker you spawned finished. Look back at the conversation: where did the request originate?
7062
- - If the original request was \`[WEB]\`, a normal text reply is enough (the user is watching).
7063
- - If it was \`[SLACK ...]\`, post the result to that Slack thread via \`messenger\`.
7064
- - If it was a schedule with \`replyChannel\`, post there.
7065
- - \`[SYSTEM worker.failed worker-name] ...\` \u2014 same routing logic as completed; tell the user.
7066
7086
  - \`[SYSTEM worker.question worker-name] ...\` \u2014 a worker is blocked on \`ask_question_to_user\`. Decide an answer (ask the human if you don't know \u2014 via the same channel that originated the work). Then deliver it with \`agent({action:'answer_question', id, questionId, answer})\`.
7067
- - \`[SCHEDULE name] ...\` \u2014 a scheduled prompt fired. Treat as a user request from that schedule. Post results to the schedule's \`replyChannel\` if any, otherwise pick the most sensible channel.
7068
- - \`[WEBHOOK name] ...\` \u2014 an external service hit one of your webhook URLs. Body is the request body (verbatim or per the webhook's template).
7087
+
7088
+ - \`[SCHEDULE name] ...\` \u2014 a scheduled prompt fired. Treat as a user request from that schedule. Post results to the schedule's \`replyChannel\` if any, otherwise pick the most sensible channel (don't guess wildly \u2014 when unsure, post a single web note saying "schedule X fired, here's what I'd do, lmk where to send it").
7089
+
7090
+ - \`[WEBHOOK name] ...\` \u2014 an external service hit one of your webhook URLs. Body is the request body (verbatim or per the webhook's template). Webhooks don't have an inherent reply destination \u2014 decide explicitly.
7091
+
7092
+ ## Multi-thread reasoning
7093
+
7094
+ When several inbound messages are in flight at once (Slack DM + Slack channel + a SYSTEM worker.completed + a SCHEDULE all firing in the same daemon turn), **respond to each one in its own channel separately** \u2014 fire multiple \`messenger\` calls in the same turn, one per origin. Don't lump them into one giant text reply to whichever channel you happened to focus on; the other channels will look ignored.
7095
+
7096
+ ## Recovery if you mess up
7097
+
7098
+ If you realize after the fact that you posted in the wrong place (e.g. text-only when you should have used messenger, or wrong thread), **don't pretend it didn't happen**. Acknowledge briefly in the correct channel: "(sorry, posted that to the wrong place a moment ago \u2014 here's the actual reply)". The user already saw the gap.
7069
7099
  </channels>
7070
7100
 
7071
7101
  <delivery_failures>
@@ -8495,6 +8525,11 @@ var init_slack = __esm({
8495
8525
  if (r.slackChannel) parts.push(`channel=${r.slackChannel}`);
8496
8526
  if (r.threadTs) parts.push(`thread=${r.threadTs}`);
8497
8527
  if (r.user) parts.push(`user=${r.user}`);
8528
+ if (r.slackChannel && r.threadTs) {
8529
+ parts.push(
8530
+ `reply-with=messenger({action:'post',channel:'slack',to:'${r.slackChannel}',threadTs:'${r.threadTs}',text:'...'})`
8531
+ );
8532
+ }
8498
8533
  return parts.join(" ");
8499
8534
  }
8500
8535
  };