sparkecoder 0.1.128 → 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.
- package/dist/agent/index.js +46 -11
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +86 -53
- package/dist/cli.js.map +1 -1
- package/dist/index.js +86 -53
- package/dist/index.js.map +1 -1
- package/dist/server/index.js +86 -53
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- /package/web/.next/standalone/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
- /package/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_buildManifest.js +0 -0
- /package/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{nLC9shTGqDJLbL_Arw25S → 2mUQ8I-TCRE5uOBFhIWag}/_ssgManifest.js +0 -0
package/dist/agent/index.js
CHANGED
|
@@ -6502,20 +6502,50 @@ You are the **orchestrator agent**. You triage everything that comes in, spawn w
|
|
|
6502
6502
|
|
|
6503
6503
|
<channels>
|
|
6504
6504
|
|
|
6505
|
-
Every
|
|
6505
|
+
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.
|
|
6506
6506
|
|
|
6507
|
-
|
|
6507
|
+
## \u{1F6A8} Critical rule: text alone only reaches the WEB channel
|
|
6508
|
+
|
|
6509
|
+
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.
|
|
6510
|
+
|
|
6511
|
+
Quick mental check before every response:
|
|
6512
|
+
|
|
6513
|
+
- Pill says \`[WEB]\` \u2192 reply with text. Done.
|
|
6514
|
+
- Pill says \`[SLACK ...]\` \u2192 **call \`messenger\`** with the channel + threadTs from the pill. Text alone is wrong.
|
|
6515
|
+
- 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.
|
|
6516
|
+
- 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.
|
|
6517
|
+
|
|
6518
|
+
## Pill formats and reply recipes
|
|
6519
|
+
|
|
6520
|
+
- \`[WEB] ...\` \u2014 typed in the web dashboard. Your assistant text streams back automatically. **No tool call needed.**
|
|
6521
|
+
|
|
6522
|
+
- \`[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:'...'})] ...\`
|
|
6523
|
+
- 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.
|
|
6524
|
+
- 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).
|
|
6525
|
+
- \`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.
|
|
6526
|
+
- 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.
|
|
6527
|
+
|
|
6528
|
+
- \`[SYSTEM worker.completed worker-name] ...\` \u2014 a worker you spawned finished. Look back at the conversation: where did the ORIGINAL user request come from?
|
|
6529
|
+
- Original was \`[WEB]\` \u2192 plain text reply is fine (the user is watching).
|
|
6530
|
+
- Original was \`[SLACK ...]\` \u2192 post the result to that Slack thread via \`messenger\` (the channel + threadTs are in the earlier pill, scroll back).
|
|
6531
|
+
- Original was \`[SCHEDULE ...]\` with a \`replyChannel\` \u2192 post there.
|
|
6532
|
+
- Original was \`[WEBHOOK ...]\` \u2192 no automatic reply target; decide based on the webhook's purpose.
|
|
6533
|
+
|
|
6534
|
+
- \`[SYSTEM worker.failed worker-name] ...\` \u2014 same routing logic as completed; tell the user (in the original channel).
|
|
6508
6535
|
|
|
6509
|
-
- \`[WEB] ...\` \u2014 typed in the web dashboard. Your assistant text streams back automatically. No tool call needed.
|
|
6510
|
-
- \`[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.
|
|
6511
|
-
- \`[SYSTEM worker.completed worker-name] ...\` \u2014 a worker you spawned finished. Look back at the conversation: where did the request originate?
|
|
6512
|
-
- If the original request was \`[WEB]\`, a normal text reply is enough (the user is watching).
|
|
6513
|
-
- If it was \`[SLACK ...]\`, post the result to that Slack thread via \`messenger\`.
|
|
6514
|
-
- If it was a schedule with \`replyChannel\`, post there.
|
|
6515
|
-
- \`[SYSTEM worker.failed worker-name] ...\` \u2014 same routing logic as completed; tell the user.
|
|
6516
6536
|
- \`[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})\`.
|
|
6517
|
-
|
|
6518
|
-
- \`[
|
|
6537
|
+
|
|
6538
|
+
- \`[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").
|
|
6539
|
+
|
|
6540
|
+
- \`[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.
|
|
6541
|
+
|
|
6542
|
+
## Multi-thread reasoning
|
|
6543
|
+
|
|
6544
|
+
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.
|
|
6545
|
+
|
|
6546
|
+
## Recovery if you mess up
|
|
6547
|
+
|
|
6548
|
+
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.
|
|
6519
6549
|
</channels>
|
|
6520
6550
|
|
|
6521
6551
|
<delivery_failures>
|
|
@@ -7562,6 +7592,11 @@ var slackChannel = {
|
|
|
7562
7592
|
if (r.slackChannel) parts.push(`channel=${r.slackChannel}`);
|
|
7563
7593
|
if (r.threadTs) parts.push(`thread=${r.threadTs}`);
|
|
7564
7594
|
if (r.user) parts.push(`user=${r.user}`);
|
|
7595
|
+
if (r.slackChannel && r.threadTs) {
|
|
7596
|
+
parts.push(
|
|
7597
|
+
`reply-with=messenger({action:'post',channel:'slack',to:'${r.slackChannel}',threadTs:'${r.threadTs}',text:'...'})`
|
|
7598
|
+
);
|
|
7599
|
+
}
|
|
7565
7600
|
return parts.join(" ");
|
|
7566
7601
|
}
|
|
7567
7602
|
};
|