@herbertgao/pi-extensions 2026.8.12 → 2026.8.14
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 +15 -8
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/node_modules/@czottmann/pi-automode/CHANGELOG.md +12 -0
- package/node_modules/@czottmann/pi-automode/README.md +1 -1
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +55 -4
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +7 -3
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +2 -0
- package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +134 -23
- package/node_modules/@czottmann/pi-automode/package.json +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
- package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +6 -0
- package/node_modules/@herbertgao/pi-subagents/package.json +2 -1
- package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +8 -1
- package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +376 -0
- package/node_modules/@luxusai/pi-hindsight/README.md +92 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +56 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +169 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +107 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +89 -0
- package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +189 -0
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
- package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +54 -0
- package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +75 -0
- package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +300 -0
- package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +158 -0
- package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +164 -0
- package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +139 -0
- package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +74 -0
- package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +261 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +151 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +18 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +46 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +383 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +240 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +176 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +178 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +41 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +386 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +39 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +34 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +140 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +61 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +925 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +247 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +547 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +480 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +182 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +86 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +1010 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +175 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +425 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +210 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +817 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +25 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +196 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +65 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +260 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +59 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +82 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +331 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +354 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +66 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +132 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +228 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +74 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +16 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +648 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +68 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +71 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +13 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +162 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +131 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +104 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +37 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +893 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +35 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +177 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +7 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +21 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +112 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +111 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +214 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +70 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +392 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +45 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +9 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +860 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +105 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +189 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +299 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +201 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +47 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +239 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +259 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +77 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +534 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +319 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +325 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +42 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +244 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +56 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +50 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +167 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +207 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +120 -0
- package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +8 -0
- package/node_modules/@luxusai/pi-hindsight/package.json +118 -0
- package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +75 -0
- package/node_modules/@narumitw/pi-btw/package.json +2 -2
- package/node_modules/@tifan/pi-preferred-thinking/README.md +1 -1
- package/node_modules/@tifan/pi-preferred-thinking/package.json +1 -1
- package/node_modules/@tifan/pi-preferred-thinking/src/index.ts +15 -2
- package/node_modules/pi-mcp-adapter/CHANGELOG.md +33 -0
- package/node_modules/pi-mcp-adapter/README.md +3 -0
- package/node_modules/pi-mcp-adapter/cli.js +4 -4
- package/node_modules/pi-mcp-adapter/config.ts +11 -0
- package/node_modules/pi-mcp-adapter/dist/config.js +11 -0
- package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -1
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.d.ts +24 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js +336 -0
- package/node_modules/pi-mcp-adapter/dist/mcp-bearer-store.js.map +1 -0
- package/node_modules/pi-mcp-adapter/dist/types.d.ts +2 -0
- package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -1
- package/node_modules/pi-mcp-adapter/index.ts +90 -6
- package/node_modules/pi-mcp-adapter/init.ts +5 -1
- package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +19 -0
- package/node_modules/pi-mcp-adapter/mcp-bearer-store.ts +0 -2
- package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +89 -0
- package/node_modules/pi-mcp-adapter/mcp-references.ts +9 -1
- package/node_modules/pi-mcp-adapter/package.json +1 -1
- package/node_modules/pi-mcp-adapter/proxy-modes.ts +40 -10
- package/node_modules/pi-mcp-adapter/request-headers-command.ts +1 -1
- package/node_modules/pi-mcp-adapter/types.ts +2 -0
- package/node_modules/pi-web-access/CHANGELOG.md +22 -0
- package/node_modules/pi-web-access/README.md +11 -8
- package/node_modules/pi-web-access/curator-page.ts +12 -3
- package/node_modules/pi-web-access/curator-server.ts +3 -1
- package/node_modules/pi-web-access/extract.ts +31 -1
- package/node_modules/pi-web-access/gemini-search.ts +10 -5
- package/node_modules/pi-web-access/index.ts +39 -39
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/xcrawl.ts +264 -0
- package/package.json +15 -12
- package/node_modules/@herbertgao/pi-stash/LICENSE +0 -22
- package/node_modules/@herbertgao/pi-stash/README.md +0 -34
- package/node_modules/@herbertgao/pi-stash/package.json +0 -51
- package/node_modules/@herbertgao/pi-stash/src/index.ts +0 -118
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BankTemplateManifest,
|
|
3
|
+
MinScores,
|
|
4
|
+
TagGroupAndInput,
|
|
5
|
+
TagGroupLeaf,
|
|
6
|
+
TagGroupNotInput,
|
|
7
|
+
TagGroupOrInput,
|
|
8
|
+
} from "@vectorize-io/hindsight-client";
|
|
9
|
+
|
|
10
|
+
export type Budget = "low" | "mid" | "high";
|
|
11
|
+
export type UpdateMode = "append" | "replace";
|
|
12
|
+
|
|
13
|
+
// Automatic-retain delivery cadence.
|
|
14
|
+
// - immediate: flush the queue after every agent_end (legacy, backward-compatible default).
|
|
15
|
+
// - coalesced: enqueue and merge compatible deltas for the same bank/document, deferring
|
|
16
|
+
// remote delivery to the session boundary (shutdown) and any configured periodic flush.
|
|
17
|
+
// This collapses many small per-run retain operations into few larger ones, cutting
|
|
18
|
+
// Hindsight extraction/consolidation and Postgres WAL/write amplification.
|
|
19
|
+
export type RetainDelivery = "immediate" | "coalesced";
|
|
20
|
+
export type RetainUserContent = "text";
|
|
21
|
+
export type RetainAssistantContent = "text" | "toolCall" | "thinking";
|
|
22
|
+
export type RetainToolResultContent = "error" | "summary" | "content";
|
|
23
|
+
export type TagsMatch = "any" | "all" | "any_strict" | "all_strict" | "exact";
|
|
24
|
+
export type HindsightTagGroup =
|
|
25
|
+
| TagGroupLeaf
|
|
26
|
+
| TagGroupAndInput
|
|
27
|
+
| TagGroupOrInput
|
|
28
|
+
| TagGroupNotInput;
|
|
29
|
+
export type MentalModelDetail = "metadata" | "content" | "full";
|
|
30
|
+
export type MentalModelTagsMatch = "any" | "all" | "exact";
|
|
31
|
+
export type OperationStatus = "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
32
|
+
export type GraphFactType = "world" | "experience";
|
|
33
|
+
export type DocumentTagsMatch = "any" | "all" | "any_strict" | "all_strict";
|
|
34
|
+
export type TagSource = "memories" | "mental_models";
|
|
35
|
+
export type HindsightObservationScopes =
|
|
36
|
+
| "per_tag"
|
|
37
|
+
| "combined"
|
|
38
|
+
| "all_combinations"
|
|
39
|
+
| "shared"
|
|
40
|
+
| string[][];
|
|
41
|
+
export type StatusStyle = "off" | "text" | "emoji" | "nerdfont";
|
|
42
|
+
export type StatusDetail = "minimal" | "project" | "activity" | "verbose";
|
|
43
|
+
export type RecallRole = "user" | "assistant" | "tool" | "system";
|
|
44
|
+
export type RecallInjectionPosition = "prepend" | "append";
|
|
45
|
+
export type GlobalRetainMode = "explicit-only";
|
|
46
|
+
export type ImportMode = "curated" | "raw" | "forensic";
|
|
47
|
+
export type ImportQualityProfile = "compatible" | "strict";
|
|
48
|
+
/** Agent use profile selects mental-model seed sets (coding vs conversation/life). */
|
|
49
|
+
export type AgentUseProfile = "coding" | "conversation";
|
|
50
|
+
|
|
51
|
+
/** Score fields Hindsight may return on recall results; used for optional local floors. */
|
|
52
|
+
export const RECALL_SCORE_FIELDS = ["semantic", "reranker", "final", "keyword"] as const;
|
|
53
|
+
export type RecallScoreField = (typeof RECALL_SCORE_FIELDS)[number];
|
|
54
|
+
export type RecallMinScores = Partial<Record<RecallScoreField, number>>;
|
|
55
|
+
|
|
56
|
+
export interface BankMissionSettings {
|
|
57
|
+
retainMission?: string;
|
|
58
|
+
reflectMission?: string;
|
|
59
|
+
observationsMission?: string;
|
|
60
|
+
retainStructuredChunkSize?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface HindsightEntityInput {
|
|
64
|
+
text: string;
|
|
65
|
+
type?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type ScopeMode = "domain-tagged" | "isolated-bank";
|
|
69
|
+
|
|
70
|
+
export interface ScopeConfig {
|
|
71
|
+
/**
|
|
72
|
+
* domain-tagged: shared coding bank (banks.project.bankId) + project tags.
|
|
73
|
+
* isolated-bank: path-derived or dedicated bank per repo (hard wall).
|
|
74
|
+
*/
|
|
75
|
+
mode: ScopeMode;
|
|
76
|
+
/** Explicit project id pin (wins over remote/basename). Written as tag project:<slug>. */
|
|
77
|
+
projectId?: string;
|
|
78
|
+
/**
|
|
79
|
+
* How to derive project id when pin is unset.
|
|
80
|
+
* remote = git origin URL (default); basename = git root folder name.
|
|
81
|
+
*/
|
|
82
|
+
projectIdStrategy: "remote" | "basename";
|
|
83
|
+
/**
|
|
84
|
+
* When true, project recall ORs exact untagged (shared) observations with the
|
|
85
|
+
* project tag filter. Default false — strict project isolation.
|
|
86
|
+
* Not cross-bank; only untagged observations inside the same coding bank.
|
|
87
|
+
*/
|
|
88
|
+
includeSharedObservations: boolean;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ResolvedConfig {
|
|
92
|
+
enabled: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* When true, automatic memory network I/O is allowed.
|
|
95
|
+
* Also treated as complete when bank ids, project config files, or legacy runtime state exist (ADR-005).
|
|
96
|
+
*/
|
|
97
|
+
setupComplete: boolean;
|
|
98
|
+
scope: ScopeConfig;
|
|
99
|
+
hindsight: { baseUrl: string; apiKey?: string; apiKeyRef?: string; timeoutMs: number };
|
|
100
|
+
/** Selects default mental-model sets (coding vs conversation/real-life). */
|
|
101
|
+
agentUse: AgentUseProfile;
|
|
102
|
+
mentalModels: {
|
|
103
|
+
/** When true, inject non-empty mental models into automatic context. */
|
|
104
|
+
inject: boolean;
|
|
105
|
+
/** Total character budget for injected mental-model blocks. */
|
|
106
|
+
maxChars: number;
|
|
107
|
+
/** Cache TTL for listMentalModels content used in automatic inject. */
|
|
108
|
+
cacheTtlMs: number;
|
|
109
|
+
};
|
|
110
|
+
banks: {
|
|
111
|
+
project: BankMissionSettings & {
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
bankId?: string;
|
|
114
|
+
derive: "repo" | "cwd" | "manual";
|
|
115
|
+
};
|
|
116
|
+
user: BankMissionSettings & { enabled: boolean; bankId?: string };
|
|
117
|
+
global: BankMissionSettings & { enabled: boolean; bankId?: string };
|
|
118
|
+
};
|
|
119
|
+
recall: {
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
budget: Budget;
|
|
122
|
+
maxTokens: number;
|
|
123
|
+
userMaxTokens: number;
|
|
124
|
+
types: string[];
|
|
125
|
+
includeSourceFacts: boolean;
|
|
126
|
+
maxSourceFactsTokens: number;
|
|
127
|
+
contextTurns: number;
|
|
128
|
+
roles: RecallRole[];
|
|
129
|
+
maxQueryChars: number;
|
|
130
|
+
queryPreamble: string;
|
|
131
|
+
projectQueryPreamble: string;
|
|
132
|
+
globalQueryPreamble: string;
|
|
133
|
+
userQueryPreamble?: string;
|
|
134
|
+
includeDateInQuery: boolean;
|
|
135
|
+
includeRepoHintsInQuery: boolean;
|
|
136
|
+
storeLastRecall: boolean;
|
|
137
|
+
storeLastRecallFailures: boolean;
|
|
138
|
+
lastRecallPath: string;
|
|
139
|
+
topK: number;
|
|
140
|
+
timeoutMs: number;
|
|
141
|
+
cacheTtlMs: number;
|
|
142
|
+
injectionMode: "context";
|
|
143
|
+
injectionPosition: RecallInjectionPosition;
|
|
144
|
+
includeFactsInDebug: boolean;
|
|
145
|
+
queryTimestamp?: string;
|
|
146
|
+
preferObservations: boolean;
|
|
147
|
+
/** Optional local floors for automatic recall injection. Omitted by default. */
|
|
148
|
+
minScores?: RecallMinScores;
|
|
149
|
+
};
|
|
150
|
+
observations: {
|
|
151
|
+
enabled: boolean;
|
|
152
|
+
scopes: string[][];
|
|
153
|
+
};
|
|
154
|
+
userRetain: {
|
|
155
|
+
mode: GlobalRetainMode;
|
|
156
|
+
};
|
|
157
|
+
globalRetain: {
|
|
158
|
+
mode: GlobalRetainMode;
|
|
159
|
+
};
|
|
160
|
+
retain: {
|
|
161
|
+
enabled: boolean;
|
|
162
|
+
async: boolean;
|
|
163
|
+
delivery: RetainDelivery;
|
|
164
|
+
updateMode: UpdateMode;
|
|
165
|
+
content: {
|
|
166
|
+
user: RetainUserContent[];
|
|
167
|
+
assistant: RetainAssistantContent[];
|
|
168
|
+
toolResult: RetainToolResultContent[];
|
|
169
|
+
};
|
|
170
|
+
toolFilter: {
|
|
171
|
+
toolCall: { include?: string[]; exclude?: string[] };
|
|
172
|
+
toolResult: { include?: string[]; exclude?: string[] };
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* When true (default), assistant tool calls retain name + primary target only
|
|
176
|
+
* (no full args). Set false for full argument objects (debug / forensic).
|
|
177
|
+
*/
|
|
178
|
+
compactToolCalls: boolean;
|
|
179
|
+
strip: {
|
|
180
|
+
message: string[];
|
|
181
|
+
topLevel: string[];
|
|
182
|
+
};
|
|
183
|
+
redactSecrets: boolean;
|
|
184
|
+
entities: HindsightEntityInput[];
|
|
185
|
+
queuePath: string;
|
|
186
|
+
flushIntervalMs: number;
|
|
187
|
+
periodicFlushMaxJobs: number;
|
|
188
|
+
periodicFlushTimeoutMs: number;
|
|
189
|
+
shutdownFlushMaxJobs: number;
|
|
190
|
+
shutdownFlushTimeoutMs: number;
|
|
191
|
+
postRetainReflect: boolean;
|
|
192
|
+
};
|
|
193
|
+
import: {
|
|
194
|
+
mode: ImportMode;
|
|
195
|
+
qualityProfile: ImportQualityProfile;
|
|
196
|
+
turnsPerDocument: number;
|
|
197
|
+
maxDocumentBytes: number;
|
|
198
|
+
includeBranches: "current-only" | "all-leaves";
|
|
199
|
+
toolResults: "errors-only" | "summary" | "content";
|
|
200
|
+
toolResultSummaryMaxChars: number;
|
|
201
|
+
replaceExistingImportedDocs: boolean;
|
|
202
|
+
manifestPath: string;
|
|
203
|
+
checkpointPath: string;
|
|
204
|
+
resume: boolean;
|
|
205
|
+
};
|
|
206
|
+
status: {
|
|
207
|
+
style: StatusStyle;
|
|
208
|
+
detail: StatusDetail;
|
|
209
|
+
maxLength: number;
|
|
210
|
+
showActivity: boolean;
|
|
211
|
+
};
|
|
212
|
+
notifications: {
|
|
213
|
+
startup: boolean;
|
|
214
|
+
recall: boolean;
|
|
215
|
+
retain: boolean;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface BankSelection {
|
|
220
|
+
projectBankId: string;
|
|
221
|
+
globalBankId?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface RecallResultItem {
|
|
225
|
+
id?: string;
|
|
226
|
+
text?: string;
|
|
227
|
+
content?: string;
|
|
228
|
+
type?: string;
|
|
229
|
+
tags?: string[];
|
|
230
|
+
metadata?: Record<string, string>;
|
|
231
|
+
occurred_start?: string | null;
|
|
232
|
+
source_fact_ids?: string[];
|
|
233
|
+
sourceFacts?: string[];
|
|
234
|
+
scores?: RecallResultScores;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export interface RecallResultScores {
|
|
238
|
+
semantic?: number | null;
|
|
239
|
+
reranker?: number | null;
|
|
240
|
+
final?: number | null;
|
|
241
|
+
keyword?: number | null;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface RecallFailure {
|
|
245
|
+
bankId: string;
|
|
246
|
+
query: string;
|
|
247
|
+
error: string;
|
|
248
|
+
kind?: "project" | "global";
|
|
249
|
+
tagGroups?: HindsightTagGroup[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface RecallBlock {
|
|
253
|
+
bankId: string;
|
|
254
|
+
query: string;
|
|
255
|
+
rendered: string;
|
|
256
|
+
memoryCount: number;
|
|
257
|
+
results: RecallResultItem[];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface RetainOutcome {
|
|
261
|
+
itemsCount?: number;
|
|
262
|
+
operations?: number;
|
|
263
|
+
tokens?: number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface RetainJob {
|
|
267
|
+
id: string;
|
|
268
|
+
bankId: string;
|
|
269
|
+
createdAt: string;
|
|
270
|
+
documentId: string;
|
|
271
|
+
updateMode: UpdateMode;
|
|
272
|
+
item: {
|
|
273
|
+
content: string;
|
|
274
|
+
context: string;
|
|
275
|
+
timestamp?: string;
|
|
276
|
+
async?: boolean;
|
|
277
|
+
tags?: string[];
|
|
278
|
+
metadata?: Record<string, string>;
|
|
279
|
+
observationScopes?: HindsightObservationScopes;
|
|
280
|
+
documentTags?: string[];
|
|
281
|
+
entities?: HindsightEntityInput[];
|
|
282
|
+
/** Named bank retain strategy (conversation, git, gitlog, document, survey). */
|
|
283
|
+
strategy?: string;
|
|
284
|
+
};
|
|
285
|
+
retries: number;
|
|
286
|
+
lastError?: string;
|
|
287
|
+
deadLetteredAt?: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface MentalModelSummary {
|
|
291
|
+
id: string;
|
|
292
|
+
name: string;
|
|
293
|
+
content?: string;
|
|
294
|
+
tags?: string[];
|
|
295
|
+
lastRefreshedAt?: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface HindsightLikeClient {
|
|
299
|
+
retain(
|
|
300
|
+
bankId: string,
|
|
301
|
+
content: string,
|
|
302
|
+
options?: {
|
|
303
|
+
timestamp?: Date | string;
|
|
304
|
+
context?: string;
|
|
305
|
+
metadata?: Record<string, string>;
|
|
306
|
+
documentId?: string;
|
|
307
|
+
documentTags?: string[];
|
|
308
|
+
async?: boolean;
|
|
309
|
+
/** Caller-supplied UUID for idempotent async retain retries. */
|
|
310
|
+
operationId?: string;
|
|
311
|
+
entities?: HindsightEntityInput[];
|
|
312
|
+
tags?: string[];
|
|
313
|
+
updateMode?: UpdateMode;
|
|
314
|
+
observationScopes?: HindsightObservationScopes;
|
|
315
|
+
/** Named bank retain strategy override for this item. */
|
|
316
|
+
strategy?: string;
|
|
317
|
+
signal?: AbortSignal;
|
|
318
|
+
},
|
|
319
|
+
): Promise<unknown>;
|
|
320
|
+
retainBatch?(
|
|
321
|
+
bankId: string,
|
|
322
|
+
items: Array<{
|
|
323
|
+
content: string;
|
|
324
|
+
timestamp?: Date | string;
|
|
325
|
+
context?: string;
|
|
326
|
+
metadata?: Record<string, string>;
|
|
327
|
+
document_id?: string;
|
|
328
|
+
entities?: Array<{ text: string; type?: string }>;
|
|
329
|
+
tags?: string[];
|
|
330
|
+
observation_scopes?: HindsightObservationScopes;
|
|
331
|
+
update_mode?: UpdateMode;
|
|
332
|
+
strategy?: string;
|
|
333
|
+
}>,
|
|
334
|
+
options?: {
|
|
335
|
+
documentId?: string;
|
|
336
|
+
documentTags?: string[];
|
|
337
|
+
async?: boolean;
|
|
338
|
+
operationId?: string;
|
|
339
|
+
signal?: AbortSignal;
|
|
340
|
+
},
|
|
341
|
+
): Promise<unknown>;
|
|
342
|
+
recall(
|
|
343
|
+
bankId: string,
|
|
344
|
+
query: string,
|
|
345
|
+
options?: {
|
|
346
|
+
types?: string[];
|
|
347
|
+
preferObservations?: boolean;
|
|
348
|
+
maxTokens?: number;
|
|
349
|
+
budget?: Budget;
|
|
350
|
+
queryTimestamp?: string;
|
|
351
|
+
trace?: boolean;
|
|
352
|
+
includeEntities?: boolean;
|
|
353
|
+
maxEntityTokens?: number;
|
|
354
|
+
includeChunks?: boolean;
|
|
355
|
+
maxChunkTokens?: number;
|
|
356
|
+
includeSourceFacts?: boolean;
|
|
357
|
+
maxSourceFactsTokens?: number;
|
|
358
|
+
tags?: string[];
|
|
359
|
+
tagsMatch?: TagsMatch;
|
|
360
|
+
tagGroups?: HindsightTagGroup[];
|
|
361
|
+
minScores?: MinScores;
|
|
362
|
+
signal?: AbortSignal;
|
|
363
|
+
},
|
|
364
|
+
): Promise<unknown>;
|
|
365
|
+
reflect(
|
|
366
|
+
bankId: string,
|
|
367
|
+
query: string,
|
|
368
|
+
options?: {
|
|
369
|
+
context?: string;
|
|
370
|
+
budget?: Budget;
|
|
371
|
+
maxTokens?: number;
|
|
372
|
+
responseSchema?: Record<string, unknown>;
|
|
373
|
+
includeFacts?: boolean;
|
|
374
|
+
includeToolCalls?: boolean;
|
|
375
|
+
includeToolCallOutput?: boolean;
|
|
376
|
+
factTypes?: Array<"world" | "experience" | "observation">;
|
|
377
|
+
excludeMentalModels?: boolean;
|
|
378
|
+
excludeMentalModelIds?: string[];
|
|
379
|
+
tags?: string[];
|
|
380
|
+
tagsMatch?: TagsMatch;
|
|
381
|
+
tagGroups?: HindsightTagGroup[];
|
|
382
|
+
signal?: AbortSignal;
|
|
383
|
+
},
|
|
384
|
+
): Promise<unknown>;
|
|
385
|
+
createBank?(
|
|
386
|
+
bankId: string,
|
|
387
|
+
options?: {
|
|
388
|
+
name?: string;
|
|
389
|
+
reflectMission?: string;
|
|
390
|
+
retainMission?: string;
|
|
391
|
+
retainExtractionMode?: string;
|
|
392
|
+
retainStructuredChunkSize?: number;
|
|
393
|
+
enableObservations?: boolean;
|
|
394
|
+
observationsMission?: string;
|
|
395
|
+
},
|
|
396
|
+
): Promise<unknown>;
|
|
397
|
+
getBankProfile?(bankId: string): Promise<unknown>;
|
|
398
|
+
getBankStats?(bankId: string): Promise<unknown>;
|
|
399
|
+
getBankConfig?(bankId: string): Promise<unknown>;
|
|
400
|
+
importBankTemplate?(
|
|
401
|
+
bankId: string,
|
|
402
|
+
manifest: BankTemplateManifest,
|
|
403
|
+
options?: { dryRun?: boolean; signal?: AbortSignal },
|
|
404
|
+
): Promise<unknown>;
|
|
405
|
+
listMentalModels?(
|
|
406
|
+
bankId: string,
|
|
407
|
+
options?: {
|
|
408
|
+
tags?: string[];
|
|
409
|
+
/** Exclude large content/provenance; prefer metadata for agent list. */
|
|
410
|
+
detail?: "metadata" | "content" | "full";
|
|
411
|
+
signal?: AbortSignal;
|
|
412
|
+
},
|
|
413
|
+
): Promise<unknown>;
|
|
414
|
+
getMentalModel?(
|
|
415
|
+
bankId: string,
|
|
416
|
+
mentalModelId: string,
|
|
417
|
+
options?: {
|
|
418
|
+
detail?: "metadata" | "content" | "full";
|
|
419
|
+
signal?: AbortSignal;
|
|
420
|
+
},
|
|
421
|
+
): Promise<unknown>;
|
|
422
|
+
createMentalModel?(
|
|
423
|
+
bankId: string,
|
|
424
|
+
name: string,
|
|
425
|
+
sourceQuery: string,
|
|
426
|
+
options?: {
|
|
427
|
+
id?: string;
|
|
428
|
+
tags?: string[];
|
|
429
|
+
maxTokens?: number;
|
|
430
|
+
trigger?: {
|
|
431
|
+
refreshAfterConsolidation?: boolean;
|
|
432
|
+
tagsMatch?: TagsMatch;
|
|
433
|
+
};
|
|
434
|
+
signal?: AbortSignal;
|
|
435
|
+
},
|
|
436
|
+
): Promise<unknown>;
|
|
437
|
+
updateMentalModel?(
|
|
438
|
+
bankId: string,
|
|
439
|
+
mentalModelId: string,
|
|
440
|
+
options: {
|
|
441
|
+
name?: string;
|
|
442
|
+
sourceQuery?: string;
|
|
443
|
+
tags?: string[];
|
|
444
|
+
maxTokens?: number;
|
|
445
|
+
trigger?: {
|
|
446
|
+
refreshAfterConsolidation?: boolean;
|
|
447
|
+
tagsMatch?: TagsMatch;
|
|
448
|
+
};
|
|
449
|
+
signal?: AbortSignal;
|
|
450
|
+
},
|
|
451
|
+
): Promise<unknown>;
|
|
452
|
+
refreshMentalModel?(
|
|
453
|
+
bankId: string,
|
|
454
|
+
mentalModelId: string,
|
|
455
|
+
options?: { signal?: AbortSignal },
|
|
456
|
+
): Promise<unknown>;
|
|
457
|
+
deleteMentalModel?(
|
|
458
|
+
bankId: string,
|
|
459
|
+
mentalModelId: string,
|
|
460
|
+
options?: { dryRun?: boolean; signal?: AbortSignal },
|
|
461
|
+
): Promise<unknown>;
|
|
462
|
+
/** Knowledge pages (official wrappers in @vectorize-io/hindsight-client ^0.9.0). */
|
|
463
|
+
getKnowledgeBaseTree?(bankId: string, options?: { signal?: AbortSignal }): Promise<unknown>;
|
|
464
|
+
createKnowledgeFolder?(
|
|
465
|
+
bankId: string,
|
|
466
|
+
name: string,
|
|
467
|
+
options?: { parentId?: string | null; signal?: AbortSignal },
|
|
468
|
+
): Promise<unknown>;
|
|
469
|
+
createKnowledgePage?(
|
|
470
|
+
bankId: string,
|
|
471
|
+
name: string,
|
|
472
|
+
sourceQuery: string,
|
|
473
|
+
options?: {
|
|
474
|
+
parentId?: string | null;
|
|
475
|
+
tags?: string[];
|
|
476
|
+
maxTokens?: number;
|
|
477
|
+
/** When set, must restate page defaults (server replaces, does not merge). */
|
|
478
|
+
trigger?: {
|
|
479
|
+
mode?: "full" | "delta";
|
|
480
|
+
refreshAfterConsolidation?: boolean;
|
|
481
|
+
refreshCron?: string | null;
|
|
482
|
+
factTypes?: Array<"world" | "experience" | "observation">;
|
|
483
|
+
excludeMentalModels?: boolean;
|
|
484
|
+
excludeMentalModelIds?: string[];
|
|
485
|
+
tagsMatch?: TagsMatch;
|
|
486
|
+
tagGroups?: HindsightTagGroup[];
|
|
487
|
+
includeChunks?: boolean;
|
|
488
|
+
recallMaxTokens?: number;
|
|
489
|
+
recallChunksMaxTokens?: number;
|
|
490
|
+
};
|
|
491
|
+
signal?: AbortSignal;
|
|
492
|
+
},
|
|
493
|
+
): Promise<unknown>;
|
|
494
|
+
getKnowledgePage?(
|
|
495
|
+
bankId: string,
|
|
496
|
+
pageId: string,
|
|
497
|
+
options?: { signal?: AbortSignal },
|
|
498
|
+
): Promise<unknown>;
|
|
499
|
+
searchKnowledgeBase?(
|
|
500
|
+
bankId: string,
|
|
501
|
+
query: string,
|
|
502
|
+
options?: { limit?: number; signal?: AbortSignal },
|
|
503
|
+
): Promise<unknown>;
|
|
504
|
+
updateKnowledgeNode?(
|
|
505
|
+
bankId: string,
|
|
506
|
+
nodeId: string,
|
|
507
|
+
options: {
|
|
508
|
+
name?: string;
|
|
509
|
+
parentId?: string | null;
|
|
510
|
+
sourceQuery?: string;
|
|
511
|
+
tags?: string[];
|
|
512
|
+
maxTokens?: number;
|
|
513
|
+
signal?: AbortSignal;
|
|
514
|
+
},
|
|
515
|
+
): Promise<unknown>;
|
|
516
|
+
deleteKnowledgeNode?(
|
|
517
|
+
bankId: string,
|
|
518
|
+
nodeId: string,
|
|
519
|
+
options?: { signal?: AbortSignal },
|
|
520
|
+
): Promise<unknown>;
|
|
521
|
+
exportKnowledgeBase?(bankId: string, options?: { signal?: AbortSignal }): Promise<unknown>;
|
|
522
|
+
updateBankConfig?(
|
|
523
|
+
bankId: string,
|
|
524
|
+
options: {
|
|
525
|
+
reflectMission?: string;
|
|
526
|
+
retainMission?: string;
|
|
527
|
+
observationsMission?: string;
|
|
528
|
+
enableObservations?: boolean;
|
|
529
|
+
signal?: AbortSignal;
|
|
530
|
+
},
|
|
531
|
+
): Promise<unknown>;
|
|
532
|
+
health?(): Promise<unknown>;
|
|
533
|
+
getVersion?(): Promise<unknown>;
|
|
534
|
+
}
|