@standardagents/skill 0.17.0 → 0.17.1
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/package.json
CHANGED
|
@@ -493,7 +493,7 @@ This is the single biggest gap in most coding-agent-built tools. **Do not write
|
|
|
493
493
|
| Read/write config and secrets | `state.env` / `state.envType` / `state.setEnv` | `process.env`, `.env` files |
|
|
494
494
|
| Run isolated deterministic code | `state.runCode` with explicit bridges | `eval`, child processes, implicit runtime access |
|
|
495
495
|
| Search files the thread has seen | `state.grepFiles` / `state.findFiles` | Reimplementing search |
|
|
496
|
-
| Escalate / report status to the parent | `state.notifyParent` / `state.setStatus` | Custom message bus |
|
|
496
|
+
| Escalate / report status to the parent | `state.notifyParent` / `state.setStatus` / `state.stopSession` | Custom message bus |
|
|
497
497
|
| Load a sibling prompt / agent / model | `state.loadPrompt` / `state.loadAgent` / `state.loadModel` | Duplicating the definition |
|
|
498
498
|
| Inspect or message a child thread | `state.children` / `state.getChildThread` | External orchestration |
|
|
499
499
|
| Inject context the model should see | `state.injectMessage` / `state.queueMessage` | Stuffing the system prompt |
|
|
@@ -515,7 +515,7 @@ Resources loadModel, loadPrompt, loadAgent,
|
|
|
515
515
|
getChildThread, getParentThread,
|
|
516
516
|
getPromptNames, getAgentNames, getModelNames
|
|
517
517
|
Env env, envType, setEnv
|
|
518
|
-
Parent notifyParent, setStatus
|
|
518
|
+
Parent notifyParent, setStatus, stopSession
|
|
519
519
|
Tools queueTool, invokeTool
|
|
520
520
|
Effects scheduleEffect, getScheduledEffects, removeScheduledEffect
|
|
521
521
|
Events emit
|
|
@@ -579,7 +579,8 @@ By default, `runCode()` executes the `default` export with no args. Use `execute
|
|
|
579
579
|
- **`state.runCode`** runs JavaScript or TypeScript in an isolated Dynamic Worker sandbox. The sandbox does not receive `ThreadState`, env, files, network, or host globals implicitly. Pass exact capabilities through `imports`, `globals`, `modules`, and `execute`. It executes exported values/functions; code such as `console.log(fibonacci(5))` can log, but it must still `export default ...` or export a named function/value for the host to receive a result.
|
|
580
580
|
- **`state.scheduleEffect`** runs a named effect after a delay. It survives restarts. This is your cron, your queue, and your retry timer all in one.
|
|
581
581
|
- **`state.invokeTool` vs `state.queueTool`** — `invokeTool` runs synchronously and returns the result; `queueTool` schedules the call to run later in the normal tool-call flow. Prefer `queueTool` when the model should see the result as a regular tool call.
|
|
582
|
-
- **`state.notifyParent`** — for resumable subagents with `parentCommunication: 'explicit'`, this is the
|
|
582
|
+
- **`state.notifyParent`** — for resumable subagents with `parentCommunication: 'explicit'`, this is the main way the child talks to the parent. Use it sparingly; every delivered notification interrupts the parent. If there is no parent, nothing is queued externally.
|
|
583
|
+
- **`state.stopSession`** — terminally ends the active agent session. Use `state.stopSession({ result, notifyParent, status })` when a tool should return a blocking result, optionally notify the parent, and mark the child status without requiring a session tool call.
|
|
583
584
|
- **File attachments** use the path convention `/attachments/{filename}.{ext}`. Always use this path when passing files between agents — the runtime copies them across thread filesystems automatically.
|
|
584
585
|
|
|
585
586
|
### Sandboxed code env bridge pattern
|
|
@@ -746,7 +747,9 @@ SubagentToolConfig — entry on a parent prompt's `tools` array
|
|
|
746
747
|
maxInstances number cap on concurrent instances; when reached the tool
|
|
747
748
|
is hidden and new messages route to existing instances
|
|
748
749
|
parentCommunication 'implicit' | 'explicit' implicit (default) auto-queues completion to parent
|
|
749
|
-
explicit requires state.notifyParent()
|
|
750
|
+
explicit requires state.notifyParent(),
|
|
751
|
+
state.setStatus(), or state.stopSession()
|
|
752
|
+
in code
|
|
750
753
|
initUserMessageProperty schema field name tool arg used as child's first user message
|
|
751
754
|
initAttachmentsProperty schema field name tool arg holding /attachments/* paths to copy to child
|
|
752
755
|
initAgentNameProperty schema field name tool arg used to tag the child thread (UI label)
|
|
@@ -764,7 +767,7 @@ These are correct as written in the spec — internalize them.
|
|
|
764
767
|
- Implicitly via `immediate: { ... }` — the child spawns the moment the parent prompt activates, before any LLM step.
|
|
765
768
|
2. **Children only communicate back to their parents.** Two flavors:
|
|
766
769
|
- **Implicit**: the child auto-queues a message to the parent when the session ends (via `sessionStop`, `sessionFail`, or `maxSessionTurns`). Default for all subagents.
|
|
767
|
-
- **Explicit**: only when `state.notifyParent()`
|
|
770
|
+
- **Explicit**: only when code calls `state.notifyParent()`, `state.setStatus()`, or `state.stopSession({ result, notifyParent, status })`. Set with `resumable.parentCommunication: 'explicit'`. Use for high-traffic resumables (e.g., a Slack monitor) where you want control over when the parent is interrupted.
|
|
768
771
|
3. **Resumable subagents can receive messages from their parents.** `resumable.receives_messages` chooses which side hears them.
|
|
769
772
|
4. **When a child sends back to the parent, it MUST indicate whether it needs a response** — in plain English, e.g. "After researching, you must respond so I can continue with the email." A research subagent providing FYI info doesn't need a response; a gmail subagent waiting on guidance does.
|
|
770
773
|
5. **File attachments use path strings.** `/attachments/{filename}.{ext}`. Use this convention everywhere — the runtime copies attachments across thread filesystems automatically when listed in `initAttachmentsProperty`.
|