@indexnetwork/protocol 0.16.0-rc.39.1 → 0.17.0-rc.41.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.
- package/README.md +0 -2
- package/dist/agent/agent.tools.d.ts +1 -1
- package/dist/agent/agent.tools.d.ts.map +1 -1
- package/dist/agent/agent.tools.js +5 -132
- package/dist/agent/agent.tools.js.map +1 -1
- package/dist/chat/chat.agent.d.ts +7 -0
- package/dist/chat/chat.agent.d.ts.map +1 -1
- package/dist/chat/chat.agent.js +16 -2
- package/dist/chat/chat.agent.js.map +1 -1
- package/dist/negotiation/negotiation.graph.d.ts +12 -0
- package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
- package/dist/negotiation/negotiation.graph.js +27 -5
- package/dist/negotiation/negotiation.graph.js.map +1 -1
- package/dist/opportunity/opportunity.discover.d.ts +19 -0
- package/dist/opportunity/opportunity.discover.d.ts.map +1 -1
- package/dist/opportunity/opportunity.discover.js +25 -2
- package/dist/opportunity/opportunity.discover.js.map +1 -1
- package/dist/opportunity/opportunity.enricher.d.ts +20 -1
- package/dist/opportunity/opportunity.enricher.d.ts.map +1 -1
- package/dist/opportunity/opportunity.enricher.js +15 -1
- package/dist/opportunity/opportunity.enricher.js.map +1 -1
- package/dist/opportunity/opportunity.graph.d.ts +57 -0
- package/dist/opportunity/opportunity.graph.d.ts.map +1 -1
- package/dist/opportunity/opportunity.graph.js +92 -5
- package/dist/opportunity/opportunity.graph.js.map +1 -1
- package/dist/opportunity/opportunity.state.d.ts +65 -0
- package/dist/opportunity/opportunity.state.d.ts.map +1 -1
- package/dist/opportunity/opportunity.state.js +50 -0
- package/dist/opportunity/opportunity.state.js.map +1 -1
- package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
- package/dist/opportunity/opportunity.tools.js +15 -0
- package/dist/opportunity/opportunity.tools.js.map +1 -1
- package/dist/shared/agent/tool.helpers.d.ts +3 -3
- package/dist/shared/agent/tool.helpers.js +3 -3
- package/dist/shared/interfaces/agent.interface.d.ts +2 -2
- package/dist/shared/interfaces/agent.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/database.interface.d.ts +13 -3
- package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
- package/dist/shared/observability/request-context.d.ts +30 -1
- package/dist/shared/observability/request-context.d.ts.map +1 -1
- package/dist/shared/observability/request-context.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,43 @@
|
|
|
1
|
+
import type { Opportunity } from "../interfaces/database.interface.js";
|
|
1
2
|
import { AsyncLocalStorage } from "async_hooks";
|
|
2
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Callback for streaming trace / domain events from deep inside graph nodes
|
|
5
|
+
* back to the caller (typically chat.agent's stream pipeline).
|
|
6
|
+
*
|
|
7
|
+
* Carries two flavors of event:
|
|
8
|
+
* - Trace events (`graph_start | graph_end | agent_start | agent_end`) — used
|
|
9
|
+
* by the chat TRACE panel to visualize what the agent is doing.
|
|
10
|
+
* - Domain events (`opportunity_draft_ready`) — emitted by the orchestrator
|
|
11
|
+
* branch of OpportunityGraph.negotiateNode so the frontend can render each
|
|
12
|
+
* accepted draft card progressively as its negotiation resolves.
|
|
13
|
+
*
|
|
14
|
+
* Kept as a single emitter rather than splitting into two to minimize plumbing
|
|
15
|
+
* through AsyncLocalStorage; the chat.agent relay branches on event.type.
|
|
16
|
+
*/
|
|
3
17
|
export type TraceEmitter = (event: {
|
|
4
18
|
type: "graph_start" | "graph_end" | "agent_start" | "agent_end";
|
|
5
19
|
name: string;
|
|
6
20
|
durationMs?: number;
|
|
7
21
|
summary?: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: "opportunity_draft_ready";
|
|
24
|
+
opportunityId: string;
|
|
25
|
+
opportunity: Opportunity;
|
|
8
26
|
}) => void;
|
|
9
27
|
interface RequestContext {
|
|
10
28
|
originUrl?: string;
|
|
11
29
|
traceEmitter?: TraceEmitter;
|
|
30
|
+
/**
|
|
31
|
+
* Signal for cooperative cancellation — propagates the caller's AbortSignal
|
|
32
|
+
* into long-running graph nodes (e.g. orchestrator negotiation fan-out) so
|
|
33
|
+
* they can stop emitting events when the chat session closes.
|
|
34
|
+
*
|
|
35
|
+
* The orchestrator branch checks this before persisting status flips or
|
|
36
|
+
* pushing `opportunity_draft_ready` events. In-flight negotiations are not
|
|
37
|
+
* forcibly cancelled — they finish or time out naturally via their park
|
|
38
|
+
* window — but their results are suppressed once the signal trips.
|
|
39
|
+
*/
|
|
40
|
+
abortSignal?: AbortSignal;
|
|
12
41
|
}
|
|
13
42
|
/**
|
|
14
43
|
* AsyncLocalStorage for propagating request-scoped context through the protocol layer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../../src/shared/observability/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../../src/shared/observability/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,KAAK,EACD;IACE,IAAI,EAAE,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACD;IACE,IAAI,EAAE,yBAAyB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;CAC1B,KACF,IAAI,CAAC;AAEV,UAAU,cAAc;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,mCAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../../src/shared/observability/request-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-context.js","sourceRoot":"","sources":["../../../src/shared/observability/request-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA+ChD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iBAAiB,EAAkB,CAAC"}
|