@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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": [
|
|
3
|
+
{
|
|
4
|
+
"contract": "AgentSessionCommand",
|
|
5
|
+
"commandId": "command-stop-1",
|
|
6
|
+
"sessionId": "agent-session-1",
|
|
7
|
+
"idempotencyKey": "agent-session-1:stop:1",
|
|
8
|
+
"expectedSequence": 2,
|
|
9
|
+
"issuedAt": "2026-07-30T00:00:00.000Z",
|
|
10
|
+
"commandType": "stop",
|
|
11
|
+
"payload": { "reason": "User requested stop." }
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"contract": "AgentSessionCommand",
|
|
15
|
+
"commandId": "command-resume-1",
|
|
16
|
+
"sessionId": "agent-session-1",
|
|
17
|
+
"idempotencyKey": "agent-session-1:resume:1",
|
|
18
|
+
"expectedSequence": 4,
|
|
19
|
+
"issuedAt": "2026-07-30T00:01:00.000Z",
|
|
20
|
+
"commandType": "resume",
|
|
21
|
+
"payload": { "resumeEventId": "resume-event-1" }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"contract": "AgentSessionCommand",
|
|
25
|
+
"commandId": "command-retry-1",
|
|
26
|
+
"sessionId": "agent-session-1",
|
|
27
|
+
"idempotencyKey": "agent-session-1:retry:1",
|
|
28
|
+
"expectedSequence": 6,
|
|
29
|
+
"issuedAt": "2026-07-30T00:02:00.000Z",
|
|
30
|
+
"commandType": "retry",
|
|
31
|
+
"payload": { "sourceEventId": "error-event-1" }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"contract": "AgentSessionCommand",
|
|
35
|
+
"commandId": "command-approval-1",
|
|
36
|
+
"sessionId": "agent-session-1",
|
|
37
|
+
"idempotencyKey": "agent-session-1:approval:1",
|
|
38
|
+
"expectedSequence": 8,
|
|
39
|
+
"issuedAt": "2026-07-30T00:03:00.000Z",
|
|
40
|
+
"commandType": "approval",
|
|
41
|
+
"payload": { "approvalId": "approval-1", "decision": "approved" }
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"results": [
|
|
45
|
+
{
|
|
46
|
+
"contract": "AgentSessionCommandResult",
|
|
47
|
+
"commandId": "command-stop-1",
|
|
48
|
+
"sessionId": "agent-session-1",
|
|
49
|
+
"idempotencyKey": "agent-session-1:stop:1",
|
|
50
|
+
"outcome": "accepted",
|
|
51
|
+
"sessionStatus": "stopping",
|
|
52
|
+
"acceptedSequence": 3,
|
|
53
|
+
"resultEventIds": ["status-event-3"],
|
|
54
|
+
"occurredAt": "2026-07-30T00:00:00.100Z"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"contract": "AgentSessionCommandResult",
|
|
58
|
+
"commandId": "command-retry-2",
|
|
59
|
+
"sessionId": "agent-session-1",
|
|
60
|
+
"idempotencyKey": "agent-session-1:retry:2",
|
|
61
|
+
"outcome": "rejected",
|
|
62
|
+
"sessionStatus": "completed",
|
|
63
|
+
"resultEventIds": [],
|
|
64
|
+
"error": {
|
|
65
|
+
"code": "INVALID_SESSION_STATE",
|
|
66
|
+
"message": "Retry requires a failed session.",
|
|
67
|
+
"retryable": false
|
|
68
|
+
},
|
|
69
|
+
"occurredAt": "2026-07-30T00:04:00.000Z"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "AgentSessionViewModel",
|
|
3
|
+
"sessionId": "kernel-session-1",
|
|
4
|
+
"snapshot": {
|
|
5
|
+
"mode": "agent",
|
|
6
|
+
"modelId": "kernel:claude-code",
|
|
7
|
+
"capabilities": {
|
|
8
|
+
"text": true,
|
|
9
|
+
"reasoning": true,
|
|
10
|
+
"plan": false,
|
|
11
|
+
"tasks": false,
|
|
12
|
+
"tools": true,
|
|
13
|
+
"mcp": false,
|
|
14
|
+
"shell": true,
|
|
15
|
+
"fileChange": true,
|
|
16
|
+
"skills": false,
|
|
17
|
+
"approval": true,
|
|
18
|
+
"artifacts": true,
|
|
19
|
+
"usage": false,
|
|
20
|
+
"resume": true,
|
|
21
|
+
"diff": false,
|
|
22
|
+
"workspaceFiles": true,
|
|
23
|
+
"terminal": true,
|
|
24
|
+
"testResults": false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"status": "running",
|
|
28
|
+
"events": [
|
|
29
|
+
{
|
|
30
|
+
"contract": "AgentSessionEvent",
|
|
31
|
+
"eventId": "kernel-event-1",
|
|
32
|
+
"sessionId": "kernel-session-1",
|
|
33
|
+
"sequence": 0,
|
|
34
|
+
"idempotencyKey": "kernel-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": "kernel-event-2",
|
|
42
|
+
"sessionId": "kernel-session-1",
|
|
43
|
+
"sequence": 1,
|
|
44
|
+
"idempotencyKey": "kernel-session-1:1",
|
|
45
|
+
"occurredAt": "2026-07-30T08:00:01.000Z",
|
|
46
|
+
"eventType": "workspace-file",
|
|
47
|
+
"payload": {
|
|
48
|
+
"path": "src/index.ts",
|
|
49
|
+
"operation": "upsert",
|
|
50
|
+
"mimeType": "text/typescript",
|
|
51
|
+
"size": 128
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"contract": "AgentSessionEvent",
|
|
56
|
+
"eventId": "kernel-event-3",
|
|
57
|
+
"sessionId": "kernel-session-1",
|
|
58
|
+
"sequence": 2,
|
|
59
|
+
"idempotencyKey": "kernel-session-1:2",
|
|
60
|
+
"occurredAt": "2026-07-30T08:00:02.000Z",
|
|
61
|
+
"eventType": "terminal",
|
|
62
|
+
"payload": {
|
|
63
|
+
"terminalId": "terminal-1",
|
|
64
|
+
"stream": "stdout",
|
|
65
|
+
"chunk": "Tests passed\n"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"contract": "AgentSessionEvent",
|
|
70
|
+
"eventId": "kernel-event-4",
|
|
71
|
+
"sessionId": "kernel-session-1",
|
|
72
|
+
"sequence": 3,
|
|
73
|
+
"idempotencyKey": "kernel-session-1:3",
|
|
74
|
+
"occurredAt": "2026-07-30T08:00:03.000Z",
|
|
75
|
+
"eventType": "message",
|
|
76
|
+
"payload": {
|
|
77
|
+
"messageId": "kernel-message-1",
|
|
78
|
+
"role": "assistant",
|
|
79
|
+
"operation": "append",
|
|
80
|
+
"parts": [{ "type": "text", "text": "Tests passed" }],
|
|
81
|
+
"status": "completed"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"contract": "AgentSessionEvent",
|
|
86
|
+
"eventId": "kernel-event-5",
|
|
87
|
+
"sessionId": "kernel-session-1",
|
|
88
|
+
"sequence": 4,
|
|
89
|
+
"idempotencyKey": "kernel-session-1:4",
|
|
90
|
+
"occurredAt": "2026-07-30T08:00:04.000Z",
|
|
91
|
+
"eventType": "reasoning",
|
|
92
|
+
"payload": {
|
|
93
|
+
"reasoningId": "kernel-reasoning-1",
|
|
94
|
+
"text": "Checking tests",
|
|
95
|
+
"status": "completed"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"contract": "AgentSessionEvent",
|
|
100
|
+
"eventId": "kernel-event-6",
|
|
101
|
+
"sessionId": "kernel-session-1",
|
|
102
|
+
"sequence": 5,
|
|
103
|
+
"idempotencyKey": "kernel-session-1:5",
|
|
104
|
+
"occurredAt": "2026-07-30T08:00:05.000Z",
|
|
105
|
+
"eventType": "tool",
|
|
106
|
+
"payload": {
|
|
107
|
+
"toolCallId": "kernel-tool-1",
|
|
108
|
+
"toolName": "shell",
|
|
109
|
+
"status": "completed",
|
|
110
|
+
"output": "Tests passed"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"contract": "AgentSessionEvent",
|
|
115
|
+
"eventId": "kernel-event-7",
|
|
116
|
+
"sessionId": "kernel-session-1",
|
|
117
|
+
"sequence": 6,
|
|
118
|
+
"idempotencyKey": "kernel-session-1:6",
|
|
119
|
+
"occurredAt": "2026-07-30T08:00:06.000Z",
|
|
120
|
+
"eventType": "artifact",
|
|
121
|
+
"payload": {
|
|
122
|
+
"artifactId": "kernel-artifact-1",
|
|
123
|
+
"name": "test.log",
|
|
124
|
+
"kind": "file",
|
|
125
|
+
"status": "ready"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"lastSequence": 6,
|
|
130
|
+
"resumable": true
|
|
131
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "TenantProductConfig",
|
|
3
|
+
"tenantId": "tenant-a",
|
|
4
|
+
"appId": "concept",
|
|
5
|
+
"environment": "production",
|
|
6
|
+
"designTokens": {
|
|
7
|
+
"tokenSources": [
|
|
8
|
+
{ "type": "file", "path": "./base.tokens.json" },
|
|
9
|
+
{ "type": "url", "url": "https://cdn.example.test/tenant.tokens.json" }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"moduleRefs": ["studio", "kernel", "compute"],
|
|
13
|
+
"pageRefs": ["workflow-page"],
|
|
14
|
+
"featureFlags": { "enhanced": true },
|
|
15
|
+
"authBinding": { "issuer": "auth.primary" },
|
|
16
|
+
"dataBinding": { "assets": "data.primary" },
|
|
17
|
+
"sourceMap": { "applicationConfig.theme": "yaml" },
|
|
18
|
+
"warnings": [],
|
|
19
|
+
"applicationConfig": {
|
|
20
|
+
"theme": {
|
|
21
|
+
"id": "tenant-a",
|
|
22
|
+
"title": "Monkeys",
|
|
23
|
+
"logo": { "light": "/logo-light.svg", "dark": "/logo-dark.svg" },
|
|
24
|
+
"agent": {
|
|
25
|
+
"logo": { "light": "/agent-logo-light.svg", "dark": "/agent-logo-dark.svg" }
|
|
26
|
+
},
|
|
27
|
+
"favicon": { "light": "/favicon-light.svg", "dark": "/favicon-dark.svg" },
|
|
28
|
+
"form": { "variant": "bento" },
|
|
29
|
+
"toast": { "position": "top-right" },
|
|
30
|
+
"icons": { "empty": { "type": "svg", "url": "/empty.svg" } },
|
|
31
|
+
"views": {
|
|
32
|
+
"form": {
|
|
33
|
+
"toast": { "afterCreate": true, "afterDelete": true },
|
|
34
|
+
"progress": "estimate",
|
|
35
|
+
"onlyResult": false,
|
|
36
|
+
"tabular": { "theme": "default" }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"hideSpaceHeader": false,
|
|
40
|
+
"showSidebarTeamSelector": true,
|
|
41
|
+
"showWorkbenchSidebar": true,
|
|
42
|
+
"workbenchViewTheme": "bsd-blue",
|
|
43
|
+
"defaults": {
|
|
44
|
+
"showFormInImageDetail": true,
|
|
45
|
+
"darkMode": "auto",
|
|
46
|
+
"language": "zh-CN",
|
|
47
|
+
"showDarkModeToggle": true,
|
|
48
|
+
"showLanguageToggle": true
|
|
49
|
+
},
|
|
50
|
+
"modules": {
|
|
51
|
+
"monkeysSpaceSidebar": "*",
|
|
52
|
+
"monkeysSpaceHeadbar": [{ "id": "workbench", "visible": true }],
|
|
53
|
+
"settingsSidebar": "*"
|
|
54
|
+
},
|
|
55
|
+
"headbar": {
|
|
56
|
+
"theme": "glassy",
|
|
57
|
+
"navPosition": "center",
|
|
58
|
+
"actions": ["team-selector"],
|
|
59
|
+
"profile": "*",
|
|
60
|
+
"showTeamQuota": true
|
|
61
|
+
},
|
|
62
|
+
"kernelLayout": {
|
|
63
|
+
"navigationMode": "sidebar",
|
|
64
|
+
"allowNavigationModeSwitch": true,
|
|
65
|
+
"headbar": {
|
|
66
|
+
"theme": "card",
|
|
67
|
+
"layoutMode": "boxed",
|
|
68
|
+
"heightPx": 52,
|
|
69
|
+
"menuRadius": "lg"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"workflowPreviewExecutionGrid": {
|
|
73
|
+
"selectionModeDisplayType": "operation-button",
|
|
74
|
+
"clickBehavior": "preview",
|
|
75
|
+
"displayType": "masonry",
|
|
76
|
+
"showErrorFilter": true,
|
|
77
|
+
"showDetailButton": true
|
|
78
|
+
},
|
|
79
|
+
"workbenchSidebarDefaultOpen": true,
|
|
80
|
+
"workbenchSidebarMoreAction": true,
|
|
81
|
+
"workbenchSidebarApart": false,
|
|
82
|
+
"workbenchSidebarToggleGroupDetail": true,
|
|
83
|
+
"workbenchSidebarViewType": true,
|
|
84
|
+
"workbenchSidebarFormViewEmbed": false,
|
|
85
|
+
"workbenchSidebarModernMode": true,
|
|
86
|
+
"ugc": { "onItemClick": true, "subtitle": true },
|
|
87
|
+
"uniImagePreview": true,
|
|
88
|
+
"imagePreviewStyle": false,
|
|
89
|
+
"teamAsUser": false,
|
|
90
|
+
"themeMode": "border",
|
|
91
|
+
"density": "default",
|
|
92
|
+
"miniMode": { "showPreviewViewExecutionResultGrid": true },
|
|
93
|
+
"workflow": { "allowConcurrentRuns": true },
|
|
94
|
+
"historyResult": { "display": true },
|
|
95
|
+
"uploader": { "orientation": "horizontal", "pasteButton": true, "statusText": true },
|
|
96
|
+
"designProjects": {
|
|
97
|
+
"oneOnOne": true,
|
|
98
|
+
"newTabOpenBoard": true,
|
|
99
|
+
"createDefaultFrame": true,
|
|
100
|
+
"showPageMenu": false,
|
|
101
|
+
"showMainMenu": false,
|
|
102
|
+
"showStylePanel": false,
|
|
103
|
+
"showToolbar": true,
|
|
104
|
+
"showContextMenu": true,
|
|
105
|
+
"showActionsMenu": true
|
|
106
|
+
},
|
|
107
|
+
"workbench": {
|
|
108
|
+
"pages": [],
|
|
109
|
+
"pageGroups": [],
|
|
110
|
+
"catalog": { "enabled": true, "defaultEntry": false },
|
|
111
|
+
"quickSwitcherMaxItems": 6,
|
|
112
|
+
"customers": {
|
|
113
|
+
"layoutManagerEnabled": true,
|
|
114
|
+
"historyColumnsDefault": 3,
|
|
115
|
+
"studioTabsMode": "dropdown"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"initTeam": false,
|
|
119
|
+
"imageThumbnail": true,
|
|
120
|
+
"pages": { "allowPageKeys": "*", "defaultPageKey": "workbench" }
|
|
121
|
+
},
|
|
122
|
+
"auth": {
|
|
123
|
+
"enabled": ["password", "oidc"],
|
|
124
|
+
"oidc": { "buttonText": "SSO", "autoSignin": false },
|
|
125
|
+
"password": { "disableAutoRegister": false },
|
|
126
|
+
"hideAuthToast": false,
|
|
127
|
+
"autoReload": true,
|
|
128
|
+
"defaultOtherTeam": false
|
|
129
|
+
},
|
|
130
|
+
"endpoints": {
|
|
131
|
+
"clientUrl": "https://studio.example.test",
|
|
132
|
+
"serverUrl": "https://api.example.test"
|
|
133
|
+
},
|
|
134
|
+
"module": "*",
|
|
135
|
+
"behavior": {
|
|
136
|
+
"clearWorkflowFormStorageAfterUpdate": true,
|
|
137
|
+
"autoApproveOAuth": false,
|
|
138
|
+
"rememberWorkflowModelSelection": true
|
|
139
|
+
},
|
|
140
|
+
"dataManagement": {
|
|
141
|
+
"favoriteOntologyId": "favorite",
|
|
142
|
+
"homeAdvertisement": {
|
|
143
|
+
"ontologyId": "home",
|
|
144
|
+
"viewType": "container",
|
|
145
|
+
"pageSize": 20,
|
|
146
|
+
"sortBy": "updated_timestamp",
|
|
147
|
+
"sortOrder": "desc"
|
|
148
|
+
},
|
|
149
|
+
"homeTrendAssistant": {
|
|
150
|
+
"ontologyId": "trends",
|
|
151
|
+
"tep": { "baseUrl": "https://tep.example.test", "timeoutMs": 5000 },
|
|
152
|
+
"runtime": {
|
|
153
|
+
"appId": "concept",
|
|
154
|
+
"tepBaseUrlConfigured": true,
|
|
155
|
+
"tepAuthorizationConfigured": true,
|
|
156
|
+
"tepCookieConfigured": false
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"sharing": {
|
|
160
|
+
"shareAccess": {
|
|
161
|
+
"publicLinksEnabled": true,
|
|
162
|
+
"passwordGateEnabled": true,
|
|
163
|
+
"passwordAccessTtlSeconds": 3600,
|
|
164
|
+
"defaultViewTreeDelivery": "manual"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"compute": {
|
|
169
|
+
"integrations": {
|
|
170
|
+
"harbor": { "endpoint": "https://harbor.example.test", "projectScopes": ["monkeys"] },
|
|
171
|
+
"gitlab": { "baseUrl": "https://gitlab.example.test", "deploymentReportsEnabled": true },
|
|
172
|
+
"kubernetes": { "accessMode": "agent", "namespaceScopes": ["production"] }
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"data": {},
|
|
176
|
+
"storage": { "presignMode": "backend" },
|
|
177
|
+
"monkeyData": { "baseUrl": "https://data.example.test" }
|
|
178
|
+
}
|
|
179
|
+
}
|