@inf-monkeys-tech/monkeys 1.0.13 → 1.0.15
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/lib/contracts/agent.d.ts +115 -0
- package/lib/contracts/agent.d.ts.map +1 -1
- package/lib/contracts/agent.js +39 -1
- package/lib/contracts/agent.js.map +1 -1
- package/lib/contracts/tenant.d.ts +30 -30
- package/lib/contracts/tenant.js +8 -8
- package/lib/contracts/tenant.js.map +1 -1
- package/lib/esm/contracts/index.mjs +47 -8
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +142 -8
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +878 -432
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +31 -8
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/json-schema/tenant-product-config.schema.json +11 -11
- package/lib/json-schema/tenant-runtime-config.schema.json +11 -11
- package/lib/runtime/agent-session-projector.d.ts +17 -0
- package/lib/runtime/agent-session-projector.d.ts.map +1 -0
- package/lib/runtime/agent-session-projector.js +85 -0
- package/lib/runtime/agent-session-projector.js.map +1 -0
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/schemas/index.d.ts +20 -20
- package/package.json +3 -1
- package/test/fixtures/agent-session-agent.json +134 -0
- package/test/fixtures/agent-session-chatbot.json +73 -0
- package/test/fixtures/agent-session-commands.json +72 -0
- package/test/fixtures/agent-session-kernel.json +131 -0
- package/test/fixtures/tenant-product-config.public.json +179 -0
|
@@ -2261,25 +2261,25 @@
|
|
|
2261
2261
|
"dataManagement": {
|
|
2262
2262
|
"type": "object",
|
|
2263
2263
|
"properties": {
|
|
2264
|
-
"
|
|
2264
|
+
"favoriteOntologyId": {
|
|
2265
2265
|
"type": "string"
|
|
2266
2266
|
},
|
|
2267
|
-
"
|
|
2267
|
+
"pairedOntologyId": {
|
|
2268
2268
|
"type": "string"
|
|
2269
2269
|
},
|
|
2270
|
-
"
|
|
2270
|
+
"galleryOntologyId": {
|
|
2271
2271
|
"type": "string"
|
|
2272
2272
|
},
|
|
2273
|
-
"
|
|
2273
|
+
"dataBrowserDefaultOntologyId": {
|
|
2274
2274
|
"type": "string"
|
|
2275
2275
|
},
|
|
2276
|
-
"
|
|
2276
|
+
"workflowResultOntologyId": {
|
|
2277
2277
|
"type": "string"
|
|
2278
2278
|
},
|
|
2279
2279
|
"homeAdvertisement": {
|
|
2280
2280
|
"type": "object",
|
|
2281
2281
|
"properties": {
|
|
2282
|
-
"
|
|
2282
|
+
"ontologyId": {
|
|
2283
2283
|
"type": "string",
|
|
2284
2284
|
"minLength": 1,
|
|
2285
2285
|
"maxLength": 256
|
|
@@ -2346,14 +2346,14 @@
|
|
|
2346
2346
|
}
|
|
2347
2347
|
},
|
|
2348
2348
|
"required": [
|
|
2349
|
-
"
|
|
2349
|
+
"ontologyId"
|
|
2350
2350
|
],
|
|
2351
2351
|
"additionalProperties": false
|
|
2352
2352
|
},
|
|
2353
2353
|
"homeTrendAssistant": {
|
|
2354
2354
|
"type": "object",
|
|
2355
2355
|
"properties": {
|
|
2356
|
-
"
|
|
2356
|
+
"ontologyId": {
|
|
2357
2357
|
"type": "string",
|
|
2358
2358
|
"minLength": 1,
|
|
2359
2359
|
"maxLength": 256
|
|
@@ -2439,11 +2439,11 @@
|
|
|
2439
2439
|
"mode": {
|
|
2440
2440
|
"type": "string",
|
|
2441
2441
|
"enum": [
|
|
2442
|
-
"
|
|
2443
|
-
"
|
|
2442
|
+
"sourceOntology",
|
|
2443
|
+
"ontology"
|
|
2444
2444
|
]
|
|
2445
2445
|
},
|
|
2446
|
-
"
|
|
2446
|
+
"ontologyId": {
|
|
2447
2447
|
"type": "string",
|
|
2448
2448
|
"minLength": 1,
|
|
2449
2449
|
"maxLength": 256
|
|
@@ -2195,25 +2195,25 @@
|
|
|
2195
2195
|
"dataManagement": {
|
|
2196
2196
|
"type": "object",
|
|
2197
2197
|
"properties": {
|
|
2198
|
-
"
|
|
2198
|
+
"favoriteOntologyId": {
|
|
2199
2199
|
"type": "string"
|
|
2200
2200
|
},
|
|
2201
|
-
"
|
|
2201
|
+
"pairedOntologyId": {
|
|
2202
2202
|
"type": "string"
|
|
2203
2203
|
},
|
|
2204
|
-
"
|
|
2204
|
+
"galleryOntologyId": {
|
|
2205
2205
|
"type": "string"
|
|
2206
2206
|
},
|
|
2207
|
-
"
|
|
2207
|
+
"dataBrowserDefaultOntologyId": {
|
|
2208
2208
|
"type": "string"
|
|
2209
2209
|
},
|
|
2210
|
-
"
|
|
2210
|
+
"workflowResultOntologyId": {
|
|
2211
2211
|
"type": "string"
|
|
2212
2212
|
},
|
|
2213
2213
|
"homeAdvertisement": {
|
|
2214
2214
|
"type": "object",
|
|
2215
2215
|
"properties": {
|
|
2216
|
-
"
|
|
2216
|
+
"ontologyId": {
|
|
2217
2217
|
"type": "string",
|
|
2218
2218
|
"minLength": 1,
|
|
2219
2219
|
"maxLength": 256
|
|
@@ -2280,14 +2280,14 @@
|
|
|
2280
2280
|
}
|
|
2281
2281
|
},
|
|
2282
2282
|
"required": [
|
|
2283
|
-
"
|
|
2283
|
+
"ontologyId"
|
|
2284
2284
|
],
|
|
2285
2285
|
"additionalProperties": false
|
|
2286
2286
|
},
|
|
2287
2287
|
"homeTrendAssistant": {
|
|
2288
2288
|
"type": "object",
|
|
2289
2289
|
"properties": {
|
|
2290
|
-
"
|
|
2290
|
+
"ontologyId": {
|
|
2291
2291
|
"type": "string",
|
|
2292
2292
|
"minLength": 1,
|
|
2293
2293
|
"maxLength": 256
|
|
@@ -2373,11 +2373,11 @@
|
|
|
2373
2373
|
"mode": {
|
|
2374
2374
|
"type": "string",
|
|
2375
2375
|
"enum": [
|
|
2376
|
-
"
|
|
2377
|
-
"
|
|
2376
|
+
"sourceOntology",
|
|
2377
|
+
"ontology"
|
|
2378
2378
|
]
|
|
2379
2379
|
},
|
|
2380
|
-
"
|
|
2380
|
+
"ontologyId": {
|
|
2381
2381
|
"type": "string",
|
|
2382
2382
|
"minLength": 1,
|
|
2383
2383
|
"maxLength": 256
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type AgentSessionEvent, type AgentSessionSnapshot, type AgentSessionStatus, type AgentSessionViewModel } from "../contracts/agent";
|
|
2
|
+
export interface AgentSessionEventGap {
|
|
3
|
+
expectedSequence: number;
|
|
4
|
+
receivedSequence: number;
|
|
5
|
+
}
|
|
6
|
+
export interface AgentSessionEventProjection {
|
|
7
|
+
sessionId: string;
|
|
8
|
+
events: AgentSessionEvent[];
|
|
9
|
+
lastSequence: number;
|
|
10
|
+
status: AgentSessionStatus;
|
|
11
|
+
resumable: boolean;
|
|
12
|
+
gap?: AgentSessionEventGap;
|
|
13
|
+
}
|
|
14
|
+
export declare function createAgentSessionEventProjection(sessionId: string): AgentSessionEventProjection;
|
|
15
|
+
export declare function projectAgentSessionEvents(current: AgentSessionEventProjection, candidates: readonly unknown[]): AgentSessionEventProjection;
|
|
16
|
+
export declare function toAgentSessionViewModel(projection: AgentSessionEventProjection, snapshot: AgentSessionSnapshot): AgentSessionViewModel;
|
|
17
|
+
//# sourceMappingURL=agent-session-projector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-session-projector.d.ts","sourceRoot":"","sources":["../../src/runtime/agent-session-projector.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,oBAAoB,CAAC;CAC5B;AAED,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,MAAM,GAChB,2BAA2B,CAQ7B;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,2BAA2B,EACpC,UAAU,EAAE,SAAS,OAAO,EAAE,GAC7B,2BAA2B,CA4E7B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,2BAA2B,EACvC,QAAQ,EAAE,oBAAoB,GAC7B,qBAAqB,CAUvB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toAgentSessionViewModel = exports.projectAgentSessionEvents = exports.createAgentSessionEventProjection = void 0;
|
|
4
|
+
const agent_1 = require("../contracts/agent");
|
|
5
|
+
function createAgentSessionEventProjection(sessionId) {
|
|
6
|
+
return {
|
|
7
|
+
sessionId,
|
|
8
|
+
events: [],
|
|
9
|
+
lastSequence: -1,
|
|
10
|
+
status: "queued",
|
|
11
|
+
resumable: false,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.createAgentSessionEventProjection = createAgentSessionEventProjection;
|
|
15
|
+
function projectAgentSessionEvents(current, candidates) {
|
|
16
|
+
const parsed = candidates.map((candidate) => agent_1.AgentSessionEventSchema.parse(candidate));
|
|
17
|
+
if (parsed.some((event) => event.sessionId !== current.sessionId)) {
|
|
18
|
+
throw new TypeError("Agent session event sessionId does not match the projection sessionId.");
|
|
19
|
+
}
|
|
20
|
+
const eventIds = new Set(current.events.map((event) => event.eventId));
|
|
21
|
+
const idempotencyKeys = new Set(current.events.map((event) => event.idempotencyKey));
|
|
22
|
+
const eventsBySequence = new Map(current.events.map((event) => [event.sequence, event]));
|
|
23
|
+
const acceptedCandidates = [];
|
|
24
|
+
for (const event of parsed.sort((left, right) => left.sequence - right.sequence)) {
|
|
25
|
+
if (eventIds.has(event.eventId) ||
|
|
26
|
+
idempotencyKeys.has(event.idempotencyKey))
|
|
27
|
+
continue;
|
|
28
|
+
const existing = eventsBySequence.get(event.sequence);
|
|
29
|
+
if (existing) {
|
|
30
|
+
throw new TypeError(`Conflicting Agent session events share sequence ${event.sequence}.`);
|
|
31
|
+
}
|
|
32
|
+
eventsBySequence.set(event.sequence, event);
|
|
33
|
+
eventIds.add(event.eventId);
|
|
34
|
+
idempotencyKeys.add(event.idempotencyKey);
|
|
35
|
+
acceptedCandidates.push(event);
|
|
36
|
+
}
|
|
37
|
+
for (const event of acceptedCandidates)
|
|
38
|
+
eventsBySequence.delete(event.sequence);
|
|
39
|
+
let expectedSequence = current.lastSequence + 1;
|
|
40
|
+
let gap;
|
|
41
|
+
for (const event of acceptedCandidates) {
|
|
42
|
+
if (event.sequence < expectedSequence) {
|
|
43
|
+
throw new TypeError(`Agent session event sequence ${event.sequence} is behind the recovery cursor.`);
|
|
44
|
+
}
|
|
45
|
+
if (event.sequence > expectedSequence) {
|
|
46
|
+
gap = { expectedSequence, receivedSequence: event.sequence };
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
eventsBySequence.set(event.sequence, event);
|
|
50
|
+
eventIds.add(event.eventId);
|
|
51
|
+
idempotencyKeys.add(event.idempotencyKey);
|
|
52
|
+
expectedSequence += 1;
|
|
53
|
+
}
|
|
54
|
+
const events = [...eventsBySequence.values()].sort((left, right) => left.sequence - right.sequence);
|
|
55
|
+
let status = "queued";
|
|
56
|
+
let resumable = false;
|
|
57
|
+
for (const event of events) {
|
|
58
|
+
if (event.eventType === "status")
|
|
59
|
+
status = event.payload.status;
|
|
60
|
+
if (event.eventType === "resume")
|
|
61
|
+
resumable = event.payload.resumable;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
sessionId: current.sessionId,
|
|
65
|
+
events,
|
|
66
|
+
lastSequence: events.length > 0 ? events[events.length - 1].sequence : -1,
|
|
67
|
+
status,
|
|
68
|
+
resumable,
|
|
69
|
+
...(gap ? { gap } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
exports.projectAgentSessionEvents = projectAgentSessionEvents;
|
|
73
|
+
function toAgentSessionViewModel(projection, snapshot) {
|
|
74
|
+
return agent_1.AgentSessionViewModelSchema.parse({
|
|
75
|
+
contract: "AgentSessionViewModel",
|
|
76
|
+
sessionId: projection.sessionId,
|
|
77
|
+
snapshot,
|
|
78
|
+
status: projection.status,
|
|
79
|
+
events: projection.events,
|
|
80
|
+
lastSequence: projection.lastSequence,
|
|
81
|
+
resumable: projection.resumable,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.toAgentSessionViewModel = toAgentSessionViewModel;
|
|
85
|
+
//# sourceMappingURL=agent-session-projector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-session-projector.js","sourceRoot":"","sources":["../../src/runtime/agent-session-projector.ts"],"names":[],"mappings":";;;AAAA,8CAO4B;AAgB5B,SAAgB,iCAAiC,CAC/C,SAAiB;IAEjB,OAAO;QACL,SAAS;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC,CAAC;QAChB,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,KAAK;KACjB,CAAC;AACJ,CAAC;AAVD,8EAUC;AAED,SAAgB,yBAAyB,CACvC,OAAoC,EACpC,UAA8B;IAE9B,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC1C,+BAAuB,CAAC,KAAK,CAAC,SAAS,CAAC,CACzC,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAClE,MAAM,IAAI,SAAS,CACjB,wEAAw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,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
package/lib/runtime/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./capability-registry"), exports);
|
|
18
|
+
__exportStar(require("./agent-session-projector"), exports);
|
|
18
19
|
__exportStar(require("./declaration-compiler"), exports);
|
|
19
20
|
__exportStar(require("./page-compiler"), exports);
|
|
20
21
|
__exportStar(require("./product-runtime"), exports);
|
package/lib/runtime/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,yDAAuC;AACvC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,4DAA0C;AAC1C,yDAAuC;AACvC,kDAAgC;AAChC,oDAAkC;AAClC,yDAAuC;AACvC,kDAAgC;AAChC,4DAA0C;AAC1C,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC"}
|
package/lib/schemas/index.d.ts
CHANGED
|
@@ -4192,13 +4192,13 @@ export declare const canonicalContractSchemas: {
|
|
|
4192
4192
|
rememberWorkflowModelSelection: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4193
4193
|
}, import("zod/v4/core").$strict>;
|
|
4194
4194
|
dataManagement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4195
|
+
favoriteOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4196
|
+
pairedOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4197
|
+
galleryOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4198
|
+
dataBrowserDefaultOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4199
|
+
workflowResultOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4200
4200
|
homeAdvertisement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4201
|
-
|
|
4201
|
+
ontologyId: import("zod").ZodString;
|
|
4202
4202
|
viewId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4203
4203
|
viewType: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
4204
4204
|
filter: "filter";
|
|
@@ -4222,7 +4222,7 @@ export declare const canonicalContractSchemas: {
|
|
|
4222
4222
|
columnIds: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
4223
4223
|
}, import("zod/v4/core").$strict>>;
|
|
4224
4224
|
homeTrendAssistant: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4225
|
-
|
|
4225
|
+
ontologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4226
4226
|
viewId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4227
4227
|
viewInstanceId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4228
4228
|
viewName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -4244,10 +4244,10 @@ export declare const canonicalContractSchemas: {
|
|
|
4244
4244
|
enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4245
4245
|
placement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4246
4246
|
mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
4247
|
-
|
|
4248
|
-
|
|
4247
|
+
sourceOntology: "sourceOntology";
|
|
4248
|
+
ontology: "ontology";
|
|
4249
4249
|
}>>;
|
|
4250
|
-
|
|
4250
|
+
ontologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4251
4251
|
parentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4252
4252
|
navId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4253
4253
|
}, import("zod/v4/core").$strict>>;
|
|
@@ -4912,13 +4912,13 @@ export declare const canonicalContractSchemas: {
|
|
|
4912
4912
|
rememberWorkflowModelSelection: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4913
4913
|
}, import("zod/v4/core").$strict>;
|
|
4914
4914
|
dataManagement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4915
|
+
favoriteOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4916
|
+
pairedOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4917
|
+
galleryOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4918
|
+
dataBrowserDefaultOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4919
|
+
workflowResultOntologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4920
4920
|
homeAdvertisement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4921
|
-
|
|
4921
|
+
ontologyId: import("zod").ZodString;
|
|
4922
4922
|
viewId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4923
4923
|
viewType: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
4924
4924
|
filter: "filter";
|
|
@@ -4942,7 +4942,7 @@ export declare const canonicalContractSchemas: {
|
|
|
4942
4942
|
columnIds: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
4943
4943
|
}, import("zod/v4/core").$strict>>;
|
|
4944
4944
|
homeTrendAssistant: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4945
|
-
|
|
4945
|
+
ontologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4946
4946
|
viewId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4947
4947
|
viewInstanceId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4948
4948
|
viewName: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -4964,10 +4964,10 @@ export declare const canonicalContractSchemas: {
|
|
|
4964
4964
|
enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
4965
4965
|
placement: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4966
4966
|
mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
4967
|
-
|
|
4968
|
-
|
|
4967
|
+
sourceOntology: "sourceOntology";
|
|
4968
|
+
ontology: "ontology";
|
|
4969
4969
|
}>>;
|
|
4970
|
-
|
|
4970
|
+
ontologyId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4971
4971
|
parentId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4972
4972
|
navId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4973
4973
|
}, import("zod/v4/core").$strict>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inf-monkeys-tech/monkeys",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "Monkeys JS SDK",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -29,11 +29,13 @@
|
|
|
29
29
|
"require": "./lib/runtime/index.js",
|
|
30
30
|
"default": "./lib/runtime/index.js"
|
|
31
31
|
},
|
|
32
|
+
"./fixtures/*": "./test/fixtures/*",
|
|
32
33
|
"./json-schema/*": "./lib/json-schema/*",
|
|
33
34
|
"./package.json": "./package.json"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"lib",
|
|
38
|
+
"test/fixtures",
|
|
37
39
|
"README.md"
|
|
38
40
|
],
|
|
39
41
|
"repository": {
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "AgentSessionViewModel",
|
|
3
|
+
"sessionId": "agent-session-1",
|
|
4
|
+
"snapshot": {
|
|
5
|
+
"mode": "agent",
|
|
6
|
+
"modelId": "openai:gpt-5.1-codex",
|
|
7
|
+
"capabilities": {
|
|
8
|
+
"text": true,
|
|
9
|
+
"reasoning": false,
|
|
10
|
+
"plan": false,
|
|
11
|
+
"tasks": false,
|
|
12
|
+
"tools": true,
|
|
13
|
+
"mcp": true,
|
|
14
|
+
"shell": true,
|
|
15
|
+
"fileChange": true,
|
|
16
|
+
"skills": true,
|
|
17
|
+
"approval": true,
|
|
18
|
+
"artifacts": true,
|
|
19
|
+
"usage": true,
|
|
20
|
+
"resume": true,
|
|
21
|
+
"diff": false,
|
|
22
|
+
"workspaceFiles": false,
|
|
23
|
+
"terminal": false,
|
|
24
|
+
"testResults": false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"status": "waiting_approval",
|
|
28
|
+
"events": [
|
|
29
|
+
{
|
|
30
|
+
"contract": "AgentSessionEvent",
|
|
31
|
+
"eventId": "agent-event-1",
|
|
32
|
+
"sessionId": "agent-session-1",
|
|
33
|
+
"sequence": 0,
|
|
34
|
+
"idempotencyKey": "agent-session-1:0",
|
|
35
|
+
"occurredAt": "2026-07-30T08:00:00.000Z",
|
|
36
|
+
"eventType": "status",
|
|
37
|
+
"payload": { "status": "running" }
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"contract": "AgentSessionEvent",
|
|
41
|
+
"eventId": "agent-event-2",
|
|
42
|
+
"sessionId": "agent-session-1",
|
|
43
|
+
"sequence": 1,
|
|
44
|
+
"idempotencyKey": "agent-session-1:1",
|
|
45
|
+
"occurredAt": "2026-07-30T08:00:01.000Z",
|
|
46
|
+
"eventType": "tool",
|
|
47
|
+
"payload": {
|
|
48
|
+
"toolCallId": "tool-1",
|
|
49
|
+
"toolName": "shell",
|
|
50
|
+
"status": "running",
|
|
51
|
+
"input": { "command": "git status" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"contract": "AgentSessionEvent",
|
|
56
|
+
"eventId": "agent-event-3",
|
|
57
|
+
"sessionId": "agent-session-1",
|
|
58
|
+
"sequence": 2,
|
|
59
|
+
"idempotencyKey": "agent-session-1:2",
|
|
60
|
+
"occurredAt": "2026-07-30T08:00:02.000Z",
|
|
61
|
+
"eventType": "approval",
|
|
62
|
+
"payload": {
|
|
63
|
+
"approvalId": "approval-1",
|
|
64
|
+
"toolCallId": "tool-1",
|
|
65
|
+
"status": "requested",
|
|
66
|
+
"title": "Run shell command",
|
|
67
|
+
"requestedAction": { "command": "git status" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"contract": "AgentSessionEvent",
|
|
72
|
+
"eventId": "agent-event-4",
|
|
73
|
+
"sessionId": "agent-session-1",
|
|
74
|
+
"sequence": 3,
|
|
75
|
+
"idempotencyKey": "agent-session-1:3",
|
|
76
|
+
"occurredAt": "2026-07-30T08:00:03.000Z",
|
|
77
|
+
"eventType": "artifact",
|
|
78
|
+
"payload": {
|
|
79
|
+
"artifactId": "artifact-1",
|
|
80
|
+
"name": "report.txt",
|
|
81
|
+
"kind": "file",
|
|
82
|
+
"status": "ready"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"contract": "AgentSessionEvent",
|
|
87
|
+
"eventId": "agent-event-5",
|
|
88
|
+
"sessionId": "agent-session-1",
|
|
89
|
+
"sequence": 4,
|
|
90
|
+
"idempotencyKey": "agent-session-1:4",
|
|
91
|
+
"occurredAt": "2026-07-30T08:00:04.000Z",
|
|
92
|
+
"eventType": "usage",
|
|
93
|
+
"payload": { "inputTokens": 24, "outputTokens": 8, "totalTokens": 32 }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"contract": "AgentSessionEvent",
|
|
97
|
+
"eventId": "agent-event-6",
|
|
98
|
+
"sessionId": "agent-session-1",
|
|
99
|
+
"sequence": 5,
|
|
100
|
+
"idempotencyKey": "agent-session-1:5",
|
|
101
|
+
"occurredAt": "2026-07-30T08:00:05.000Z",
|
|
102
|
+
"eventType": "resume",
|
|
103
|
+
"payload": { "resumable": true, "reason": "approval_required" }
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"contract": "AgentSessionEvent",
|
|
107
|
+
"eventId": "agent-event-7",
|
|
108
|
+
"sessionId": "agent-session-1",
|
|
109
|
+
"sequence": 6,
|
|
110
|
+
"idempotencyKey": "agent-session-1:6",
|
|
111
|
+
"occurredAt": "2026-07-30T08:00:06.000Z",
|
|
112
|
+
"eventType": "status",
|
|
113
|
+
"payload": { "status": "waiting_approval" }
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"contract": "AgentSessionEvent",
|
|
117
|
+
"eventId": "agent-event-8",
|
|
118
|
+
"sessionId": "agent-session-1",
|
|
119
|
+
"sequence": 7,
|
|
120
|
+
"idempotencyKey": "agent-session-1:7",
|
|
121
|
+
"occurredAt": "2026-07-30T08:00:07.000Z",
|
|
122
|
+
"eventType": "message",
|
|
123
|
+
"payload": {
|
|
124
|
+
"messageId": "agent-message-1",
|
|
125
|
+
"role": "assistant",
|
|
126
|
+
"operation": "append",
|
|
127
|
+
"parts": [{ "type": "text", "text": "Waiting for approval" }],
|
|
128
|
+
"status": "streaming"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"lastSequence": 7,
|
|
133
|
+
"resumable": true
|
|
134
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "AgentSessionViewModel",
|
|
3
|
+
"sessionId": "chatbot-session-1",
|
|
4
|
+
"snapshot": {
|
|
5
|
+
"mode": "chatbot",
|
|
6
|
+
"modelId": "openai:gpt-5.1",
|
|
7
|
+
"capabilities": {
|
|
8
|
+
"text": true,
|
|
9
|
+
"reasoning": false,
|
|
10
|
+
"plan": false,
|
|
11
|
+
"tasks": false,
|
|
12
|
+
"tools": true,
|
|
13
|
+
"mcp": true,
|
|
14
|
+
"shell": false,
|
|
15
|
+
"fileChange": false,
|
|
16
|
+
"skills": true,
|
|
17
|
+
"approval": true,
|
|
18
|
+
"artifacts": false,
|
|
19
|
+
"usage": true,
|
|
20
|
+
"resume": false,
|
|
21
|
+
"diff": false,
|
|
22
|
+
"workspaceFiles": false,
|
|
23
|
+
"terminal": false,
|
|
24
|
+
"testResults": false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"status": "completed",
|
|
28
|
+
"events": [
|
|
29
|
+
{
|
|
30
|
+
"contract": "AgentSessionEvent",
|
|
31
|
+
"eventId": "chatbot-event-1",
|
|
32
|
+
"sessionId": "chatbot-session-1",
|
|
33
|
+
"sequence": 0,
|
|
34
|
+
"idempotencyKey": "chatbot-session-1:0",
|
|
35
|
+
"occurredAt": "2026-07-30T08:00:00.000Z",
|
|
36
|
+
"eventType": "message",
|
|
37
|
+
"payload": {
|
|
38
|
+
"messageId": "chatbot-message-1",
|
|
39
|
+
"role": "assistant",
|
|
40
|
+
"operation": "append",
|
|
41
|
+
"parts": [{ "type": "text", "text": "Hello" }],
|
|
42
|
+
"status": "completed"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"contract": "AgentSessionEvent",
|
|
47
|
+
"eventId": "chatbot-event-2",
|
|
48
|
+
"sessionId": "chatbot-session-1",
|
|
49
|
+
"sequence": 1,
|
|
50
|
+
"idempotencyKey": "chatbot-session-1:1",
|
|
51
|
+
"occurredAt": "2026-07-30T08:00:01.000Z",
|
|
52
|
+
"eventType": "tool",
|
|
53
|
+
"payload": {
|
|
54
|
+
"toolCallId": "tool-1",
|
|
55
|
+
"toolName": "search",
|
|
56
|
+
"status": "completed",
|
|
57
|
+
"output": { "count": 1 }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"contract": "AgentSessionEvent",
|
|
62
|
+
"eventId": "chatbot-event-3",
|
|
63
|
+
"sessionId": "chatbot-session-1",
|
|
64
|
+
"sequence": 2,
|
|
65
|
+
"idempotencyKey": "chatbot-session-1:2",
|
|
66
|
+
"occurredAt": "2026-07-30T08:00:02.000Z",
|
|
67
|
+
"eventType": "usage",
|
|
68
|
+
"payload": { "inputTokens": 12, "outputTokens": 4, "totalTokens": 16 }
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"lastSequence": 2,
|
|
72
|
+
"resumable": false
|
|
73
|
+
}
|