@standardagents/spec 0.38.2 → 0.39.0

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/index.d.ts CHANGED
@@ -3809,6 +3809,15 @@ interface PromptToolConfig {
3809
3809
  * a non-empty human-readable `name` argument and runtimes SHOULD persist it as
3810
3810
  * a child thread display name.
3811
3811
  *
3812
+ * Lifecycle tools manage resumable relationships exclusively: runtimes MUST
3813
+ * reject a `subagent_create` invocation that targets a relationship without
3814
+ * `resumable` configuration, without creating a child, and the rejection
3815
+ * SHOULD direct the model to invoke that tool directly instead. Runtimes
3816
+ * SHOULD constrain the injected tool's target argument to the exposed names
3817
+ * of the prompt's resumable relationships. Lifecycle tool references use the
3818
+ * relationship's exposed tool `name`, never an internal agent identifier that
3819
+ * differs from it.
3820
+ *
3812
3821
  * ### Pull-based child visibility
3813
3822
  *
3814
3823
  * Whenever resumable subagent configs exist, runtimes MUST also inject a
@@ -3851,14 +3860,39 @@ interface PromptToolConfig {
3851
3860
  * },
3852
3861
  * }
3853
3862
  * ```
3863
+ *
3864
+ * @example
3865
+ * ```typescript
3866
+ * // The same agent exposed under a task-specific tool name.
3867
+ * {
3868
+ * name: 'summarize_document',
3869
+ * agent: 'document_agent',
3870
+ * blocking: true,
3871
+ * initUserMessageProperty: 'message',
3872
+ * }
3873
+ * ```
3854
3874
  */
3855
3875
  interface SubagentToolConfig<T extends string = StandardAgentSpec.Callables> {
3856
3876
  /**
3857
- * Agent callable name.
3877
+ * Exposed tool name — the name the model invokes this subagent by.
3858
3878
  *
3859
- * Must reference a `dual_ai` agent with `exposeAsTool: true`.
3879
+ * When `agent` is absent, this MUST reference a `dual_ai` agent with
3880
+ * `exposeAsTool: true` directly. When `agent` is present, this may be any
3881
+ * valid tool identifier; the runtime MUST expose the tool under this name
3882
+ * and MUST resolve invocations to the agent named by `agent`.
3860
3883
  */
3861
- name: T;
3884
+ name: T | (string & {});
3885
+ /**
3886
+ * The `dual_ai` agent this tool invokes, when the tool is exposed under a
3887
+ * name other than the agent's own. Must reference a `dual_ai` agent with
3888
+ * `exposeAsTool: true`. Defaults to `name`.
3889
+ *
3890
+ * The same agent may be exposed under different tool names by different
3891
+ * prompts. Everything model-facing — the tool schema, instance registries,
3892
+ * and subagent lifecycle tool references — uses the exposed `name`;
3893
+ * runtimes resolve the implementing agent internally as `agent ?? name`.
3894
+ */
3895
+ agent?: T;
3862
3896
  /**
3863
3897
  * Whether parent execution blocks until the subagent returns a result.
3864
3898
  *