Skip to content

Commit 2617cf2

Browse files
yanekyukclaude
andcommitted
refactor!: retire the legacy orchestrator chat persona
Remove the pre-personafication default chat persona. Every H2A chat turn is now driven by a persona named explicitly at its surface; there is no default to fall back on, and unknown values fail closed. Production evidence: the orchestrator has written no new session since 2026-08-04, and the presence of `onboarding`-persona rows proves the Signal cutover flag is already on. This removes code for a persona that stopped being written before the branch was cut; the 9,464 historical orchestrator conversations stay readable. BREAKING CHANGE: ORCHESTRATOR_PERSONA_ID / ORCHESTRATOR_PERSONA are gone from @indexnetwork/protocol, ChatGraphFactory and ChatAgent.create() now require a persona, POST /api/chat/message is removed, WEB_SIGNAL_AGENT_ENABLED is deleted, and API-key callers must name a persona on /chat/stream. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 3917476 commit 2617cf2

17 files changed

Lines changed: 67 additions & 798 deletions

npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indexnetwork/cli-darwin-arm64",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Platform-specific binary for @indexnetwork/cli (macOS arm64)",
55
"license": "MIT",
66
"os": [

npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indexnetwork/cli-darwin-x64",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Platform-specific binary for @indexnetwork/cli (macOS x64)",
55
"license": "MIT",
66
"os": [

npm/linux-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indexnetwork/cli-linux-arm64",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Platform-specific binary for @indexnetwork/cli (Linux arm64)",
55
"license": "MIT",
66
"os": [

npm/linux-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indexnetwork/cli-linux-x64",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Platform-specific binary for @indexnetwork/cli (Linux x64)",
55
"license": "MIT",
66
"os": [

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@indexnetwork/cli",
3-
"version": "0.14.0",
3+
"version": "0.15.0",
44
"description": "Command-line interface for Index Network",
55
"license": "MIT",
66
"type": "module",
@@ -20,10 +20,10 @@
2020
"publish:all": "bun scripts/publish.ts"
2121
},
2222
"optionalDependencies": {
23-
"@indexnetwork/cli-linux-x64": "0.14.0",
24-
"@indexnetwork/cli-linux-arm64": "0.14.0",
25-
"@indexnetwork/cli-darwin-x64": "0.14.0",
26-
"@indexnetwork/cli-darwin-arm64": "0.14.0"
23+
"@indexnetwork/cli-linux-x64": "0.15.0",
24+
"@indexnetwork/cli-linux-arm64": "0.15.0",
25+
"@indexnetwork/cli-darwin-x64": "0.15.0",
26+
"@indexnetwork/cli-darwin-arm64": "0.15.0"
2727
},
2828
"devDependencies": {
2929
"@types/bun": "1.3.14"

src/api.client.ts

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* common error patterns (401, network errors).
66
*/
77

8-
import type { ChatSession, UserProfile, StreamChatParams, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityDetail, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, Conversation, ConversationMessage, Negotiation, NegotiationListOptions, EnrichmentResult, ToolResult } from "./types";
8+
import type { UserProfile, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityDetail, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, Conversation, ConversationMessage, Negotiation, NegotiationListOptions, EnrichmentResult, ToolResult } from "./types";
99

1010
// Re-export all types for backward compatibility
11-
export type { ChatSession, UserProfile, StreamChatParams, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityActor, OpportunityInterpretation, OpportunityDetection, OpportunityDetail, OpportunityParty, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, ConversationParticipant, Conversation, MessagePart, ConversationMessage, Negotiation, NegotiationListOptions, NegotiationSpeaker, NegotiationTurn, NegotiationOutcome, EnrichedProfile, EnrichmentResult, ToolResult } from "./types";
11+
export type { UserProfile, UserData, Intent, ListIntentsOptions, IntentListResult, OpportunityListOptions, Opportunity, OpportunityActor, OpportunityInterpretation, OpportunityDetection, OpportunityDetail, OpportunityParty, Network, NetworkMember, NetworkRequest, NetworkCreateResult, NetworkInvitationResult, ConversationParticipant, Conversation, MessagePart, ConversationMessage, Negotiation, NegotiationListOptions, NegotiationSpeaker, NegotiationTurn, NegotiationOutcome, EnrichedProfile, EnrichmentResult, ToolResult } from "./types";
1212

1313
export interface UptakeQuestion {
1414
id: string;
@@ -64,18 +64,6 @@ export class ApiClient {
6464
return { "x-api-key": this.token };
6565
}
6666

67-
/**
68-
* List all chat sessions for the authenticated user.
69-
*
70-
* @returns Array of session objects.
71-
* @throws Error on auth failure or network error.
72-
*/
73-
async listSessions(): Promise<ChatSession[]> {
74-
const res = await this.get("/api/chat/sessions");
75-
const body = (await res.json()) as { sessions: ChatSession[] };
76-
return body.sessions;
77-
}
78-
7967
/**
8068
* Revoke one exact server-issued CLI API key with caller and target proof.
8169
*
@@ -161,36 +149,6 @@ export class ApiClient {
161149
return await res.json() as Record<string, unknown>;
162150
}
163151

164-
/**
165-
* Open an SSE stream to the chat endpoint.
166-
*
167-
* Returns the raw Response so the caller can read the body
168-
* as a stream and parse SSE events incrementally.
169-
*
170-
* @param params - Stream parameters (message, optional sessionId).
171-
* @returns The raw fetch Response with SSE body.
172-
* @throws Error on auth failure or network error.
173-
*/
174-
async streamChat(params: StreamChatParams): Promise<Response> {
175-
const res = await fetch(`${this.baseUrl}/api/chat/stream`, {
176-
method: "POST",
177-
headers: {
178-
"Content-Type": "application/json",
179-
...this.authHeaders(),
180-
},
181-
body: JSON.stringify({
182-
message: params.message,
183-
...(params.sessionId ? { sessionId: params.sessionId } : {}),
184-
}),
185-
});
186-
187-
if (!res.ok) {
188-
await this.handleError(res);
189-
}
190-
191-
return res;
192-
}
193-
194152
/**
195153
* List intents with optional pagination and filters.
196154
*

src/args.parser.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
*/
77
export interface ParsedCommand {
88
command: "login" | "logout" | "profile" | "intent" | "opportunity" | "negotiation" | "network" | "conversation" | "contact" | "scrape" | "onboarding" | "sync" | "help" | "version" | "unknown";
9-
/** One-shot message for conversation command (H2A agent chat). */
10-
message?: string;
11-
/** Resume a specific chat session (--session flag). */
12-
sessionId?: string;
13-
/** @deprecated Unused — sessions are listed via 'conversation sessions' subcommand. */
9+
/** @deprecated Unused. */
1410
list: boolean;
1511
/** Override the API base URL. */
1612
apiUrl?: string;
@@ -19,7 +15,7 @@ export interface ParsedCommand {
1915
/** The unrecognized command string (when command === "unknown"). */
2016
unknown?: string;
2117
/** Subcommand for multi-level commands (profile, intent, opportunity, network, conversation). */
22-
subcommand?: "show" | "sync" | "list" | "create" | "archive" | "accept" | "reject" | "join" | "leave" | "invite" | "with" | "send" | "stream" | "sessions" | "help" | "update" | "delete" | "link" | "unlink" | "links" | "search" | "add" | "remove" | "import" | "complete";
18+
subcommand?: "show" | "sync" | "list" | "create" | "archive" | "accept" | "reject" | "join" | "leave" | "invite" | "with" | "send" | "stream" | "help" | "update" | "delete" | "link" | "unlink" | "links" | "search" | "add" | "remove" | "import" | "complete";
2319
/** Target user ID for `profile show <user-id>`. */
2420
userId?: string;
2521
/** Intent ID for show/archive subcommands. */
@@ -70,7 +66,7 @@ const NEGOTIATION_SUBCOMMANDS = new Set(["list", "show"]);
7066

7167
const NETWORK_SUBCOMMANDS = new Set(["list", "create", "show", "join", "leave", "invite", "update", "delete"]);
7268

73-
const CONVERSATION_SUBCOMMANDS = new Set(["list", "with", "show", "send", "stream", "sessions", "help"]);
69+
const CONVERSATION_SUBCOMMANDS = new Set(["list", "with", "show", "send", "stream", "help"]);
7470

7571
/**
7672
* Parse raw CLI arguments into a structured command object.
@@ -138,7 +134,8 @@ export function parseArgs(args: string[]): ParsedCommand {
138134
result.list = true;
139135
i++;
140136
} else if (arg === "--session" || arg === "-s") {
141-
result.sessionId = args[i + 1];
137+
// Retired with the CLI agent-chat surface; consume the value so the
138+
// flag does not leak into positionals for older scripts.
142139
i += 2;
143140
} else if (arg === "--api-url") {
144141
result.apiUrl = args[i + 1];
@@ -293,15 +290,12 @@ export function parseArgs(args: string[]): ParsedCommand {
293290
}
294291

295292
// Conversation command: first positional is subcommand, rest are args.
296-
// If the first positional is not a known subcommand, treat all positionals
297-
// as a one-shot message to the AI agent.
293+
// Anything else leaves the subcommand unset, which the handler reports as
294+
// the retired agent-chat surface.
298295
if (result.command === "conversation") {
299296
if (positionals.length > 0 && CONVERSATION_SUBCOMMANDS.has(positionals[0])) {
300297
result.subcommand = positionals[0] as ParsedCommand["subcommand"];
301298
result.positionals = positionals.slice(1);
302-
} else if (positionals.length > 0) {
303-
// Not a known subcommand — treat as one-shot agent message
304-
result.message = positionals.join(" ");
305299
}
306300
}
307301

0 commit comments

Comments
 (0)