@ah-oh/ao-workspaces-robin-client 0.0.1-preview.39 → 0.0.2-preview.43
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/package.json +1 -1
- package/src/lib/steps.d.ts +5 -1
- package/src/lib/steps.js +23 -2
- package/src/lib/steps.js.map +1 -1
- package/src/lib/types.d.ts +9 -0
- package/src/lib/types.js +2 -0
- package/src/lib/types.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ah-oh/ao-workspaces-robin-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2-preview.43",
|
|
4
4
|
"description": "Framework-free client core for the Robin BFF: wire types, fetch client, run follower, error texts.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/src/lib/steps.d.ts
CHANGED
|
@@ -4,5 +4,9 @@ import { RobinRunDetail, RobinRunStep, RobinShortcut } from './types';
|
|
|
4
4
|
* the message only (RS-REQ-084).
|
|
5
5
|
*/
|
|
6
6
|
export declare const readableRunError: (message: string | null | undefined) => string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Progress of the run for the panel (RS-REQ-030) from its events and delegations.
|
|
9
|
+
* While a model turn is open, a last step „Robin überlegt“ carries its start,
|
|
10
|
+
* so the panel shows that Robin is still at work (RS-REQ-030, R-033).
|
|
11
|
+
*/
|
|
8
12
|
export declare const deriveSteps: (run: RobinRunDetail | null, shortcuts: readonly RobinShortcut[]) => RobinRunStep[];
|
package/src/lib/steps.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTerminalRunStatus, THINKING_STEP_KEY, } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* A failed step reads `CODE: message (details)` (tool errors); the user gets
|
|
3
4
|
* the message only (RS-REQ-084).
|
|
@@ -12,7 +13,11 @@ export const readableRunError = (message) => {
|
|
|
12
13
|
.trim();
|
|
13
14
|
return readable || text;
|
|
14
15
|
};
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Progress of the run for the panel (RS-REQ-030) from its events and delegations.
|
|
18
|
+
* While a model turn is open, a last step „Robin überlegt“ carries its start,
|
|
19
|
+
* so the panel shows that Robin is still at work (RS-REQ-030, R-033).
|
|
20
|
+
*/
|
|
16
21
|
export const deriveSteps = (run, shortcuts) => {
|
|
17
22
|
if (!run)
|
|
18
23
|
return [];
|
|
@@ -23,6 +28,7 @@ export const deriveSteps = (run, shortcuts) => {
|
|
|
23
28
|
}
|
|
24
29
|
const steps = new Map();
|
|
25
30
|
const delegationKeys = new Map();
|
|
31
|
+
let thinkingSince;
|
|
26
32
|
for (const event of run.events) {
|
|
27
33
|
const payload = event.payload ?? {};
|
|
28
34
|
const key = typeof payload['capabilityKey'] === 'string' ? payload['capabilityKey'] : undefined;
|
|
@@ -30,6 +36,10 @@ export const deriveSteps = (run, shortcuts) => {
|
|
|
30
36
|
const name = typeof payload['capabilityName'] === 'string' ? payload['capabilityName'] : undefined;
|
|
31
37
|
if (key && name && !names.has(key))
|
|
32
38
|
names.set(key, name);
|
|
39
|
+
if (event.type === 'model_turn_started')
|
|
40
|
+
thinkingSince = event.createdAt;
|
|
41
|
+
else if (TURN_ENDS.has(event.type))
|
|
42
|
+
thinkingSince = undefined;
|
|
33
43
|
switch (event.type) {
|
|
34
44
|
case 'capability_selected':
|
|
35
45
|
if (key && delegationId)
|
|
@@ -72,8 +82,19 @@ export const deriveSteps = (run, shortcuts) => {
|
|
|
72
82
|
break;
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
|
-
|
|
85
|
+
const result = [...steps.values()];
|
|
86
|
+
if (thinkingSince && !isTerminalRunStatus(run.status)) {
|
|
87
|
+
result.push({
|
|
88
|
+
key: THINKING_STEP_KEY,
|
|
89
|
+
label: 'Robin überlegt',
|
|
90
|
+
state: 'running',
|
|
91
|
+
since: thinkingSince,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
76
95
|
};
|
|
96
|
+
/** Events after which no model turn is open any more. */
|
|
97
|
+
const TURN_ENDS = new Set(['model_turn_completed', 'final_answer', 'run_failed', 'run_cancelled']);
|
|
77
98
|
const setState = (steps, key, state, names) => {
|
|
78
99
|
const step = steps.get(key);
|
|
79
100
|
if (step) {
|
package/src/lib/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../../../libs/robin-client/src/lib/steps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../../../../libs/robin-client/src/lib/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAInB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAkC,EAAU,EAAE;IAC7E,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,IAAI;QAAE,OAAO,oBAAoB,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI;SAClB,OAAO,CAAC,8BAA8B,EAAE,EAAE,CAAC;SAC3C,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC;SACzC,IAAI,EAAE,CAAC;IACV,OAAO,QAAQ,IAAI,IAAI,CAAC;AAC1B,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAA0B,EAC1B,SAAmC,EACnB,EAAE;IAClB,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK;YAAE,KAAK,CAAC,GAAG,CAAC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AAI,SAA6B,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;YAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;IACrD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE,CACvC,GAAG;KACA,KAAK,CAAC,QAAQ,CAAC;KACf,MAAM,CAAC,OAAO,CAAC;KACf,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACzD,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/src/lib/types.d.ts
CHANGED
|
@@ -237,6 +237,11 @@ export interface RobinShortcut {
|
|
|
237
237
|
goal: string;
|
|
238
238
|
steps: RobinShortcutStep[];
|
|
239
239
|
confirmations: number;
|
|
240
|
+
/**
|
|
241
|
+
* Surface RS-31: the click is the confirmation of the one step; the
|
|
242
|
+
* platform checks the call it leads to and shows the card otherwise.
|
|
243
|
+
*/
|
|
244
|
+
confirmsOnClick?: boolean;
|
|
240
245
|
}
|
|
241
246
|
export interface RobinStoredAttachment extends RobinSurfaceAttachment {
|
|
242
247
|
size: number;
|
|
@@ -247,7 +252,11 @@ export interface RobinRunStep {
|
|
|
247
252
|
key: string;
|
|
248
253
|
label: string;
|
|
249
254
|
state: 'planned' | 'running' | 'waiting_confirmation' | 'done' | 'failed';
|
|
255
|
+
/** Start of a step that shows its running time, ISO date; set on {@link THINKING_STEP_KEY}. */
|
|
256
|
+
since?: string;
|
|
250
257
|
}
|
|
258
|
+
/** Key of the step that stands for an open model turn (Robin thinks). */
|
|
259
|
+
export declare const THINKING_STEP_KEY = "robin:thinking";
|
|
251
260
|
/** Body of `PUT /robin/devices/:installationId` (RA-05). */
|
|
252
261
|
export interface RobinDeviceRegistration {
|
|
253
262
|
/** Expo push token, `ExponentPushToken[…]`. */
|
package/src/lib/types.js
CHANGED
|
@@ -7,4 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const TERMINAL_RUN_STATUSES = ['SUCCESS', 'FAILED', 'CANCELLED'];
|
|
9
9
|
export const isTerminalRunStatus = (status) => TERMINAL_RUN_STATUSES.includes(status);
|
|
10
|
+
/** Key of the step that stands for an open model turn (Robin thinks). */
|
|
11
|
+
export const THINKING_STEP_KEY = 'robin:thinking';
|
|
10
12
|
//# sourceMappingURL=types.js.map
|
package/src/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/robin-client/src/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2JH,MAAM,CAAC,MAAM,qBAAqB,GAA8B,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAA+B,EAAW,EAAE,CAC7E,qBAA2C,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/robin-client/src/lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2JH,MAAM,CAAC,MAAM,qBAAqB,GAA8B,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAA+B,EAAW,EAAE,CAC7E,qBAA2C,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AA8JhE,yEAAyE;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC"}
|