@indexnetwork/protocol 66.0.0-rc.619.1 → 66.0.0-rc.621.1

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.
@@ -73,6 +73,8 @@ export declare class Intents {
73
73
  archive: boolean;
74
74
  status: "active" | "paused" | undefined;
75
75
  expectedIntentFingerprint: string | undefined;
76
+ sourceType: string | null | undefined;
77
+ sourceId: string | null | undefined;
76
78
  networkId: string | undefined;
77
79
  networkIds: string[] | undefined;
78
80
  scopeType: import("../index.js").ScopeType | undefined;
@@ -123,6 +125,8 @@ export declare class Intents {
123
125
  archive?: boolean | import("@langchain/langgraph").OverwriteValue<boolean> | undefined;
124
126
  status?: "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined;
125
127
  expectedIntentFingerprint?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
128
+ sourceType?: string | null | undefined;
129
+ sourceId?: string | null | undefined;
126
130
  networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
127
131
  networkIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined;
128
132
  scopeType?: import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined;
@@ -214,6 +218,16 @@ export declare class Intents {
214
218
  archive: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
215
219
  status: import("@langchain/langgraph").BaseChannel<"active" | "paused" | undefined, "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined, unknown>;
216
220
  expectedIntentFingerprint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
221
+ sourceType: {
222
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
223
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
224
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
225
+ };
226
+ sourceId: {
227
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
228
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
229
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
230
+ };
217
231
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
218
232
  networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
219
233
  scopeType: import("@langchain/langgraph").BaseChannel<import("../index.js").ScopeType | undefined, import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined, unknown>;
@@ -326,6 +340,16 @@ export declare class Intents {
326
340
  archive: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
327
341
  status: import("@langchain/langgraph").BaseChannel<"active" | "paused" | undefined, "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined, unknown>;
328
342
  expectedIntentFingerprint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
343
+ sourceType: {
344
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
345
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
346
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
347
+ };
348
+ sourceId: {
349
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
350
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
351
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
352
+ };
329
353
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
330
354
  networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
331
355
  scopeType: import("@langchain/langgraph").BaseChannel<import("../index.js").ScopeType | undefined, import("../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../index.js").ScopeType | undefined> | undefined, unknown>;
@@ -31,6 +31,8 @@ export declare class IntentGraphFactory {
31
31
  archive: boolean;
32
32
  status: "active" | "paused" | undefined;
33
33
  expectedIntentFingerprint: string | undefined;
34
+ sourceType: string | null | undefined;
35
+ sourceId: string | null | undefined;
34
36
  networkId: string | undefined;
35
37
  networkIds: string[] | undefined;
36
38
  scopeType: import("../../../index.js").ScopeType | undefined;
@@ -81,6 +83,8 @@ export declare class IntentGraphFactory {
81
83
  archive?: boolean | import("@langchain/langgraph").OverwriteValue<boolean> | undefined;
82
84
  status?: "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined;
83
85
  expectedIntentFingerprint?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
86
+ sourceType?: string | null | undefined;
87
+ sourceId?: string | null | undefined;
84
88
  networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
85
89
  networkIds?: string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined;
86
90
  scopeType?: import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined;
@@ -172,6 +176,16 @@ export declare class IntentGraphFactory {
172
176
  archive: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
173
177
  status: import("@langchain/langgraph").BaseChannel<"active" | "paused" | undefined, "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined, unknown>;
174
178
  expectedIntentFingerprint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
179
+ sourceType: {
180
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
181
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
182
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
183
+ };
184
+ sourceId: {
185
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
186
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
187
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
188
+ };
175
189
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
176
190
  networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
177
191
  scopeType: import("@langchain/langgraph").BaseChannel<import("../../../index.js").ScopeType | undefined, import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined, unknown>;
@@ -284,6 +298,16 @@ export declare class IntentGraphFactory {
284
298
  archive: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
285
299
  status: import("@langchain/langgraph").BaseChannel<"active" | "paused" | undefined, "active" | "paused" | import("@langchain/langgraph").OverwriteValue<"active" | "paused" | undefined> | undefined, unknown>;
286
300
  expectedIntentFingerprint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
301
+ sourceType: {
302
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
303
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
304
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
305
+ };
306
+ sourceId: {
307
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
308
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
309
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
310
+ };
287
311
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
288
312
  networkIds: import("@langchain/langgraph").BaseChannel<string[] | undefined, string[] | import("@langchain/langgraph").OverwriteValue<string[] | undefined> | undefined, unknown>;
289
313
  scopeType: import("@langchain/langgraph").BaseChannel<import("../../../index.js").ScopeType | undefined, import("../../../index.js").ScopeType | import("@langchain/langgraph").OverwriteValue<import("../../../index.js").ScopeType | undefined> | undefined, unknown>;
@@ -39,7 +39,8 @@ export async function executorNode(state, deps) {
39
39
  payload,
40
40
  confidence: 1.0,
41
41
  inferenceType: 'explicit',
42
- sourceType: 'discovery_form',
42
+ sourceType: state.sourceType ?? null,
43
+ sourceId: state.sourceId ?? null,
43
44
  embedding: flatEmbedding,
44
45
  semanticEntropy: metadata?.semanticEntropy ?? null,
45
46
  referentialAnchor: metadata?.referentialAnchor ?? null,
@@ -88,6 +89,8 @@ export async function executorNode(state, deps) {
88
89
  felicityClarity: matchedVerifiedIntent?.verification?.felicity_scores.clarity ?? null,
89
90
  intentMode: updateAction.intentMode ?? null,
90
91
  speechActType: toSpeechActType(matchedVerifiedIntent?.verification?.classification),
92
+ ...(state.sourceType !== undefined ? { sourceType: state.sourceType } : {}),
93
+ ...(state.sourceId !== undefined ? { sourceId: state.sourceId } : {}),
91
94
  ...(state.expectedIntentFingerprint !== undefined ? {
92
95
  expectedIntentFingerprint: state.expectedIntentFingerprint,
93
96
  expectedIntentUserId: state.userId,
@@ -154,6 +154,18 @@ export declare const IntentGraphState: import("@langchain/langgraph").Annotation
154
154
  * updates. The database rechecks it while holding the final intent row lock.
155
155
  */
156
156
  expectedIntentFingerprint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
157
+ /** Client-owned label written on create or update. Undefined leaves it; null clears it. */
158
+ sourceType: {
159
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
160
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
161
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
162
+ };
163
+ /** Client-owned reference written on create or update. Undefined leaves it; null clears it. */
164
+ sourceId: {
165
+ (annotation: import("@langchain/langgraph").SingleReducer<string | null | undefined, string | null | undefined>): import("@langchain/langgraph").BaseChannel<string | null | undefined, string | import("@langchain/langgraph").OverwriteValue<string | null | undefined> | null | undefined, unknown>;
166
+ (): import("@langchain/langgraph").LastValue<string | null | undefined>;
167
+ Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
168
+ };
157
169
  /**
158
170
  * Optional network scope (network ID) for read operations. Prep always
159
171
  * fetches ALL user intents via getActiveIntents(userId) regardless of network
@@ -64,6 +64,10 @@ export const IntentGraphState = Annotation.Root({
64
64
  reducer: (curr, next) => next ?? curr,
65
65
  default: () => undefined,
66
66
  }),
67
+ /** Client-owned label written on create or update. Undefined leaves it; null clears it. */
68
+ sourceType: (Annotation),
69
+ /** Client-owned reference written on create or update. Undefined leaves it; null clears it. */
70
+ sourceId: (Annotation),
67
71
  /**
68
72
  * Optional network scope (network ID) for read operations. Prep always
69
73
  * fetches ALL user intents via getActiveIntents(userId) regardless of network
@@ -155,10 +155,10 @@ export interface CreateIntentData {
155
155
  isIncognito?: boolean;
156
156
  /** Network IDs to associate with (optional, uses dynamic scoping if empty) */
157
157
  networkIds?: string[];
158
- /** Source type for provenance tracking */
159
- sourceType?: 'integration' | 'discovery_form' | 'enrichment';
160
- /** Source ID for provenance tracking */
161
- sourceId?: string;
158
+ /** Client-owned label, stored and returned unchanged */
159
+ sourceType?: string | null;
160
+ /** Client-owned reference, stored and returned unchanged */
161
+ sourceId?: string | null;
162
162
  /** Confidence score from inference (0-1, required) */
163
163
  confidence: number;
164
164
  /** How the intent was inferred */
@@ -191,6 +191,10 @@ export interface UpdateIntentData {
191
191
  embedding?: number[];
192
192
  /** Updated incognito status */
193
193
  isIncognito?: boolean;
194
+ /** Client-owned label; null clears it */
195
+ sourceType?: string | null;
196
+ /** Client-owned reference; null clears it */
197
+ sourceId?: string | null;
194
198
  /** Updated network associations (replaces existing) */
195
199
  networkIds?: string[];
196
200
  /** Semantic entropy from verifier (0 specific -> 1 vague) */
@@ -244,9 +248,9 @@ export interface IntentRecord extends CreatedIntent {
244
248
  archivedAt: Date | null;
245
249
  /** Embedding vector (may be null) */
246
250
  embedding?: number[] | null;
247
- /** Source type for provenance */
251
+ /** Client-owned label */
248
252
  sourceType?: string | null;
249
- /** Source ID for provenance */
253
+ /** Client-owned reference */
250
254
  sourceId?: string | null;
251
255
  /** Lifecycle admission state; null is a legacy active row. */
252
256
  status?: 'active' | 'paused' | null;
@@ -85,7 +85,6 @@ export interface DatabaseIdentityQueries {
85
85
  * payload: action.payload,
86
86
  * confidence: action.score / 100,
87
87
  * inferenceType: 'explicit',
88
- * sourceType: 'discovery_form'
89
88
  * });
90
89
  * ```
91
90
  */
@@ -84,6 +84,10 @@ Identity is account/presentation metadata. Context is dynamic, scoped runtime st
84
84
  - Confidence (0-1, how well the inference captured the user's intent)
85
85
  - Inference type (explicit = user stated directly; implicit = system inferred)
86
86
  - Embedding (semantic vector for matching)
87
+ - Source type and source ID (optional client-owned strings, set on create or update, stored and returned unchanged)
88
+
89
+ ### Source Fields
90
+ Clients may set \`sourceType\` and \`sourceId\` to map their own records to a published signal. An agent that inferred an ambient intent can pass its local id as \`sourceId\` when the owner approves publishing it, then match the signal back by that value. Index does not interpret either field. Omit a field to leave it unchanged; null clears it.
87
91
 
88
92
  ### Signal Lifecycle
89
93
  1. User creates intent (explicit signal) or system infers from behavior (implicit)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "66.0.0-rc.619.1",
3
+ "version": "66.0.0-rc.621.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",