@asterism-app/builtin-api 0.27.0 → 0.28.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/docs/agents.md +6 -0
- package/package.json +1 -1
- package/src/agent-services.ts +3 -1
- package/src/agent.ts +1 -1
package/docs/agents.md
CHANGED
|
@@ -34,6 +34,12 @@ Creating an Agent establishes an object; submitting input asks it to work. An in
|
|
|
34
34
|
|
|
35
35
|
Put required initialization in creation or prepared initial work. Observe creation facts for reactions after commitment, not as a blocking initialization hook. Resource presence is a lifetime concern: reconstruction can make an existing Agent present again without creating a new Agent.
|
|
36
36
|
|
|
37
|
+
## Treat the default as a creation preference
|
|
38
|
+
|
|
39
|
+
An integration that offers a new conversation can follow the user's default Agent configuration instead of hard-coding a bundled preset. Read that preference when choosing the initial configuration; keep an explicit user choice and the configuration of an existing Agent independent of later default changes.
|
|
40
|
+
|
|
41
|
+
The preference is only a configuration ID, not a copy of its instructions or a resolved model. It remains explicit if its target is disabled, deleted, or renamed. An integration should present that unavailable choice or expose the creation failure rather than silently substituting another role.
|
|
42
|
+
|
|
37
43
|
## Route through explicit relationships
|
|
38
44
|
|
|
39
45
|
The publishing integration chooses recipients. A bridge can use its direct links to find Agents without obtaining their private state or inheriting their access to other resources. The reverse link is a separate relationship.
|
package/package.json
CHANGED
package/src/agent-services.ts
CHANGED
|
@@ -2,8 +2,10 @@ import type { ResourceRef, SessionDirectory } from "@asterism-app/sdk/contracts"
|
|
|
2
2
|
import { PluginApiError, type PluginContext } from "@asterism-app/sdk/runtime";
|
|
3
3
|
import type { PeekClient } from "./peek.ts";
|
|
4
4
|
|
|
5
|
-
/** Agent
|
|
5
|
+
/** Agent defaults and resource operations for trusted plugins; resource operations take authorized references. */
|
|
6
6
|
export interface AgentServices {
|
|
7
|
+
/** Current default configuration ID for new conversations, read on access. The configuration may be disabled or missing; this does not select a model or change existing Agents. */
|
|
8
|
+
readonly defaultAgentId: string;
|
|
7
9
|
describe(target: ResourceRef): { type: string };
|
|
8
10
|
peek(target: ResourceRef): PeekClient;
|
|
9
11
|
}
|
package/src/agent.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { agentMessageSenderSchema } from "./messaging.ts";
|
|
|
7
7
|
|
|
8
8
|
/** Agents are ordinary resources: creation events record only identity; mutable data such as model selection belongs to private resource state. */
|
|
9
9
|
export const Agent = builtin.resource("agent", z.object({}));
|
|
10
|
-
/**
|
|
10
|
+
/** Factory default and baseline for custom Agent configurations; the user-selected default is exposed by AgentServices.defaultAgentId. */
|
|
11
11
|
export const defaultAgentPreset = "worker";
|
|
12
12
|
/** Pending input is delivered at request or turn boundaries; execution starts immediately when idle. */
|
|
13
13
|
export const agentInputModeSchema = z.enum(["steer", "follow"]);
|