@inixiative/agent-session 0.7.0 → 0.8.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/src/pool.ts CHANGED
@@ -217,7 +217,12 @@ export class SubscriptionPool {
217
217
  if (!config.id || this._instances.has(config.id))
218
218
  throw Error(`Duplicate or empty instance id "${config.id}"`);
219
219
  const descriptor = TRANSPORTS[config.transport];
220
- if (descriptor?.status !== 'implemented' || descriptor.runtime === 'external')
220
+ // Muse keeps its login and sessions under two XDG homes, not one profile variable; not pooled yet.
221
+ if (
222
+ descriptor?.status !== 'implemented' ||
223
+ descriptor.runtime === 'external' ||
224
+ descriptor.runtime === 'muse'
225
+ )
221
226
  throw Error(`Instance ${config.id}: transport "${config.transport}" cannot be pooled`);
222
227
  const runtime = descriptor.runtime;
223
228
  const variable = PROFILE_VARIABLE[runtime];
package/src/transport.ts CHANGED
@@ -13,9 +13,15 @@
13
13
  // is declared absent, with a note.
14
14
  // ---------------------------------------------------------------------------
15
15
 
16
- export type TransportKind = 'claude-cli' | 'codex-app-server' | 'claude-agent-sdk' | 'acp' | 'api';
16
+ export type TransportKind =
17
+ | 'claude-cli'
18
+ | 'codex-app-server'
19
+ | 'muse-serve'
20
+ | 'claude-agent-sdk'
21
+ | 'acp'
22
+ | 'api';
17
23
 
18
- export type TransportRuntime = 'claude' | 'codex' | 'external';
24
+ export type TransportRuntime = 'claude' | 'codex' | 'muse' | 'external';
19
25
 
20
26
  export interface TransportCapabilities {
21
27
  /** Continue a thread by native ID in a new process. */
@@ -115,6 +121,35 @@ export const TRANSPORTS: Readonly<Record<TransportKind, TransportDescriptor>> =
115
121
  'Images go to turn/start as `image` inputs with a `data:` URL, after the text.',
116
122
  ],
117
123
  },
124
+ 'muse-serve': {
125
+ kind: 'muse-serve',
126
+ runtime: 'muse',
127
+ status: 'implemented',
128
+ verified: 'live',
129
+ capabilities: {
130
+ resume: 'native',
131
+ fork: 'native',
132
+ rollback: 'none',
133
+ interrupt: 'acknowledged',
134
+ push: 'steer',
135
+ approvals: 'callback',
136
+ usage: true,
137
+ limits: { stream: true, poll: true },
138
+ textOnly: false,
139
+ images: true,
140
+ primed: 'none',
141
+ billing: 'subscription',
142
+ },
143
+ notes: [
144
+ "`muse serve --trust-workspace` (plus `--disable-sandbox` under bypassPermissions) driven through Meta's `@muse-code/sdk` MuseClient, pinned to the installed CLI's version.",
145
+ 'Billing is the saved Muse Code login: metered keys and endpoints (META_, LLM_, MODEL_, LLAMA_, OPENROUTER_, ANTHROPIC_, OPENAI_), Meta auth endpoints (TBH_) and the MUSE_ model, experiment, contributor, approval-judge and fail-open switches are removed from the child environment; a resumed or forked session must report provider `meta`.',
146
+ 'Approvals use an explicit permission profile (`:ask-me` supervised, `:read-only` plan, `:unrestricted` bypass), never the host default `:auto-review`, whose AI reviewer would decide instead of the gates; the committed profile, approval mode and (gated) a human reviewer are read back before any turn.',
147
+ "Work Muse starts itself (cron firings, monitor and background-terminal wakes, goals, reminder agents, workflows, another client's messages) is folded like a turn's and emitted with `unattributedReason: 'task'`, plus a `task` lifecycle typed `muse-cron`, `muse-monitor`, `muse-goal`, `muse-reminder`, `muse-workflow` or `muse-turn`; it is seen only while this host has the session loaded.",
148
+ "interruptNative() sends turn/interrupt; push() sends turn/steer; fork() runs session/fork on the new session's own host; readLimits() sends usage/read.",
149
+ 'userInput/request questions go to onUserInput(); without an answer they are cancelled with a reason, so a turn never waits on them.',
150
+ 'Live-verified (muse 1.4.14): start, profile read-back, multi-stage shell and network approvals, text and tool events, token usage, usage/changed and usage/read (recorded in fixtures/muse); fork, resume with setApprovalMode and sessionNotFound were checked live without a model turn (not recorded). Images, steer, interrupt, questions and Muse-initiated turns follow the SDK wire types without a live run.',
151
+ ],
152
+ },
118
153
  'claude-agent-sdk': {
119
154
  kind: 'claude-agent-sdk',
120
155
  runtime: 'claude',
package/src/transports.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  import { ClaudeCodeSession, type ClaudeCodeSessionConfig } from './claude-code-session';
9
9
  import { CodexAppServerSession, type CodexSessionConfig } from './codex-session';
10
10
  import type { HarnessSession } from './harness-session';
11
+ import { MuseSession, type MuseSessionConfig } from './muse-session';
11
12
  import {
12
13
  TRANSPORTS,
13
14
  type TransportDescriptor,
@@ -37,6 +38,7 @@ export interface ApiSessionConfig {
37
38
  export interface TransportConfigs {
38
39
  'claude-cli': ClaudeCodeSessionConfig;
39
40
  'codex-app-server': CodexSessionConfig;
41
+ 'muse-serve': MuseSessionConfig;
40
42
  'claude-agent-sdk': ClaudeAgentSdkSessionConfig;
41
43
  acp: AcpSessionConfig;
42
44
  api: ApiSessionConfig;
@@ -47,7 +49,7 @@ export class AcpSession {
47
49
  constructor(_config: AcpSessionConfig) {
48
50
  throw new TransportUnavailableError(
49
51
  'acp',
50
- 'no ACP client is implemented in this package; use claude-cli, claude-agent-sdk or codex-app-server',
52
+ 'no ACP client is implemented in this package; use claude-cli, claude-agent-sdk, codex-app-server or muse-serve',
51
53
  );
52
54
  }
53
55
  }
@@ -82,6 +84,8 @@ export function createSession<K extends TransportKind>(
82
84
  return new ClaudeCodeSession(config as ClaudeCodeSessionConfig);
83
85
  case 'codex-app-server':
84
86
  return new CodexAppServerSession(config as CodexSessionConfig);
87
+ case 'muse-serve':
88
+ return new MuseSession(config as MuseSessionConfig);
85
89
  case 'claude-agent-sdk':
86
90
  return new ClaudeAgentSdkSession(config as ClaudeAgentSdkSessionConfig);
87
91
  case 'acp':