@fastagent-sh/fastagent 0.16.2 → 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.
Files changed (43) hide show
  1. package/dist/channels/agentcore.d.ts +16 -2
  2. package/dist/channels/agentcore.js +90 -9
  3. package/dist/channels/control.d.ts +1 -1
  4. package/dist/channels/control.js +2 -1
  5. package/dist/channels/feishu/card.d.ts +20 -9
  6. package/dist/channels/feishu/card.js +27 -13
  7. package/dist/channels/feishu/feishu-api.d.ts +11 -2
  8. package/dist/channels/feishu/feishu.js +84 -10
  9. package/dist/channels/feishu/invoke-turn.d.ts +4 -0
  10. package/dist/channels/feishu/invoke-turn.js +31 -5
  11. package/dist/channels/feishu/normalize.js +97 -32
  12. package/dist/channels/feishu/preview.d.ts +4 -3
  13. package/dist/channels/feishu/preview.js +77 -23
  14. package/dist/channels/feishu/scaffold/feishu-send.ts +9 -6
  15. package/dist/channels/lark/scaffold/lark-send.ts +9 -6
  16. package/dist/cli/commands/attach.d.ts +18 -0
  17. package/dist/cli/commands/attach.js +46 -2
  18. package/dist/cli/commands/dev.js +2 -2
  19. package/dist/cli/commands/info.js +2 -2
  20. package/dist/cli/commands/start.js +41 -7
  21. package/dist/cli/program.js +2 -2
  22. package/dist/cli/serve.d.ts +4 -0
  23. package/dist/cli/serve.js +2 -2
  24. package/dist/deploy/agentcore/logs.d.ts +10 -5
  25. package/dist/deploy/agentcore/logs.js +2 -5
  26. package/dist/deploy/agentcore/plan.d.ts +3 -2
  27. package/dist/deploy/agentcore/plan.js +23 -5
  28. package/dist/deploy/agentcore/run.d.ts +7 -1
  29. package/dist/deploy/agentcore/run.js +93 -8
  30. package/dist/deploy/preflight.js +34 -7
  31. package/dist/engines/pi/create.js +7 -16
  32. package/dist/engines/pi/definition.d.ts +15 -0
  33. package/dist/engines/pi/definition.js +22 -1
  34. package/dist/engines/pi/open.d.ts +1 -1
  35. package/dist/engines/pi/open.js +19 -0
  36. package/dist/engines/pi/report.d.ts +16 -0
  37. package/dist/engines/pi/report.js +30 -0
  38. package/dist/engines/pi/session-builder.js +2 -2
  39. package/dist/engines/pi/session-control.d.ts +11 -1
  40. package/dist/engines/pi/session-control.js +3 -0
  41. package/dist/session-remote.js +17 -0
  42. package/dist/session.d.ts +20 -0
  43. package/package.json +1 -1
@@ -65,6 +65,23 @@ export async function connectSessionControl(options) {
65
65
  const capabilities = await get("/control/capabilities");
66
66
  return {
67
67
  capabilities: () => capabilities,
68
+ // NOT prefetched like capabilities: a live definition can grow a skill between calls, so the
69
+ // list is fetched per call. The endpoint is UNCACHED server-side (it re-reads the definition's
70
+ // skills/ per request), which is what keeps it honest about a directory that changes underneath
71
+ // it. A 404 is SKEW, not a fault in the definition: without this the two read identically
72
+ // (uncoded non-2xx), and a client would report "this agent's skills are unreadable" about a
73
+ // serve that simply predates the route.
74
+ async commands() {
75
+ try {
76
+ return await get("/control/commands");
77
+ }
78
+ catch (error) {
79
+ if (error instanceof ControlRequestError && error.status === 404) {
80
+ throw new ControlRequestError(404, "this serve does not implement /control/commands (it predates the route)");
81
+ }
82
+ throw error;
83
+ }
84
+ },
68
85
  state: (session) => get(`/control/state?session=${encodeURIComponent(session)}`),
69
86
  entries: (session, opts) => get(`/control/entries?session=${encodeURIComponent(session)}${opts?.since !== undefined ? `&since=${encodeURIComponent(opts.since)}` : ""}`, PAYLOAD_TIMEOUT_MS),
70
87
  async dispatch(session, command) {
package/dist/session.d.ts CHANGED
@@ -9,6 +9,14 @@
9
9
  import type { Json, Prompt } from "./agent.ts";
10
10
  export interface SessionControl {
11
11
  capabilities(): SessionCapabilities;
12
+ /** The names this agent exposes — what a composer's `/` completion LISTS. A listing, not a
13
+ * dispatch surface: the data plane takes prompts as text, so what typing one means (expanding it,
14
+ * sending "use the X skill", filtering a menu) is the client's business. Sessionless (the
15
+ * definition is a deployment fact) but ASYNC, because a definition is allowed to be live: an
16
+ * implementation that re-reads it per turn must answer from that same read, or the list and the
17
+ * behavior diverge. `[]` is a complete answer, not a missing one; a definition the implementation
18
+ * cannot read at all is a deployment fault and MAY reject. */
19
+ commands(): Promise<AgentCommand[]>;
12
20
  state(session: string): Promise<SessionState>;
13
21
  /** `since` is an APPEND-ORDER position cursor: "every record appended after the one with this
14
22
  * id", regardless of branch structure. Reconstructing the active path in a branched session is
@@ -53,6 +61,18 @@ export interface SessionCapabilities {
53
61
  toolProgress: boolean;
54
62
  usage: boolean;
55
63
  }
64
+ /**
65
+ * One name a client can offer the user. Field NAMES follow pi's RPC `get_commands` so a client
66
+ * porting from it maps directly; its `sourceInfo` (file provenance) is deliberately not carried, and
67
+ * `source` is a free-form string rather than pi's closed union — which kinds exist is an engine's
68
+ * business ("skill" is the only one fastagent assembles today), and an engine with none answers `[]`
69
+ * rather than the contract enumerating a set it cannot know.
70
+ */
71
+ export interface AgentCommand {
72
+ name: string;
73
+ description?: string;
74
+ source: string;
75
+ }
56
76
  /** Stable `SessionResult.error.code` for a command the implementation does not support. */
57
77
  export declare const UNSUPPORTED_CAPABILITY_CODE = "unsupported_capability";
58
78
  /** Stable `SessionResult.error.code` for a run-modulating command (`steer`/`follow_up`/`abort`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastagent-sh/fastagent",
3
- "version": "0.16.2",
3
+ "version": "0.17.1",
4
4
  "description": "Vibe first. Then FastAgent: turn a local agent directory into a live service in your app, on GitHub, Telegram, Slack, or behind any channel.",
5
5
  "keywords": [
6
6
  "agent",