@geteigen/cli 0.0.0-stage → 3.1.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/README.md +154 -2
- package/dist/agent.d.ts +32 -0
- package/dist/agent.js +246 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.js +33 -0
- package/dist/cli/src/agent.d.ts +24 -0
- package/dist/cli/src/agent.js +263 -0
- package/dist/cli/src/agentTools.d.ts +6 -0
- package/dist/cli/src/agentTools.js +104 -0
- package/dist/cli/src/auth.d.ts +5 -0
- package/dist/cli/src/auth.js +33 -0
- package/dist/cli/src/cliEnv.d.ts +6 -0
- package/dist/cli/src/cliEnv.js +26 -0
- package/dist/cli/src/config.d.ts +11 -0
- package/dist/cli/src/config.js +51 -0
- package/dist/cli/src/cursorAuth.d.ts +10 -0
- package/dist/cli/src/cursorAuth.js +92 -0
- package/dist/cli/src/gitAuthEnv.d.ts +5 -0
- package/dist/cli/src/gitAuthEnv.js +35 -0
- package/dist/cli/src/index.d.ts +2 -0
- package/dist/cli/src/index.js +244 -0
- package/dist/cli/src/listModels.d.ts +14 -0
- package/dist/cli/src/listModels.js +196 -0
- package/dist/cli/src/listSessions.d.ts +9 -0
- package/dist/cli/src/listSessions.js +37 -0
- package/dist/cli/src/machineConfig.d.ts +20 -0
- package/dist/cli/src/machineConfig.js +66 -0
- package/dist/cli/src/pickFolder.d.ts +5 -0
- package/dist/cli/src/pickFolder.js +65 -0
- package/dist/cli/src/proc.d.ts +31 -0
- package/dist/cli/src/proc.js +97 -0
- package/dist/cli/src/service.d.ts +17 -0
- package/dist/cli/src/service.js +255 -0
- package/dist/cli/src/workRoots.d.ts +30 -0
- package/dist/cli/src/workRoots.js +228 -0
- package/dist/cli/src/worker.d.ts +8 -0
- package/dist/cli/src/worker.js +51 -0
- package/dist/cli/src/workerCore.d.ts +47 -0
- package/dist/cli/src/workerCore.js +721 -0
- package/dist/cli/src/workspace.d.ts +10 -0
- package/dist/cli/src/workspace.js +329 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.js +51 -0
- package/dist/cursorAuth.d.ts +10 -0
- package/dist/cursorAuth.js +95 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +108 -0
- package/dist/listModels.d.ts +6 -0
- package/dist/listModels.js +62 -0
- package/dist/listSessions.d.ts +9 -0
- package/dist/listSessions.js +37 -0
- package/dist/pickFolder.d.ts +5 -0
- package/dist/pickFolder.js +65 -0
- package/dist/shared/actionDrafts.d.ts +83 -0
- package/dist/shared/actionDrafts.js +169 -0
- package/dist/shared/agentArtifacts.d.ts +49 -0
- package/dist/shared/agentArtifacts.js +169 -0
- package/dist/shared/agentLabel.d.ts +18 -0
- package/dist/shared/agentLabel.js +22 -0
- package/dist/shared/agentMentions.d.ts +38 -0
- package/dist/shared/agentMentions.js +110 -0
- package/dist/shared/agentRepos.d.ts +28 -0
- package/dist/shared/agentRepos.js +60 -0
- package/dist/shared/agentRunStatus.d.ts +12 -0
- package/dist/shared/agentRunStatus.js +17 -0
- package/dist/shared/agentUsage.d.ts +24 -0
- package/dist/shared/agentUsage.js +139 -0
- package/dist/shared/approvals.d.ts +44 -0
- package/dist/shared/approvals.js +97 -0
- package/dist/shared/askEigen.d.ts +190 -0
- package/dist/shared/askEigen.js +76 -0
- package/dist/shared/attribution.d.ts +25 -0
- package/dist/shared/attribution.js +63 -0
- package/dist/shared/automations.d.ts +135 -0
- package/dist/shared/automations.js +553 -0
- package/dist/shared/backends/claudeCode.d.ts +44 -0
- package/dist/shared/backends/claudeCode.js +548 -0
- package/dist/shared/backends/codex.d.ts +15 -0
- package/dist/shared/backends/codex.js +287 -0
- package/dist/shared/backends/cursor.d.ts +111 -0
- package/dist/shared/backends/cursor.js +1216 -0
- package/dist/shared/backends/index.d.ts +18 -0
- package/dist/shared/backends/index.js +58 -0
- package/dist/shared/backends/opencode.d.ts +43 -0
- package/dist/shared/backends/opencode.js +415 -0
- package/dist/shared/backends/types.d.ts +171 -0
- package/dist/shared/backends/types.js +19 -0
- package/dist/shared/backends/usage.d.ts +8 -0
- package/dist/shared/backends/usage.js +71 -0
- package/dist/shared/billingPlans.d.ts +60 -0
- package/dist/shared/billingPlans.js +262 -0
- package/dist/shared/brain.d.ts +353 -0
- package/dist/shared/brain.js +487 -0
- package/dist/shared/clarifyingQuestions.d.ts +13 -0
- package/dist/shared/clarifyingQuestions.js +207 -0
- package/dist/shared/claudeModels.d.ts +10 -0
- package/dist/shared/claudeModels.js +52 -0
- package/dist/shared/cloudBackends.d.ts +21 -0
- package/dist/shared/cloudBackends.js +29 -0
- package/dist/shared/codexModels.d.ts +10 -0
- package/dist/shared/codexModels.js +28 -0
- package/dist/shared/contextWindows.d.ts +2 -0
- package/dist/shared/contextWindows.js +30 -0
- package/dist/shared/cursorMcpConfig.d.ts +14 -0
- package/dist/shared/cursorMcpConfig.js +43 -0
- package/dist/shared/cursorProjectMcp.d.ts +10 -0
- package/dist/shared/cursorProjectMcp.js +42 -0
- package/dist/shared/docs.d.ts +59 -0
- package/dist/shared/docs.js +87 -0
- package/dist/shared/events.d.ts +932 -0
- package/dist/shared/events.js +57 -0
- package/dist/shared/integrations.d.ts +266 -0
- package/dist/shared/integrations.js +449 -0
- package/dist/shared/issueTranscript.d.ts +64 -0
- package/dist/shared/issueTranscript.js +387 -0
- package/dist/shared/issues.d.ts +139 -0
- package/dist/shared/issues.js +217 -0
- package/dist/shared/machines.d.ts +119 -0
- package/dist/shared/machines.js +58 -0
- package/dist/shared/markdownMedia.d.ts +13 -0
- package/dist/shared/markdownMedia.js +41 -0
- package/dist/shared/notificationText.d.ts +6 -0
- package/dist/shared/notificationText.js +38 -0
- package/dist/shared/opencodeModels.d.ts +19 -0
- package/dist/shared/opencodeModels.js +62 -0
- package/dist/shared/opencodeSession.d.ts +7 -0
- package/dist/shared/opencodeSession.js +30 -0
- package/dist/shared/orchestration.d.ts +58 -0
- package/dist/shared/orchestration.js +12 -0
- package/dist/shared/orgs.d.ts +47 -0
- package/dist/shared/orgs.js +49 -0
- package/dist/shared/personalOrg.d.ts +5 -0
- package/dist/shared/personalOrg.js +12 -0
- package/dist/shared/plans.d.ts +3 -0
- package/dist/shared/plans.js +19 -0
- package/dist/shared/providerModels.d.ts +40 -0
- package/dist/shared/providerModels.js +503 -0
- package/dist/shared/roomAttention.d.ts +17 -0
- package/dist/shared/roomAttention.js +36 -0
- package/dist/shared/roomContext.d.ts +120 -0
- package/dist/shared/roomContext.js +133 -0
- package/dist/shared/roomPermissions.d.ts +56 -0
- package/dist/shared/roomPermissions.js +133 -0
- package/dist/shared/sessionSeats.d.ts +29 -0
- package/dist/shared/sessionSeats.js +57 -0
- package/dist/shared/slashCommands.d.ts +39 -0
- package/dist/shared/slashCommands.js +166 -0
- package/dist/shared/space.d.ts +33 -0
- package/dist/shared/space.js +54 -0
- package/dist/shared/spaceFeed.d.ts +78 -0
- package/dist/shared/spaceFeed.js +194 -0
- package/dist/shared/stringifyUnknown.d.ts +1 -0
- package/dist/shared/stringifyUnknown.js +1 -0
- package/dist/shared/swarm.d.ts +320 -0
- package/dist/shared/swarm.js +328 -0
- package/dist/shared/swarmVisual.d.ts +79 -0
- package/dist/shared/swarmVisual.js +212 -0
- package/dist/shared/terminalFilter.d.ts +13 -0
- package/dist/shared/terminalFilter.js +46 -0
- package/dist/shared/toolIntegration.d.ts +56 -0
- package/dist/shared/toolIntegration.js +180 -0
- package/dist/shared/typing.d.ts +9 -0
- package/dist/shared/typing.js +37 -0
- package/dist/shared/uploads.d.ts +31 -0
- package/dist/shared/uploads.js +65 -0
- package/dist/shared/voiceApprovals.d.ts +36 -0
- package/dist/shared/voiceApprovals.js +229 -0
- package/dist/shared/workspace.d.ts +49 -0
- package/dist/shared/workspace.js +53 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +266 -0
- package/package.json +51 -4
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supermemory-native brain contracts.
|
|
3
|
+
*
|
|
4
|
+
* Supermemory is the only durable memory store. Steer keeps a lightweight
|
|
5
|
+
* index row per document (ids, tag, kind, status, provenance, a short preview)
|
|
6
|
+
* plus policy, receipts, and audit — never memory bodies as source of truth.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BRAIN_KINDS: readonly ["goal", "decision", "constraint", "discovery", "handoff", "feedback", "note"];
|
|
9
|
+
export type BrainKind = (typeof BRAIN_KINDS)[number];
|
|
10
|
+
export declare const BRAIN_STATUSES: readonly ["proposed", "active", "archived"];
|
|
11
|
+
export type BrainStatus = (typeof BRAIN_STATUSES)[number];
|
|
12
|
+
export declare const BRAIN_SCOPES: readonly ["shared", "room", "user", "repo", "issue", "swarm", "agent"];
|
|
13
|
+
export type BrainScope = (typeof BRAIN_SCOPES)[number];
|
|
14
|
+
export declare const BRAIN_SOURCES: readonly ["human", "agent_proposed", "auto_run", "chat_ingest", "handoff", "issue_outcome", "swarm_summary", "connector", "migration", "dream", "feature", "digest"];
|
|
15
|
+
export type BrainSource = (typeof BRAIN_SOURCES)[number];
|
|
16
|
+
export type DreamingMode = "dynamic" | "instant";
|
|
17
|
+
/**
|
|
18
|
+
* Auto-remember: after each run Steer saves a cleaned session record to room +
|
|
19
|
+
* repo memory and Supermemory extracts, versions and dedupes the facts — no
|
|
20
|
+
* approval clicks. "off" disables it.
|
|
21
|
+
*/
|
|
22
|
+
export type AutoMemoryPolicy = "off" | "auto";
|
|
23
|
+
/** Legacy "propose" / "ingest_chat" (approval-gated) map to "auto". */
|
|
24
|
+
export declare function normalizeAutoMemory(raw: unknown, fallback?: AutoMemoryPolicy): AutoMemoryPolicy;
|
|
25
|
+
export type ArchivePolicy = "exclude" | "delete";
|
|
26
|
+
export type IngestStatus = "queued" | "processing" | "done" | "failed";
|
|
27
|
+
export interface BrainScopeRef {
|
|
28
|
+
scope: BrainScope;
|
|
29
|
+
/** roomId / userId / repoKey / issueId / swarmId / agentId. Absent for `shared`. */
|
|
30
|
+
id?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface BrainMemoryInfo {
|
|
33
|
+
id: string;
|
|
34
|
+
orgId: string;
|
|
35
|
+
containerTag: string;
|
|
36
|
+
scope: BrainScope;
|
|
37
|
+
scopeId: string | null;
|
|
38
|
+
/** Supermemory document id. Null while a proposal only lives in the inbox tag. */
|
|
39
|
+
docId: string | null;
|
|
40
|
+
/** Inbox (staging) document for proposals — never searched at run time. */
|
|
41
|
+
inboxDocId: string | null;
|
|
42
|
+
kind: BrainKind;
|
|
43
|
+
title: string;
|
|
44
|
+
/** Short cached preview for list rendering. Full body is fetched from Supermemory. */
|
|
45
|
+
preview: string;
|
|
46
|
+
/** Present on detail reads (fetched from Supermemory). */
|
|
47
|
+
content?: string;
|
|
48
|
+
status: BrainStatus;
|
|
49
|
+
pinned: boolean;
|
|
50
|
+
source: BrainSource;
|
|
51
|
+
repoUrl: string | null;
|
|
52
|
+
repoKey: string | null;
|
|
53
|
+
evidenceRefs: string[];
|
|
54
|
+
supersedesId: string | null;
|
|
55
|
+
supersededById: string | null;
|
|
56
|
+
createdByUserId: string | null;
|
|
57
|
+
createdByName?: string | null;
|
|
58
|
+
createdByAgentId: string | null;
|
|
59
|
+
decidedByUserId: string | null;
|
|
60
|
+
ingestStatus: IngestStatus;
|
|
61
|
+
usedInRuns: number;
|
|
62
|
+
/** Stable topic key; a newer fact with the same key replaces this one. */
|
|
63
|
+
subjectKey?: string | null;
|
|
64
|
+
/** People the memory is about or came from (user ids). */
|
|
65
|
+
people?: string[];
|
|
66
|
+
/** When the underlying event happened (not when it was saved). */
|
|
67
|
+
eventAt?: number | null;
|
|
68
|
+
episodeId?: string | null;
|
|
69
|
+
featureId?: string | null;
|
|
70
|
+
roomId?: string | null;
|
|
71
|
+
createdAt: number;
|
|
72
|
+
updatedAt: number;
|
|
73
|
+
}
|
|
74
|
+
export interface BrainSimilarHit {
|
|
75
|
+
id: string;
|
|
76
|
+
memoryId: string | null;
|
|
77
|
+
text: string;
|
|
78
|
+
similarity: number;
|
|
79
|
+
title?: string | null;
|
|
80
|
+
}
|
|
81
|
+
export interface BrainInferredCandidate {
|
|
82
|
+
id: string;
|
|
83
|
+
containerTag: string;
|
|
84
|
+
scope: BrainScope;
|
|
85
|
+
scopeId: string | null;
|
|
86
|
+
memory: string;
|
|
87
|
+
parentCount: number;
|
|
88
|
+
createdAt: number;
|
|
89
|
+
}
|
|
90
|
+
export interface BrainSettings {
|
|
91
|
+
orgId: string;
|
|
92
|
+
supermemoryConfigured: boolean;
|
|
93
|
+
keySource: "org" | "steer_managed" | "none";
|
|
94
|
+
keyHint: string | null;
|
|
95
|
+
dreamingMode: DreamingMode;
|
|
96
|
+
autoMemory: AutoMemoryPolicy;
|
|
97
|
+
archivePolicy: ArchivePolicy;
|
|
98
|
+
searchLimit: number;
|
|
99
|
+
searchThreshold: number;
|
|
100
|
+
budgetChars: number;
|
|
101
|
+
includeProfiles: boolean;
|
|
102
|
+
rerank: boolean;
|
|
103
|
+
/** Admin consent for Supermemory-side data connectors into shared/repo tags. */
|
|
104
|
+
connectorsEnabled: boolean;
|
|
105
|
+
/** Admin opt-in: remember people-to-people Space chat (members see a notice). */
|
|
106
|
+
spaceCapture: boolean;
|
|
107
|
+
epoch: number;
|
|
108
|
+
epochUpdatedAt: number;
|
|
109
|
+
}
|
|
110
|
+
export declare const DEFAULT_BRAIN_SETTINGS: Omit<BrainSettings, "orgId" | "supermemoryConfigured" | "keySource" | "keyHint" | "epoch" | "epochUpdatedAt">;
|
|
111
|
+
export interface BrainReceiptInfo {
|
|
112
|
+
id: string;
|
|
113
|
+
orgId: string;
|
|
114
|
+
runKind: "room" | "issue" | "swarm";
|
|
115
|
+
runRef: string;
|
|
116
|
+
agentId: string | null;
|
|
117
|
+
steeringUserId: string | null;
|
|
118
|
+
tags: string[];
|
|
119
|
+
tagEpochs: Record<string, number>;
|
|
120
|
+
queryHash: string;
|
|
121
|
+
memoryIds: string[];
|
|
122
|
+
resultIds: string[];
|
|
123
|
+
titles: string[];
|
|
124
|
+
profileAt: number | null;
|
|
125
|
+
requestIds: string[];
|
|
126
|
+
chars: number;
|
|
127
|
+
createdAt: number;
|
|
128
|
+
stale?: boolean;
|
|
129
|
+
}
|
|
130
|
+
export interface BrainAuditInfo {
|
|
131
|
+
id: string;
|
|
132
|
+
orgId: string;
|
|
133
|
+
actorUserId: string | null;
|
|
134
|
+
actorName?: string | null;
|
|
135
|
+
action: string;
|
|
136
|
+
target: string | null;
|
|
137
|
+
meta: Record<string, unknown>;
|
|
138
|
+
createdAt: number;
|
|
139
|
+
}
|
|
140
|
+
export interface BrainUsageInfo {
|
|
141
|
+
month: string;
|
|
142
|
+
operations: Record<string, number>;
|
|
143
|
+
total: number;
|
|
144
|
+
}
|
|
145
|
+
export interface BrainOverview {
|
|
146
|
+
settings: BrainSettings;
|
|
147
|
+
counts: {
|
|
148
|
+
active: number;
|
|
149
|
+
proposed: number;
|
|
150
|
+
archived: number;
|
|
151
|
+
byScope: Record<BrainScope, number>;
|
|
152
|
+
byKind: Record<string, number>;
|
|
153
|
+
};
|
|
154
|
+
repos: Array<{
|
|
155
|
+
repoKey: string;
|
|
156
|
+
repoUrl: string | null;
|
|
157
|
+
count: number;
|
|
158
|
+
}>;
|
|
159
|
+
usage: BrainUsageInfo;
|
|
160
|
+
recentReceipts: BrainReceiptInfo[];
|
|
161
|
+
}
|
|
162
|
+
export interface BrainGraphNode {
|
|
163
|
+
id: string;
|
|
164
|
+
kind: BrainKind | "scope";
|
|
165
|
+
label: string;
|
|
166
|
+
scope: BrainScope;
|
|
167
|
+
status?: BrainStatus;
|
|
168
|
+
pinned?: boolean;
|
|
169
|
+
weight: number;
|
|
170
|
+
}
|
|
171
|
+
export interface BrainGraphEdge {
|
|
172
|
+
from: string;
|
|
173
|
+
to: string;
|
|
174
|
+
rel: "in_scope" | "supersedes" | "same_repo" | "evidence";
|
|
175
|
+
}
|
|
176
|
+
export interface BrainGraph {
|
|
177
|
+
nodes: BrainGraphNode[];
|
|
178
|
+
edges: BrainGraphEdge[];
|
|
179
|
+
}
|
|
180
|
+
/** Payload for `memory-updated`, `memory-proposal` socket events. */
|
|
181
|
+
export interface BrainMemoryEvent {
|
|
182
|
+
orgId: string;
|
|
183
|
+
memory: BrainMemoryInfo;
|
|
184
|
+
epoch: number;
|
|
185
|
+
}
|
|
186
|
+
export interface BrainEpochEvent {
|
|
187
|
+
orgId: string;
|
|
188
|
+
epoch: number;
|
|
189
|
+
tags: string[];
|
|
190
|
+
}
|
|
191
|
+
export declare const TAG_PREFIX = "steer:org:";
|
|
192
|
+
export declare function isBrainKind(v: unknown): v is BrainKind;
|
|
193
|
+
export declare function isBrainStatus(v: unknown): v is BrainStatus;
|
|
194
|
+
export declare function isBrainScope(v: unknown): v is BrainScope;
|
|
195
|
+
export declare function isBrainSource(v: unknown): v is BrainSource;
|
|
196
|
+
/**
|
|
197
|
+
* Normalize any git remote to a stable, tag-safe key:
|
|
198
|
+
* `https://github.com/Acme/Web.git` → `github.com-acme-web`.
|
|
199
|
+
*/
|
|
200
|
+
export declare function normalizeRepoKey(repoUrl: string | null | undefined): string | null;
|
|
201
|
+
export declare function containerTagFor(orgId: string, ref: BrainScopeRef): string;
|
|
202
|
+
/**
|
|
203
|
+
* Staging tag for proposals and raw ingest (chat, handoffs). Supermemory
|
|
204
|
+
* dreams over these documents but run-time retrieval never reads them, which
|
|
205
|
+
* structurally keeps proposals out of search/profile until accepted.
|
|
206
|
+
*/
|
|
207
|
+
export declare function inboxTagFor(orgId: string, ref: BrainScopeRef): string;
|
|
208
|
+
export declare function parseContainerTag(tag: string): {
|
|
209
|
+
org: string;
|
|
210
|
+
scope: BrainScope;
|
|
211
|
+
id: string | null;
|
|
212
|
+
inbox: boolean;
|
|
213
|
+
} | null;
|
|
214
|
+
/** Server-side guard: every Supermemory call must carry a tag for this org. */
|
|
215
|
+
export declare function tagBelongsToOrg(tag: string, orgId: string): boolean;
|
|
216
|
+
export type BrainRunKind = "room" | "issue" | "swarm" | "research";
|
|
217
|
+
export interface BrainReadContext {
|
|
218
|
+
kind: BrainRunKind;
|
|
219
|
+
roomId?: string | null;
|
|
220
|
+
issueId?: string | null;
|
|
221
|
+
swarmId?: string | null;
|
|
222
|
+
repoUrl?: string | null;
|
|
223
|
+
steeringUserId?: string | null;
|
|
224
|
+
agentId?: string | null;
|
|
225
|
+
/** Composer override: only the room tag. */
|
|
226
|
+
onlyRoom?: boolean;
|
|
227
|
+
/** Composer override: include the workspace (shared) brain. Default true. */
|
|
228
|
+
includeWorkspace?: boolean;
|
|
229
|
+
/** Include the steering user's personal tag. Default true for rooms, false for issues. */
|
|
230
|
+
includePersonal?: boolean;
|
|
231
|
+
/** Include long-lived agent notes. */
|
|
232
|
+
includeAgent?: boolean;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Read union by context. Never includes another user's personal tag: the only
|
|
236
|
+
* `user` scope ever returned is the steering user's own.
|
|
237
|
+
*/
|
|
238
|
+
export declare function readScopesFor(ctx: BrainReadContext): BrainScopeRef[];
|
|
239
|
+
export type BrainWriteIntent = "room_note" | "personal_note" | "org_decision" | "repo_discovery" | "issue_outcome" | "swarm_artifact" | "agent_note";
|
|
240
|
+
/** Write narrowest scope: each intent maps to exactly one tag. */
|
|
241
|
+
export declare function writeScopeFor(intent: BrainWriteIntent, ids: {
|
|
242
|
+
roomId?: string | null;
|
|
243
|
+
userId?: string | null;
|
|
244
|
+
repoUrl?: string | null;
|
|
245
|
+
issueId?: string | null;
|
|
246
|
+
swarmId?: string | null;
|
|
247
|
+
agentId?: string | null;
|
|
248
|
+
}): BrainScopeRef;
|
|
249
|
+
/** Repo-bound memories only inject when the run's repo matches. */
|
|
250
|
+
export declare function repoMatches(memoryRepoKey: string | null, runRepoUrl: string | null | undefined): boolean;
|
|
251
|
+
export interface MemoryPromptItem {
|
|
252
|
+
ref: string;
|
|
253
|
+
kind: string;
|
|
254
|
+
title?: string | null;
|
|
255
|
+
text: string;
|
|
256
|
+
scope: BrainScope;
|
|
257
|
+
pinned?: boolean;
|
|
258
|
+
/** Who / when / where it came from, e.g. "Priya · 2026-10-01 · PR#140". */
|
|
259
|
+
provenance?: string | null;
|
|
260
|
+
}
|
|
261
|
+
export interface MemoryPromptInput {
|
|
262
|
+
epoch: number;
|
|
263
|
+
profile: Array<{
|
|
264
|
+
scope: BrainScope;
|
|
265
|
+
lines: string[];
|
|
266
|
+
}>;
|
|
267
|
+
pinned: MemoryPromptItem[];
|
|
268
|
+
hits: MemoryPromptItem[];
|
|
269
|
+
budgetChars: number;
|
|
270
|
+
integrations?: string[];
|
|
271
|
+
}
|
|
272
|
+
/** Strip anything that could close or spoof the memory envelope. */
|
|
273
|
+
export declare function neutralizeEnvelope(text: string): string;
|
|
274
|
+
/**
|
|
275
|
+
* Deterministic ordering: pinned → search index → profile, each line capped,
|
|
276
|
+
* the whole block capped at `budgetChars`. Pinned rules are the only full
|
|
277
|
+
* text; everything else is an id + title index the agent can expand with the
|
|
278
|
+
* memory tools. Returns the ids actually included.
|
|
279
|
+
*/
|
|
280
|
+
export declare function renderMemoryBlock(input: MemoryPromptInput): {
|
|
281
|
+
text: string;
|
|
282
|
+
includedRefs: string[];
|
|
283
|
+
chars: number;
|
|
284
|
+
};
|
|
285
|
+
export declare function hashQuery(q: string): string;
|
|
286
|
+
export declare function brainKindLabel(kind: BrainKind): string;
|
|
287
|
+
export declare function brainScopeLabel(scope: BrainScope): string;
|
|
288
|
+
export declare const BRAIN_EVENT_KINDS: readonly ["message.space", "message.thread", "message.ask", "message.agent_final", "run.started", "run.completed", "pr.opened", "pr.merged", "pr.closed", "issue.created", "issue.status_changed", "issue.finished", "swarm.started", "swarm.done", "memory.manual", "member.joined"];
|
|
289
|
+
export type BrainEventKind = (typeof BRAIN_EVENT_KINDS)[number];
|
|
290
|
+
export type BrainEventVisibility = "team" | "room" | "private";
|
|
291
|
+
export interface BrainEventInfo {
|
|
292
|
+
id: string;
|
|
293
|
+
orgId: string;
|
|
294
|
+
kind: BrainEventKind;
|
|
295
|
+
actorUserId: string | null;
|
|
296
|
+
actorName?: string | null;
|
|
297
|
+
actorAgentId: string | null;
|
|
298
|
+
people: string[];
|
|
299
|
+
roomId: string | null;
|
|
300
|
+
threadId: string | null;
|
|
301
|
+
issueId: string | null;
|
|
302
|
+
swarmId: string | null;
|
|
303
|
+
repoKey: string | null;
|
|
304
|
+
ref: string | null;
|
|
305
|
+
text: string;
|
|
306
|
+
meta: Record<string, unknown>;
|
|
307
|
+
visibility: BrainEventVisibility;
|
|
308
|
+
occurredAt: number;
|
|
309
|
+
episodeId: string | null;
|
|
310
|
+
}
|
|
311
|
+
export declare const EPISODE_KINDS: readonly ["run", "space", "thread", "issue", "swarm", "pr"];
|
|
312
|
+
export type EpisodeKind = (typeof EPISODE_KINDS)[number];
|
|
313
|
+
export type EpisodeStatus = "open" | "ready" | "processing" | "done" | "failed" | "skipped";
|
|
314
|
+
export declare const EPISODE_CLASSES: readonly ["team_work", "repo_knowledge", "decision", "personal", "off_topic", "sensitive"];
|
|
315
|
+
export type EpisodeClass = (typeof EPISODE_CLASSES)[number];
|
|
316
|
+
export declare const FACT_TYPES: readonly ["decision", "constraint", "discovery", "shipped", "feature_progress", "open_question", "preference", "status"];
|
|
317
|
+
export type FactType = (typeof FACT_TYPES)[number];
|
|
318
|
+
/** How a fact type is filed among the memory kinds the UI already knows. */
|
|
319
|
+
export declare function factKind(type: FactType): BrainKind;
|
|
320
|
+
export type FeatureStatus = "in_progress" | "in_review" | "shipped" | "abandoned";
|
|
321
|
+
export interface BrainFeatureInfo {
|
|
322
|
+
id: string;
|
|
323
|
+
orgId: string;
|
|
324
|
+
repoKey: string;
|
|
325
|
+
title: string;
|
|
326
|
+
slug: string;
|
|
327
|
+
status: FeatureStatus;
|
|
328
|
+
startedAt: number;
|
|
329
|
+
prOpenedAt: number | null;
|
|
330
|
+
shippedAt: number | null;
|
|
331
|
+
prUrls: string[];
|
|
332
|
+
people: string[];
|
|
333
|
+
roomIds: string[];
|
|
334
|
+
issueIds: string[];
|
|
335
|
+
summary: string;
|
|
336
|
+
updatedAt: number;
|
|
337
|
+
}
|
|
338
|
+
export interface BrainTimelineQuery {
|
|
339
|
+
from?: number;
|
|
340
|
+
to?: number;
|
|
341
|
+
people?: string[];
|
|
342
|
+
repoKey?: string | null;
|
|
343
|
+
kinds?: BrainEventKind[];
|
|
344
|
+
limit?: number;
|
|
345
|
+
}
|
|
346
|
+
export interface BrainTimelineResult {
|
|
347
|
+
events: BrainEventInfo[];
|
|
348
|
+
features: BrainFeatureInfo[];
|
|
349
|
+
}
|
|
350
|
+
/** Display day for a timestamp (UTC, YYYY-MM-DD). */
|
|
351
|
+
export declare function dayOf(ts: number): string;
|
|
352
|
+
/** URL-safe, stable slug for feature titles. */
|
|
353
|
+
export declare function featureSlug(title: string): string;
|