@peer-agent/protocol 0.1.0-beta.3 → 0.1.0-beta.4

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.
@@ -4,7 +4,8 @@
4
4
  */
5
5
  import type { ModelSelectionSnapshot } from './model-routing.ts';
6
6
  import { type GoalPlanProjectionSnapshot, type TaskOverviewItem } from './task-overview.ts';
7
- export type WorkSessionStatus = 'queued' | 'starting' | 'running' | 'waiting_user' | 'verifying' | 'result_ready' | 'accepted' | 'failed' | 'cancelled' | 'superseded';
7
+ export type WorkSessionStatus = 'paused' | 'queued' | 'starting' | 'running' | 'waiting_user' | 'verifying' | 'result_ready' | 'accepted' | 'failed' | 'cancelled' | 'superseded';
8
+ export declare const WORK_SESSION_STATUSES: readonly ["paused", "queued", "starting", "running", "waiting_user", "verifying", "result_ready", "accepted", "failed", "cancelled", "superseded"];
8
9
  export type InputSurface = 'desktop' | 'quick_chat' | 'tui' | 'remote';
9
10
  export interface DelegationOrigin {
10
11
  readonly anchorMessageId: string;
@@ -12,11 +13,28 @@ export interface DelegationOrigin {
12
13
  readonly surface: InputSurface;
13
14
  readonly memorySnapshotId: string;
14
15
  readonly objectiveId?: string;
16
+ readonly objectiveActionId?: string;
17
+ readonly priority?: 'high' | 'normal' | 'low';
18
+ readonly isolation?: 'auto' | 'none' | 'worktree';
19
+ readonly isolationBlock?: 'disk_space' | 'isolation_failed' | null;
20
+ readonly isolationRetainedAt?: string;
21
+ readonly supersededBy?: string;
22
+ readonly supersededAt?: string;
23
+ readonly lastResumeAnchorMessageId?: string;
24
+ readonly handoffAuthorizedAt?: string;
25
+ readonly handoffDeferredAt?: string;
15
26
  readonly modelSelection: ModelSelectionSnapshot;
16
27
  readonly parentSessionId?: string;
17
28
  readonly depth: number;
18
29
  }
19
- export interface WorkSessionConversationMeta {
30
+ export interface SessionQueueFacts {
31
+ readonly queuedBehind?: readonly {
32
+ readonly sessionId: string;
33
+ readonly title: string;
34
+ }[];
35
+ readonly queueReason?: 'dependencies' | 'dependency_missing' | 'dependency_failed' | 'read_slot' | 'write_slot' | 'disk_space' | 'isolation_failed' | null;
36
+ }
37
+ export interface WorkSessionConversationMeta extends SessionQueueFacts {
20
38
  readonly sessionId?: string;
21
39
  readonly conversationId?: string;
22
40
  readonly workspaceId: string;
@@ -26,9 +44,9 @@ export interface WorkSessionConversationMeta {
26
44
  readonly acceptance?: 'auto' | 'confirm';
27
45
  readonly accepted?: boolean;
28
46
  readonly verifying?: boolean;
29
- readonly phase?: 'starting' | 'verifying';
47
+ readonly phase?: 'starting' | 'verifying' | 'paused';
30
48
  }
31
- export interface WorkSession {
49
+ export interface WorkSession extends SessionQueueFacts {
32
50
  readonly sessionId: string;
33
51
  readonly workspaceId: string;
34
52
  readonly title: string;
@@ -62,18 +80,30 @@ export type JsonValue = null | string | number | boolean | readonly JsonValue[]
62
80
  export interface DelegationEvent {
63
81
  readonly eventId: string;
64
82
  readonly kind: DelegationEventKind;
65
- readonly sessionId: string;
83
+ readonly sessionId?: string;
84
+ readonly workspaceId?: string;
85
+ readonly objectiveId?: string;
86
+ readonly watchId?: string;
87
+ readonly executionKey?: string;
66
88
  readonly at: string;
67
89
  readonly payload: JsonValue;
68
90
  }
69
91
  export interface AgentReplyMeta {
92
+ /** Host generated factual delivery keys; model input cannot set them. */
93
+ readonly reportFactKeys?: readonly string[];
70
94
  readonly replyTo: readonly string[];
71
95
  readonly sources: readonly string[];
72
96
  readonly verdictRef?: string;
97
+ /** Host snapshot; accepted only when resultAcceptance has been persisted. */
98
+ readonly sessionStates?: readonly ReplySessionState[];
73
99
  readonly memoryUsed: readonly string[];
74
100
  readonly memoryLearned: readonly string[];
75
101
  readonly surfacing: 'interrupt' | 'message' | 'digest' | 'silent';
76
102
  }
103
+ export interface ReplySessionState {
104
+ readonly sessionId: string;
105
+ readonly status: WorkSessionStatus;
106
+ }
77
107
  export type MessageDisposition = {
78
108
  readonly kind: 'answered';
79
109
  readonly messageId: string;
@@ -3,6 +3,8 @@
3
3
  * The user-visible conclusion of a work session is projectGoalPlan's conclusion.
4
4
  */
5
5
  import { projectGoalPlan, } from "./task-overview.js";
6
+ export const WORK_SESSION_STATUSES = ['paused', 'queued', 'starting', 'running', 'waiting_user', 'verifying',
7
+ 'result_ready', 'accepted', 'failed', 'cancelled', 'superseded'];
6
8
  function fnv1a(text) {
7
9
  let hash = 0x811c9dc5;
8
10
  for (let index = 0; index < text.length; index += 1) {
@@ -42,8 +44,6 @@ export function createDelegationEvent(input) {
42
44
  };
43
45
  }
44
46
  function delegationStatus(snapshot, meta, projected) {
45
- if (meta.supersededBy)
46
- return 'superseded';
47
47
  if (snapshot.status === 'failed')
48
48
  return 'failed';
49
49
  if (snapshot.status === 'cancelled')
@@ -55,6 +55,10 @@ function delegationStatus(snapshot, meta, projected) {
55
55
  return 'result_ready';
56
56
  return 'accepted';
57
57
  }
58
+ if (meta.supersededBy)
59
+ return 'superseded';
60
+ if (meta.phase === 'paused')
61
+ return 'paused';
58
62
  // 复核进行中盖过「需要你」。草稿、待批准、等回答的计划在独立复核时都显示 verifying。
59
63
  if (meta.verifying || meta.phase === 'verifying')
60
64
  return 'verifying';
@@ -93,6 +97,8 @@ export function projectWorkSession(plan, conversationMeta) {
93
97
  spawnedAt: conversationMeta.spawnedAt ?? plan.updatedAt ?? '',
94
98
  ...(conversationMeta.conversationId ? { conversationId: conversationMeta.conversationId } : {}),
95
99
  origin: conversationMeta.origin,
100
+ ...(conversationMeta.queuedBehind ? { queuedBehind: conversationMeta.queuedBehind.map(item => ({ ...item })) } : {}),
101
+ ...(conversationMeta.queueReason ? { queueReason: conversationMeta.queueReason } : {}),
96
102
  ...(conversationMeta.supersededBy ? { supersededBy: conversationMeta.supersededBy } : {}),
97
103
  };
98
104
  }
package/dist/goal.d.ts CHANGED
@@ -164,6 +164,12 @@ export interface EvidenceIndexRecord {
164
164
  readonly toolName?: string;
165
165
  readonly createdAt: string;
166
166
  readonly artifactRefs?: readonly string[];
167
+ /** Redacted, bounded execution-time snapshot of a successful file Tool Result. */
168
+ readonly bodyPreview?: {
169
+ readonly kind: 'file';
170
+ readonly text: string;
171
+ readonly truncated: boolean;
172
+ };
167
173
  }
168
174
  /** 批准事实(Evidence)。 */
169
175
  export interface GoalApproval {
package/dist/memory.d.ts CHANGED
@@ -5,7 +5,21 @@ import type { MessageDisposition } from './delegation.ts';
5
5
  export type MemoryKind = 'fact' | 'preference' | 'decision' | 'procedure' | 'responsibility';
6
6
  export type MemoryTrust = 'verified' | 'stated' | 'inferred';
7
7
  export type MemoryStatus = 'active' | 'forgotten' | 'expired' | 'conflicted';
8
- export interface MemoryItem {
8
+ export interface MemoryValidityFields {
9
+ readonly expiresAt?: string;
10
+ readonly topicKey?: string;
11
+ readonly topicValue?: string;
12
+ readonly conflictId?: string;
13
+ readonly conflictsWith?: readonly string[];
14
+ readonly supersededBy?: string;
15
+ readonly needsReverify?: boolean;
16
+ readonly fileAnchors?: readonly {
17
+ readonly path: string;
18
+ readonly contentHash: string;
19
+ readonly commit: string | null;
20
+ }[];
21
+ }
22
+ export interface MemoryItem extends MemoryValidityFields {
9
23
  readonly id: string;
10
24
  readonly scope: 'project' | 'user';
11
25
  readonly workspaceId?: string;
@@ -37,7 +51,7 @@ export interface MemorySnapshot {
37
51
  readonly createdAt: string;
38
52
  }
39
53
  /** 记忆页跨进程载荷。渲染层不读存储。 */
40
- export interface ProjectMemoryRecord {
54
+ export interface ProjectMemoryRecord extends MemoryValidityFields {
41
55
  readonly id: string;
42
56
  readonly scope: 'project' | 'user';
43
57
  readonly workspaceId?: string;
@@ -85,6 +99,7 @@ export interface ProjectMemoryForgetRequest {
85
99
  export interface ProjectMemoryRestoreRequest {
86
100
  readonly workspaceId: string;
87
101
  readonly id: string;
102
+ readonly resolveConflict?: boolean;
88
103
  }
89
104
  export interface ProjectMemoryEditRequest {
90
105
  readonly workspaceId: string;
package/dist/memory.js CHANGED
@@ -15,6 +15,8 @@ export function assessMemoryCandidate(item, options = {}) {
15
15
  }
16
16
  if (item.status === 'conflicted')
17
17
  return { ok: false, reason: 'conflicted' };
18
+ if (item.needsReverify === true)
19
+ return { ok: false, reason: 'needs_reverify' };
18
20
  if (SECRET.test(item.text))
19
21
  return { ok: false, reason: 'sensitive' };
20
22
  if (LOOSENING.test(item.text))
@@ -53,6 +53,35 @@ export interface ModelSelectionSnapshot {
53
53
  readonly autoReason?: string;
54
54
  readonly resolvedAt: string;
55
55
  }
56
+ /** Model row shown in the routing menu. Shared by main projection and the renderer. */
57
+ export interface ModelRoutingMenuOption {
58
+ readonly id: string;
59
+ readonly label: string;
60
+ readonly providerName: string;
61
+ readonly groupId: string;
62
+ readonly model: string;
63
+ readonly authMethod: string;
64
+ readonly supportsVision: boolean;
65
+ readonly supportsTools: boolean;
66
+ readonly supportsStructured: boolean;
67
+ readonly contextTokens: number;
68
+ }
69
+ /** Project one configured provider into the routing menu contract. */
70
+ export declare function projectModelRoutingMenuOption(provider: {
71
+ readonly id?: unknown;
72
+ readonly groupId?: unknown;
73
+ readonly name?: unknown;
74
+ readonly model?: unknown;
75
+ readonly modelLabel?: unknown;
76
+ readonly authMethod?: unknown;
77
+ readonly supportsVision?: unknown;
78
+ readonly supportsTools?: unknown;
79
+ readonly supportsStructured?: unknown;
80
+ readonly capabilities?: {
81
+ readonly toolUse?: unknown;
82
+ } | null;
83
+ readonly contextWindow?: unknown;
84
+ } | null | undefined): ModelRoutingMenuOption | null;
56
85
  export interface CatalogModel {
57
86
  readonly modelProviderId: string;
58
87
  readonly providerId: string;
@@ -2,6 +2,30 @@
2
2
  * Role and tier model routing. Resolution is pure; hosts apply the result.
3
3
  * Order and filters follow ADR 83. An empty candidate set is an error, not a silent downgrade.
4
4
  */
5
+ /** Project one configured provider into the routing menu contract. */
6
+ export function projectModelRoutingMenuOption(provider) {
7
+ if (!provider || typeof provider.id !== 'string' || !provider.id.trim())
8
+ return null;
9
+ const id = provider.id.trim();
10
+ const groupId = typeof provider.groupId === 'string' && provider.groupId.trim()
11
+ ? provider.groupId.trim()
12
+ : id;
13
+ const label = [provider.modelLabel, provider.model, provider.name, id]
14
+ .find((value) => typeof value === 'string' && value.trim());
15
+ const context = Number(provider.contextWindow);
16
+ return {
17
+ id,
18
+ label: typeof label === 'string' ? label.trim() : id,
19
+ providerName: typeof provider.name === 'string' ? provider.name.trim() : '',
20
+ groupId,
21
+ model: typeof provider.model === 'string' ? provider.model.trim() : '',
22
+ authMethod: typeof provider.authMethod === 'string' ? provider.authMethod.trim() : '',
23
+ supportsVision: provider.supportsVision === true,
24
+ supportsTools: provider.supportsTools !== false && provider.capabilities?.toolUse !== false,
25
+ supportsStructured: provider.supportsStructured !== false,
26
+ contextTokens: Number.isFinite(context) && context > 0 ? context : 128_000,
27
+ };
28
+ }
5
29
  const EXPLORER_MIN_CONTEXT = 8_000;
6
30
  function roleNeeds(input) {
7
31
  const context = input.requiredContextTokens ?? 0;
@@ -1,13 +1,75 @@
1
- /** Project objectives and watch observations. Types only, plus digest comparison. */
1
+ import type { AutomationSchedule } from './automation.ts';
2
2
  export type ObjectiveAutonomy = 'report_only' | 'propose' | 'act';
3
- export type WatchTrigger = 'schedule' | 'git' | 'file' | 'ci';
4
3
  export type ObjectiveStatus = 'active' | 'paused' | 'achieved' | 'abandoned';
5
- export interface ObjectiveWatch {
4
+ export type WatchSeverity = 'info' | 'notable' | 'urgent';
5
+ export type ObjectiveProbe = {
6
+ readonly type: 'deterministic';
7
+ readonly check: 'git_ref';
8
+ readonly spec: {
9
+ readonly ref: string;
10
+ };
11
+ } | {
12
+ readonly type: 'deterministic';
13
+ readonly check: 'file_hash';
14
+ readonly spec: {
15
+ readonly path: string;
16
+ };
17
+ } | {
18
+ readonly type: 'deterministic';
19
+ readonly check: 'command';
20
+ readonly spec: {
21
+ readonly command: 'gh_run_list';
22
+ readonly workflow?: string;
23
+ };
24
+ } | {
25
+ readonly type: 'agent';
26
+ readonly question: string;
27
+ };
28
+ export type WatchEventSource = {
29
+ readonly type: 'task_event';
30
+ readonly filter: 'failed' | 'ended' | 'verified';
31
+ } | {
32
+ readonly type: 'git';
33
+ readonly ref: string;
34
+ readonly on: 'new_commits' | 'new_tag';
35
+ } | {
36
+ readonly type: 'files';
37
+ readonly paths: readonly string[];
38
+ readonly debounceMs?: 5000;
39
+ };
40
+ export type ObjectiveWatch = ({
41
+ readonly watchId: string;
42
+ readonly kind: 'schedule';
43
+ readonly schedule: AutomationSchedule;
44
+ readonly probe: ObjectiveProbe;
45
+ } | {
6
46
  readonly watchId: string;
7
- readonly trigger: WatchTrigger;
8
- readonly schedule?: string;
9
- readonly ref?: string;
10
- readonly paths?: readonly string[];
47
+ readonly kind: 'event';
48
+ readonly source: WatchEventSource;
49
+ readonly probe?: ObjectiveProbe;
50
+ }) & {
51
+ readonly notificationPolicy?: 'changes' | 'failure_only';
52
+ readonly lastScheduledAt?: string;
53
+ readonly nextRunAt?: string;
54
+ readonly unavailableReason?: string;
55
+ };
56
+ export interface ObjectiveSignal {
57
+ readonly signalId: string;
58
+ readonly watchId: string;
59
+ readonly operator: 'equals' | 'contains' | 'succeeded';
60
+ readonly value?: string;
61
+ }
62
+ export interface ObjectiveMilestone {
63
+ readonly id: string;
64
+ readonly title: string;
65
+ readonly sessionIds: readonly string[];
66
+ readonly status: 'pending' | 'active' | 'done' | 'dropped';
67
+ }
68
+ export interface ObjectiveBudget {
69
+ readonly maxAutoSessionsPerDay: number;
70
+ readonly maxProbeRunsPerDay: number;
71
+ /** Reject this optional policy until the host can enforce a token hard limit. */
72
+ readonly maxTokensPerDay?: number;
11
73
  }
12
74
  export interface ProjectObjective {
13
75
  readonly objectiveId: string;
@@ -16,15 +78,21 @@ export interface ProjectObjective {
16
78
  readonly originMessageId: string;
17
79
  readonly title: string;
18
80
  readonly outcome: string;
81
+ readonly successSignals: readonly ObjectiveSignal[];
82
+ readonly milestones: readonly ObjectiveMilestone[];
19
83
  readonly autonomy: ObjectiveAutonomy;
20
84
  readonly watches: readonly ObjectiveWatch[];
85
+ readonly budget: ObjectiveBudget;
21
86
  readonly status: ObjectiveStatus;
22
87
  readonly createdBy: 'user_request' | 'agent_proposal';
88
+ readonly pendingConfirmation?: boolean;
89
+ readonly autoAccept?: boolean;
90
+ readonly autoAcceptApprovedBy?: string;
23
91
  readonly deadline?: string;
24
92
  readonly createdAt: string;
25
93
  readonly updatedAt: string;
94
+ readonly version: number;
26
95
  }
27
- export type WatchSeverity = 'info' | 'notable' | 'urgent';
28
96
  export interface WatchObservation {
29
97
  readonly objectiveId: string;
30
98
  readonly watchId: string;
@@ -34,8 +102,40 @@ export interface WatchObservation {
34
102
  readonly evidenceRefs: readonly string[];
35
103
  readonly severity: WatchSeverity;
36
104
  readonly changed: boolean;
105
+ readonly succeeded?: boolean;
106
+ readonly value?: string;
107
+ readonly executionKey?: string;
108
+ }
109
+ export interface ProjectObjectiveListRequest {
110
+ readonly workspaceId: string;
111
+ }
112
+ export interface ProjectObjectiveCommandRequest extends ProjectObjectiveListRequest {
113
+ readonly objectiveId: string;
114
+ readonly requestId: string;
115
+ }
116
+ export interface ProjectObjectiveUpdateRequest extends ProjectObjectiveCommandRequest {
117
+ readonly patch: Partial<Pick<ProjectObjective, 'title' | 'outcome' | 'watches' | 'milestones' | 'successSignals' | 'autonomy' | 'budget' | 'deadline' | 'autoAccept'>>;
118
+ readonly expectedVersion?: number;
119
+ }
120
+ export interface ProjectObjectiveView extends ProjectObjective {
121
+ readonly lastObservation?: WatchObservation | null;
122
+ readonly usage?: {
123
+ readonly autoSessions: number;
124
+ readonly probes: number;
125
+ readonly date: string;
126
+ };
127
+ }
128
+ export interface ProjectObjectiveListResult {
129
+ readonly ok: boolean;
130
+ readonly code?: string;
131
+ readonly items?: readonly ProjectObjectiveView[];
132
+ }
133
+ export interface ProjectObjectiveItemResult {
134
+ readonly ok: boolean;
135
+ readonly code?: string;
136
+ readonly item?: ProjectObjective;
37
137
  }
38
- /** A watch reports upward only when its digest changes. The first observation counts as a change. */
138
+ /** The first observation is a change; summaries and caller flags cannot override digest truth. */
39
139
  export declare function diffWatchObservation(prev: WatchObservation | null | undefined, next: Omit<WatchObservation, 'changed'> & {
40
140
  readonly changed?: boolean;
41
141
  }): WatchObservation;
@@ -1,15 +1,6 @@
1
- /** Project objectives and watch observations. Types only, plus digest comparison. */
2
- /** A watch reports upward only when its digest changes. The first observation counts as a change. */
1
+ /** The first observation is a change; summaries and caller flags cannot override digest truth. */
3
2
  export function diffWatchObservation(prev, next) {
4
- const changed = !prev || prev.digest !== next.digest;
5
- return {
6
- objectiveId: next.objectiveId,
7
- watchId: next.watchId,
8
- observedAt: next.observedAt,
9
- digest: next.digest,
10
- summary: next.summary,
11
- evidenceRefs: next.evidenceRefs,
12
- severity: next.severity,
13
- changed,
14
- };
3
+ return { objectiveId: next.objectiveId, watchId: next.watchId, observedAt: next.observedAt, digest: next.digest, summary: next.summary,
4
+ evidenceRefs: next.evidenceRefs, severity: next.severity, changed: !prev || prev.digest !== next.digest,
5
+ ...(typeof next.succeeded === 'boolean' ? { succeeded: next.succeeded } : {}), ...(typeof next.value === 'string' ? { value: next.value } : {}) };
15
6
  }
package/dist/project.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Bot list projection. Sort is recent activity only.
3
3
  * needsYou changes the badge and the filter, not the order.
4
4
  */
5
+ import type { ProjectModelPolicy } from './model-routing.ts';
5
6
  import type { PendingApprovalState, WorkSessionStatus } from './delegation.ts';
6
7
  export interface ProjectRegistryEntry {
7
8
  readonly workspaceId: string;
@@ -15,10 +16,18 @@ export type BotAvatar = {
15
16
  readonly kind: 'generated';
16
17
  readonly shape: string;
17
18
  readonly color: string;
19
+ readonly variant?: number;
18
20
  } | {
19
21
  readonly kind: 'image';
20
22
  readonly ref: string;
21
23
  };
24
+ export type BotAvatarReadResult = {
25
+ readonly ok: true;
26
+ readonly dataUrl: string;
27
+ } | {
28
+ readonly ok: false;
29
+ readonly code: 'PROJECT_AGENT_DISABLED' | 'NOT_FOUND' | 'INVALID_IMAGE';
30
+ };
22
31
  export interface BotProfile {
23
32
  readonly workspaceId: string;
24
33
  readonly displayName: string;
@@ -28,12 +37,25 @@ export interface BotProfile {
28
37
  readonly proactivity?: 'inherit' | 'quiet' | 'low' | 'standard' | 'high' | 'muted';
29
38
  /** Absent means this bot uses memory. */
30
39
  readonly memoryEnabled?: boolean;
40
+ readonly planApproval?: 'never' | 'writes' | 'always';
41
+ readonly acceptancePolicy?: 'auto' | 'confirm';
42
+ /** Policy acceptance keeps a separate merge confirmation unless explicitly enabled. */
43
+ readonly autoHandoffOnPolicyAccept?: boolean;
44
+ /** Archived deletion intent, retained until each cleanup step is persisted. */
45
+ readonly deletionCleanup?: {
46
+ readonly folder: string;
47
+ readonly trashPending: boolean;
48
+ readonly removePending: boolean;
49
+ } | null;
50
+ readonly modelPolicy?: ProjectModelPolicy | null;
31
51
  readonly updatedAt?: string;
32
52
  }
33
53
  export interface BotRowState {
34
54
  readonly needsYou: number;
35
55
  readonly unread: number;
36
56
  readonly running: number;
57
+ /** Ephemeral status of the runner hosted by this desktop process. */
58
+ readonly agentStatus?: 'idle' | 'thinking' | 'waiting_provider' | 'error';
37
59
  }
38
60
  export interface BotListItem {
39
61
  readonly workspaceId: string;
@@ -61,8 +83,10 @@ export interface BotListMessage {
61
83
  readonly countUnread?: boolean;
62
84
  }
63
85
  export declare const BOT_AVATAR_SHAPES: readonly ["circle", "square", "triangle", "diamond", "hex", "pill", "star", "arch"];
64
- export declare const BOT_AVATAR_COLORS: readonly ["#2563eb", "#dc2626", "#d97706", "#059669", "#7c3aed", "#db2777", "#0891b2", "#4b5563"];
65
- export declare function generateAvatar(workspaceId: string): BotAvatar;
86
+ export declare const BOT_AVATAR_COLORS: readonly ["#6474e5", "#f36d63", "#f4ad45", "#61b68c", "#a884e5", "#e774ad", "#55bac7", "#a8a59f"];
87
+ export declare function generateAvatar(workspaceId: string): Extract<BotAvatar, {
88
+ kind: 'generated';
89
+ }>;
66
90
  export declare function projectBotListItem(input: {
67
91
  readonly profile: BotProfile;
68
92
  readonly lastMessage?: BotListMessage | null;
package/dist/project.js CHANGED
@@ -13,14 +13,14 @@ export const BOT_AVATAR_SHAPES = [
13
13
  'arch',
14
14
  ];
15
15
  export const BOT_AVATAR_COLORS = [
16
- '#2563eb',
17
- '#dc2626',
18
- '#d97706',
19
- '#059669',
20
- '#7c3aed',
21
- '#db2777',
22
- '#0891b2',
23
- '#4b5563',
16
+ '#6474e5',
17
+ '#f36d63',
18
+ '#f4ad45',
19
+ '#61b68c',
20
+ '#a884e5',
21
+ '#e774ad',
22
+ '#55bac7',
23
+ '#a8a59f',
24
24
  ];
25
25
  const NEEDS_YOU_STATUSES = new Set(['waiting_user', 'result_ready']);
26
26
  const RUNNING_STATUSES = new Set(['starting', 'running', 'verifying']);
@@ -36,7 +36,8 @@ export function generateAvatar(workspaceId) {
36
36
  const hash = fnv1a(workspaceId);
37
37
  const shape = BOT_AVATAR_SHAPES[hash % BOT_AVATAR_SHAPES.length] ?? BOT_AVATAR_SHAPES[0];
38
38
  const color = BOT_AVATAR_COLORS[(hash >>> 16) % BOT_AVATAR_COLORS.length] ?? BOT_AVATAR_COLORS[0];
39
- return { kind: 'generated', shape, color };
39
+ const variant = (hash >>> 8) % 32;
40
+ return { kind: 'generated', shape, color, variant };
40
41
  }
41
42
  function latestIso(values) {
42
43
  let best = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/protocol",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "Shared host-neutral protocol contracts for Peer Agent runtimes and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",