@beeuni/sdk 0.2.0 → 0.3.0
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 +19 -10
- package/dist/beeuni.esm.min.js +37 -35
- package/dist/beeuni.global.js +37 -35
- package/dist/browser/cache/idb-sync-cache.js +15 -5
- package/dist/browser/session-sync/server-transcript-mirror.d.ts +7 -1
- package/dist/browser/session-sync/server-transcript-mirror.js +30 -24
- package/dist/browser/session-sync/session-sync-registry.d.ts +3 -1
- package/dist/browser/session-sync/session-sync-registry.js +48 -3
- package/dist/browser/stores/sync-store/keep-unchanged.d.ts +4 -0
- package/dist/browser/stores/sync-store/keep-unchanged.js +34 -0
- package/dist/browser/stores/sync-store.d.ts +1 -0
- package/dist/browser/stores/sync-store.js +72 -16
- package/dist/core/attachments/prompt-attachments.d.ts +4 -0
- package/dist/core/attachments/prompt-attachments.js +34 -0
- package/dist/core/capture/rules.d.ts +17 -0
- package/dist/core/capture/rules.js +27 -0
- package/dist/core/client/beeuni.d.ts +92 -5
- package/dist/core/client/beeuni.js +2 -0
- package/dist/core/client/capture.d.ts +105 -0
- package/dist/core/client/capture.js +48 -0
- package/dist/core/client/facade-identity.d.ts +1 -0
- package/dist/core/client/facade-identity.js +1 -0
- package/dist/core/client/project-access-resources.d.ts +3 -1
- package/dist/core/client/project-access-resources.js +1 -1
- package/dist/core/client/project-operations-admin.d.ts +4 -4
- package/dist/core/client/project-operations-review.d.ts +2 -3
- package/dist/core/client/project-operations-review.js +1 -0
- package/dist/core/client/project-operations-workspace.d.ts +4 -4
- package/dist/core/client/project-operations-workspace.js +1 -1
- package/dist/core/client/project-operations.d.ts +5 -4
- package/dist/core/client/session-context.d.ts +2 -0
- package/dist/core/client/session-handle.d.ts +13 -0
- package/dist/core/client/session-lifecycle-resources.d.ts +11 -0
- package/dist/core/client/session-lifecycle-resources.js +4 -0
- package/dist/core/client/session-lifecycle-security.d.ts +2 -0
- package/dist/core/client/session-lifecycle-security.js +1 -0
- package/dist/core/client/session-readiness.d.ts +2 -0
- package/dist/core/client/session-readiness.js +20 -1
- package/dist/core/http/api-client.d.ts +1 -0
- package/dist/core/http/api-client.js +1 -0
- package/dist/core/http/config.d.ts +2 -0
- package/dist/core/http/response-error.js +26 -11
- package/dist/core/http/transport.js +6 -1
- package/dist/core/models/composer-model.d.ts +14 -0
- package/dist/core/models/composer-model.js +21 -1
- package/dist/core/rest/platform-client/capture.d.ts +363 -0
- package/dist/core/rest/platform-client/capture.js +116 -0
- package/dist/core/rest/platform-client/index.d.ts +1 -0
- package/dist/core/rest/platform-client/index.js +1 -0
- package/dist/core/rest/platform-client/lifecycle.js +18 -12
- package/dist/core/rest/platform-client/shared.d.ts +5 -0
- package/dist/core/rest/platform-client/shared.js +18 -0
- package/dist/core/rest/projects-client/account-secret-resources.d.ts +2 -1
- package/dist/core/rest/projects-client/accounts.d.ts +34 -0
- package/dist/core/rest/projects-client/accounts.js +10 -0
- package/dist/core/rest/projects-client/admin-providers.d.ts +0 -61
- package/dist/core/rest/projects-client/admin-providers.js +0 -6
- package/dist/core/rest/projects-client/agent-config.d.ts +3 -0
- package/dist/core/rest/projects-client/apps-fleet.d.ts +5 -1
- package/dist/core/rest/projects-client/apps-fleet.js +2 -2
- package/dist/core/rest/projects-client/apps.d.ts +3 -0
- package/dist/core/rest/projects-client/change-requests.d.ts +2 -0
- package/dist/core/rest/projects-client/change-requests.js +2 -0
- package/dist/core/rest/projects-client/connectors.d.ts +7 -0
- package/dist/core/rest/projects-client/connectors.js +3 -0
- package/dist/core/rest/projects-client/files.d.ts +3 -0
- package/dist/core/rest/projects-client/files.js +4 -0
- package/dist/core/rest/projects-client/gateway.d.ts +5 -0
- package/dist/core/rest/projects-client/iam-actions.d.ts +76 -0
- package/dist/core/rest/projects-client/iam-actions.js +101 -0
- package/dist/core/rest/projects-client/iam.d.ts +1 -0
- package/dist/core/rest/projects-client/iam.js +1 -0
- package/dist/core/rest/projects-client/notifications.d.ts +1 -1
- package/dist/core/rest/projects-client/notifications.js +4 -0
- package/dist/core/rest/projects-client/projects.d.ts +3 -2
- package/dist/core/rest/projects-client/projects.js +2 -3
- package/dist/core/rest/projects-client/review-items.d.ts +2 -0
- package/dist/core/rest/projects-client/review-items.js +4 -0
- package/dist/core/rest/projects-client/review.d.ts +17 -3
- package/dist/core/rest/projects-client/review.js +11 -0
- package/dist/core/rest/projects-client/secrets.d.ts +3 -0
- package/dist/core/rest/projects-client/session-attachments.js +14 -1
- package/dist/core/rest/projects-client/sessions.d.ts +29 -2
- package/dist/core/rest/projects-client/sessions.js +34 -4
- package/dist/core/runtime/runtime-rest-client.js +1 -1
- package/dist/core/runtime/runtime-types.d.ts +1 -0
- package/dist/core/session/open-bundle.d.ts +4 -4
- package/dist/core/session/open-bundle.js +29 -46
- package/dist/core/session/turn-end-watch.d.ts +47 -0
- package/dist/core/session/turn-end-watch.js +141 -0
- package/dist/core/session-log/index.d.ts +4 -0
- package/dist/core/session-log/index.js +3 -0
- package/dist/core/session-log/tool-call.d.ts +7 -2
- package/dist/core/session-log/tool-call.js +25 -6
- package/dist/core/session-log/turns/blocks.d.ts +60 -0
- package/dist/core/session-log/turns/blocks.js +124 -0
- package/dist/core/session-log/turns/history.d.ts +32 -0
- package/dist/core/session-log/turns/history.js +99 -0
- package/dist/core/session-log/turns/index.d.ts +4 -0
- package/dist/core/session-log/turns/index.js +4 -0
- package/dist/core/session-log/turns/metrics.d.ts +21 -0
- package/dist/core/session-log/turns/metrics.js +29 -0
- package/dist/core/session-log/turns/turn.d.ts +55 -0
- package/dist/core/session-log/turns/turn.js +279 -0
- package/dist/core/session-log/turns/v1-parts.d.ts +8 -0
- package/dist/core/session-log/turns/v1-parts.js +43 -0
- package/dist/core/session-log/v1-view.d.ts +5 -2
- package/dist/core/session-log/v1-view.js +86 -22
- package/dist/core/session-log/v1.js +10 -3
- package/dist/core/session-sync/saved-transcript.d.ts +15 -1
- package/dist/core/session-sync/saved-transcript.js +55 -0
- package/dist/core/session-sync/session-sync-controller.js +3 -0
- package/dist/core/stream/event-stream.js +3 -3
- package/dist/core/turns/classify.js +4 -2
- package/dist/core/turns/edit-blocks.d.ts +1 -0
- package/dist/core/turns/edit-blocks.js +15 -0
- package/dist/core/turns/segments/burst-summary.d.ts +1 -0
- package/dist/core/turns/segments/burst-summary.js +24 -0
- package/dist/core/turns/segments/group-steps.d.ts +4 -3
- package/dist/core/turns/segments/group-steps.js +9 -6
- package/dist/core/turns/segments/narration.d.ts +5 -4
- package/dist/core/turns/segments/narration.js +12 -3
- package/dist/core/turns/segments/session-activity-groups.d.ts +2 -1
- package/dist/core/turns/segments/session-activity-groups.js +3 -1
- package/dist/core/turns/segments/step-label.d.ts +2 -1
- package/dist/core/turns/segments/step-label.js +3 -1
- package/dist/core/turns/segments/working-turn.d.ts +4 -2
- package/dist/core/turns/segments/working-turn.js +9 -8
- package/dist/core/turns/tool-kind.d.ts +1 -1
- package/dist/core/turns/tool-kind.js +3 -2
- package/dist/core/turns/tool-registry.js +1 -0
- package/dist/core/turns/tools/tool-meta.d.ts +1 -1
- package/dist/core/turns/tools/tool-meta.js +3 -2
- package/dist/core/turns/view-model.js +1 -13
- package/dist/genui/catalog.d.ts +28 -0
- package/dist/genui/catalog.js +396 -0
- package/dist/genui/expansion.d.ts +3 -0
- package/dist/genui/expansion.js +295 -0
- package/dist/genui/fence-entry.d.ts +2 -0
- package/dist/genui/fence-entry.js +1 -0
- package/dist/genui/fence.d.ts +21 -0
- package/dist/genui/fence.js +138 -0
- package/dist/genui/index.d.ts +6 -0
- package/dist/genui/index.js +6 -0
- package/dist/genui/markdown.d.ts +12 -0
- package/dist/genui/markdown.js +104 -0
- package/dist/genui/parse.d.ts +6 -0
- package/dist/genui/parse.js +75 -0
- package/dist/genui/prompt.d.ts +2 -0
- package/dist/genui/prompt.js +206 -0
- package/dist/genui/react/default-components.d.ts +2 -0
- package/dist/genui/react/default-components.js +72 -0
- package/dist/genui/react/default-components.test.d.ts +1 -0
- package/dist/genui/react/default-components.test.js +94 -0
- package/dist/genui/react/genui-block-disabled.test.d.ts +1 -0
- package/dist/genui/react/genui-block-disabled.test.js +50 -0
- package/dist/genui/react/genui-block.d.ts +28 -0
- package/dist/genui/react/genui-block.js +91 -0
- package/dist/genui/react/genui-block.test.d.ts +1 -0
- package/dist/genui/react/genui-block.test.js +205 -0
- package/dist/genui/react/index.d.ts +2 -0
- package/dist/genui/react/index.js +2 -0
- package/dist/genui/share.d.ts +5 -0
- package/dist/genui/share.js +30 -0
- package/dist/genui/test-fixtures.d.ts +2 -0
- package/dist/genui/test-fixtures.js +16 -0
- package/dist/genui/types.d.ts +29 -0
- package/dist/genui/types.js +1 -0
- package/dist/genui/urls.d.ts +1 -0
- package/dist/genui/urls.js +18 -0
- package/dist/genui/validate.d.ts +9 -0
- package/dist/genui/validate.js +116 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal/connector-catalog.d.ts +1 -0
- package/dist/platform/ui.d.ts +8 -2
- package/dist/platform/ui.js +19 -4
- package/dist/react/chat/use-chat-turns.d.ts +1 -1
- package/dist/react/human-presence.d.ts +9 -0
- package/dist/react/human-presence.js +12 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +4 -0
- package/dist/react/opencode.d.ts +1 -1
- package/dist/react/opencode.js +1 -1
- package/dist/react/query-contracts.d.ts +6 -0
- package/dist/react/query-contracts.js +6 -0
- package/dist/react/query-keys.d.ts +17 -1
- package/dist/react/query-keys.js +24 -1
- package/dist/react/reset-identity-state.js +2 -0
- package/dist/react/session-cache-write.d.ts +1 -0
- package/dist/react/session-cache-write.js +20 -0
- package/dist/react/session-transcript-subscription.js +1 -1
- package/dist/react/sign-in-with-beeuni.d.ts +5 -5
- package/dist/react/turn-end-handoff.d.ts +13 -0
- package/dist/react/turn-end-handoff.js +101 -0
- package/dist/react/use-admin-providers.d.ts +0 -3
- package/dist/react/use-admin-providers.js +1 -11
- package/dist/react/use-capture.d.ts +47 -0
- package/dist/react/use-capture.js +173 -0
- package/dist/react/use-feature-flag.js +1 -0
- package/dist/react/use-opencode-events/handle-interaction-event.js +8 -3
- package/dist/react/use-opencode-events/handle-session-event.js +13 -8
- package/dist/react/use-opencode-events/handler-context.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.d.ts +1 -0
- package/dist/react/use-opencode-events/helpers.js +11 -1
- package/dist/react/use-opencode-local.d.ts +5 -1
- package/dist/react/use-opencode-local.js +15 -2
- package/dist/react/use-opencode-sessions/commands.d.ts +11 -1
- package/dist/react/use-opencode-sessions/commands.js +21 -1
- package/dist/react/use-opencode-sessions/permissions.js +28 -1
- package/dist/react/use-project-sessions.d.ts +1 -1
- package/dist/react/use-project-sessions.js +6 -5
- package/dist/react/use-prompt-attachments.js +1 -0
- package/dist/react/use-review-summary.d.ts +13 -0
- package/dist/react/use-review-summary.js +32 -0
- package/dist/react/use-runtime-reconnect.js +2 -2
- package/dist/react/use-session-list-state.d.ts +6 -0
- package/dist/react/use-session-list-state.js +33 -0
- package/dist/react/use-session-log.d.ts +3 -2
- package/dist/react/use-session-log.js +26 -17
- package/dist/react/use-session-messages.d.ts +2 -1
- package/dist/react/use-session-messages.js +15 -14
- package/dist/react/use-session-stream.js +12 -1
- package/dist/react/use-session-sync.d.ts +2 -2
- package/dist/react/use-session-sync.js +10 -8
- package/dist/react/use-session-transcript-history.js +2 -12
- package/dist/react/use-session-working.d.ts +2 -0
- package/dist/react/use-session-working.js +10 -0
- package/dist/react/use-session.d.ts +6 -0
- package/dist/react/use-session.js +87 -7
- package/package.json +49 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const GENUI_SCHEMA_VERSION: 1;
|
|
2
|
+
export interface GenuiNode {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
props: Record<string, unknown>;
|
|
6
|
+
partial: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type GenuiIssueCode = 'schema' | 'unknown-component' | 'wrong-child' | 'url' | 'depth' | 'version' | 'no-root' | 'cut-off' | 'unsupported-statement' | 'too-many-nodes' | 'too-large' | 'parse-failed';
|
|
9
|
+
export interface GenuiIssue {
|
|
10
|
+
code: GenuiIssueCode;
|
|
11
|
+
component?: string;
|
|
12
|
+
statementId?: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GenuiParseResult {
|
|
16
|
+
root: GenuiNode | null;
|
|
17
|
+
pending: string[];
|
|
18
|
+
issues: GenuiIssue[];
|
|
19
|
+
streaming: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type GenuiSegment = {
|
|
22
|
+
kind: 'markdown';
|
|
23
|
+
text: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'genui';
|
|
26
|
+
code: string;
|
|
27
|
+
version: number;
|
|
28
|
+
closed: boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const GENUI_SCHEMA_VERSION = 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function safeUrl(raw: unknown): string | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const MAX_URL_LENGTH = 2048;
|
|
2
|
+
export function safeUrl(raw) {
|
|
3
|
+
if (typeof raw !== 'string')
|
|
4
|
+
return null;
|
|
5
|
+
const value = raw.trim();
|
|
6
|
+
if (!value || value.length > MAX_URL_LENGTH)
|
|
7
|
+
return null;
|
|
8
|
+
let url;
|
|
9
|
+
try {
|
|
10
|
+
url = new URL(value);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (url.username || url.password)
|
|
16
|
+
return null;
|
|
17
|
+
return url.protocol === 'https:' || url.protocol === 'http:' ? url.toString() : null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ElementNode } from '@openuidev/lang-core';
|
|
2
|
+
import type { GenuiIssue, GenuiNode } from './types.js';
|
|
3
|
+
export declare function sanitizeTree(root: ElementNode | null, options: {
|
|
4
|
+
streaming: boolean;
|
|
5
|
+
unfinished: string | null;
|
|
6
|
+
}): {
|
|
7
|
+
root: GenuiNode | null;
|
|
8
|
+
issues: GenuiIssue[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { GENUI_BLOCKS, GENUI_MAX_DEPTH, GENUI_MAX_NODES, GENUI_SPECS } from './catalog.js';
|
|
2
|
+
import { safeUrl } from './urls.js';
|
|
3
|
+
const isElement = (value) => typeof value === 'object' && value !== null && value.type === 'element';
|
|
4
|
+
function fit(node, accepts) {
|
|
5
|
+
const spec = GENUI_SPECS[node.type];
|
|
6
|
+
if (accepts.includes(node.type) || spec?.block)
|
|
7
|
+
return [node];
|
|
8
|
+
const children = Object.keys(spec?.slots ?? {}).flatMap((key) => (node.props[key] ?? []));
|
|
9
|
+
return children.flatMap((child) => fit(child, accepts));
|
|
10
|
+
}
|
|
11
|
+
export function sanitizeTree(root, options) {
|
|
12
|
+
const issues = [];
|
|
13
|
+
const usedIds = new Map();
|
|
14
|
+
let nodeCount = 0;
|
|
15
|
+
const uniqueId = (base) => {
|
|
16
|
+
const seen = usedIds.get(base) ?? 0;
|
|
17
|
+
usedIds.set(base, seen + 1);
|
|
18
|
+
return seen === 0 ? base : `${base}#${seen}`;
|
|
19
|
+
};
|
|
20
|
+
function visit(value, path, depth, accepts, parentPartial) {
|
|
21
|
+
if (!isElement(value))
|
|
22
|
+
return [];
|
|
23
|
+
const { typeName, statementId } = value;
|
|
24
|
+
const partial = statementId !== undefined ? statementId === options.unfinished : parentPartial;
|
|
25
|
+
const spec = GENUI_SPECS[typeName];
|
|
26
|
+
if (!spec) {
|
|
27
|
+
issues.push({ code: 'unknown-component', component: typeName, statementId, message: `Unknown component ${typeName}` });
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
if (!accepts.includes(typeName)) {
|
|
31
|
+
issues.push({ code: 'wrong-child', component: typeName, statementId, message: `${typeName} is not allowed here` });
|
|
32
|
+
return visit(value, path, depth, [typeName], parentPartial).flatMap((node) => fit(node, accepts));
|
|
33
|
+
}
|
|
34
|
+
const nextDepth = spec.container ? depth + 1 : depth;
|
|
35
|
+
if (nextDepth > GENUI_MAX_DEPTH) {
|
|
36
|
+
issues.push({ code: 'depth', component: typeName, statementId, message: `Nesting deeper than ${GENUI_MAX_DEPTH}` });
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
if (nodeCount >= GENUI_MAX_NODES) {
|
|
40
|
+
if (!issues.some((issue) => issue.code === 'too-many-nodes')) {
|
|
41
|
+
issues.push({ code: 'too-many-nodes', message: `Block expands to more than ${GENUI_MAX_NODES} nodes; the rest is dropped` });
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
nodeCount++;
|
|
46
|
+
if (partial && !options.streaming) {
|
|
47
|
+
issues.push({ code: 'cut-off', component: typeName, statementId, message: `${typeName} was cut off` });
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
const id = uniqueId(statementId ?? path);
|
|
51
|
+
const props = {};
|
|
52
|
+
for (const [key, prop] of Object.entries(value.props)) {
|
|
53
|
+
if (prop !== null && prop !== undefined)
|
|
54
|
+
props[key] = prop;
|
|
55
|
+
}
|
|
56
|
+
const subtrees = [];
|
|
57
|
+
const rising = [];
|
|
58
|
+
for (const [key, slot] of Object.entries(spec.slots)) {
|
|
59
|
+
const raw = props[key];
|
|
60
|
+
if (raw === undefined)
|
|
61
|
+
continue;
|
|
62
|
+
const children = Array.isArray(raw) ? raw : [raw];
|
|
63
|
+
const kept = [];
|
|
64
|
+
children.forEach((child, index) => {
|
|
65
|
+
const nodes = visit(child, `${id}.${key}.${index}`, nextDepth, slot.accepts, partial);
|
|
66
|
+
for (const node of nodes.flatMap((n) => fit(n, slot.accepts))) {
|
|
67
|
+
subtrees.push(node);
|
|
68
|
+
(slot.accepts.includes(node.type) ? kept : rising).push(node);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
props[key] = kept;
|
|
72
|
+
}
|
|
73
|
+
for (const [key, need] of Object.entries(spec.urls)) {
|
|
74
|
+
if (props[key] === undefined)
|
|
75
|
+
continue;
|
|
76
|
+
const safe = safeUrl(props[key]);
|
|
77
|
+
if (safe) {
|
|
78
|
+
props[key] = safe;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
issues.push({ code: 'url', component: typeName, statementId, message: `Unsafe URL in ${typeName}.${key}` });
|
|
82
|
+
if (need === 'required')
|
|
83
|
+
return [];
|
|
84
|
+
delete props[key];
|
|
85
|
+
}
|
|
86
|
+
if (!partial) {
|
|
87
|
+
const schema = options.streaming ? spec.streaming : spec.strict;
|
|
88
|
+
let result = schema.safeParse(props);
|
|
89
|
+
if (!result.success) {
|
|
90
|
+
const first = result.error.issues[0];
|
|
91
|
+
issues.push({
|
|
92
|
+
code: 'schema',
|
|
93
|
+
component: typeName,
|
|
94
|
+
statementId,
|
|
95
|
+
message: `${typeName}.${first?.path.join('.') ?? ''}: ${first?.message ?? 'invalid'}`,
|
|
96
|
+
});
|
|
97
|
+
const shape = schema.shape;
|
|
98
|
+
const failed = new Set(result.error.issues.map((issue) => String(issue.path[0])));
|
|
99
|
+
if (![...failed].every((key) => shape[key]?.safeParse(undefined).success))
|
|
100
|
+
return subtrees;
|
|
101
|
+
for (const key of failed)
|
|
102
|
+
delete props[key];
|
|
103
|
+
result = schema.safeParse(props);
|
|
104
|
+
if (!result.success)
|
|
105
|
+
return subtrees;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return [{ id, type: typeName, props, partial }, ...rising];
|
|
109
|
+
}
|
|
110
|
+
const top = visit(root, 'root', 0, GENUI_BLOCKS, false);
|
|
111
|
+
if (top.length === 0)
|
|
112
|
+
return { root: null, issues };
|
|
113
|
+
if (top.length === 1 && top[0].type === 'Stack')
|
|
114
|
+
return { root: top[0], issues };
|
|
115
|
+
return { root: { id: uniqueId('root'), type: 'Stack', props: { children: top }, partial: false }, issues };
|
|
116
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export * from './core/session-log/index.js';
|
|
|
43
43
|
export * from './core/warm-session-pool.js';
|
|
44
44
|
export { createHttpSessionSyncController, loadHttpSessionHistory, type SessionSyncMessage, } from './core/session-sync/session-sync-controller.js';
|
|
45
45
|
export * from './core/session-sync/saved-copy-store.js';
|
|
46
|
-
export { type EmptyConversationInput, isEmptyConversation, savedCopyEmptyRoot, } from './core/session-sync/saved-transcript.js';
|
|
46
|
+
export { type EmptyConversationInput, type SavedSessionCopy, isEmptyConversation, readSavedSessionCopy, savedCopyEmptyRoot, } from './core/session-sync/saved-transcript.js';
|
|
47
47
|
export * from './core/session/url.js';
|
|
48
48
|
export { getSandboxUrlForExternalId } from './core/session/server-store/url-helpers.js';
|
|
49
49
|
export { loadPreviewUrlTemplate } from './core/session/preview-config.js';
|
|
@@ -58,4 +58,4 @@ export { flattenModels, isOfferedModel, type FlatModel, type ModelOption } from
|
|
|
58
58
|
export { modelRefToKey, type ModelKey } from './core/models/model-key.js';
|
|
59
59
|
export { createModelVisibility, modelInDefaultView, type ModelVisibilityPin, } from './core/models/model-visibility.js';
|
|
60
60
|
export { pickerProviderList, type PickerProviderListInput, } from './core/models/provider-selection.js';
|
|
61
|
-
export { resolveComposerModel, resolveModelDefault, type ComposerModelResolution, } from './core/models/composer-model.js';
|
|
61
|
+
export { latestPromptModel, resolveComposerModel, resolveModelDefault, sessionModelCandidates, type ComposerModelResolution, } from './core/models/composer-model.js';
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ export * from './core/session-log/index.js';
|
|
|
35
35
|
export * from './core/warm-session-pool.js';
|
|
36
36
|
export { createHttpSessionSyncController, loadHttpSessionHistory, } from './core/session-sync/session-sync-controller.js';
|
|
37
37
|
export * from './core/session-sync/saved-copy-store.js';
|
|
38
|
-
export { isEmptyConversation, savedCopyEmptyRoot, } from './core/session-sync/saved-transcript.js';
|
|
38
|
+
export { isEmptyConversation, readSavedSessionCopy, savedCopyEmptyRoot, } from './core/session-sync/saved-transcript.js';
|
|
39
39
|
export * from './core/session/url.js';
|
|
40
40
|
export { getSandboxUrlForExternalId } from './core/session/server-store/url-helpers.js';
|
|
41
41
|
export { loadPreviewUrlTemplate } from './core/session/preview-config.js';
|
|
@@ -50,4 +50,4 @@ export { flattenModels, isOfferedModel } from './core/models/model-flatten.js';
|
|
|
50
50
|
export { modelRefToKey } from './core/models/model-key.js';
|
|
51
51
|
export { createModelVisibility, modelInDefaultView, } from './core/models/model-visibility.js';
|
|
52
52
|
export { pickerProviderList, } from './core/models/provider-selection.js';
|
|
53
|
-
export { resolveComposerModel, resolveModelDefault, } from './core/models/composer-model.js';
|
|
53
|
+
export { latestPromptModel, resolveComposerModel, resolveModelDefault, sessionModelCandidates, } from './core/models/composer-model.js';
|
package/dist/platform/ui.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export declare function infoToast(message: string, options?: unknown): void;
|
|
2
|
-
export declare function notifyTaskComplete(sessionId: string, sessionTitle?: string
|
|
3
|
-
|
|
2
|
+
export declare function notifyTaskComplete(sessionId: string, sessionTitle?: string, extra?: {
|
|
3
|
+
watchedSinceMs?: number;
|
|
4
|
+
projectId?: string;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function hasNotifySink(): boolean;
|
|
7
|
+
export declare function notifySessionError(sessionId: string, errorTitle: string, sessionTitle?: string, extra?: {
|
|
8
|
+
projectId?: string;
|
|
9
|
+
}): void;
|
|
4
10
|
export declare function notifyQuestion(sessionId: string, questionText: string, sessionTitle?: string): void;
|
|
5
11
|
export declare function notifyPermissionRequest(sessionId: string, toolName: string, sessionTitle?: string): void;
|
package/dist/platform/ui.js
CHANGED
|
@@ -2,11 +2,26 @@ import { platformConfig } from '../core/http/config.js';
|
|
|
2
2
|
export function infoToast(message, options) {
|
|
3
3
|
platformConfig().onToast?.('info', message, options);
|
|
4
4
|
}
|
|
5
|
-
export function notifyTaskComplete(sessionId, sessionTitle) {
|
|
6
|
-
platformConfig().onNotify?.({
|
|
5
|
+
export function notifyTaskComplete(sessionId, sessionTitle, extra) {
|
|
6
|
+
platformConfig().onNotify?.({
|
|
7
|
+
kind: 'task-complete',
|
|
8
|
+
sessionId,
|
|
9
|
+
sessionTitle,
|
|
10
|
+
...(extra?.watchedSinceMs !== undefined ? { watchedSinceMs: extra.watchedSinceMs } : {}),
|
|
11
|
+
...(extra?.projectId ? { projectId: extra.projectId } : {}),
|
|
12
|
+
});
|
|
7
13
|
}
|
|
8
|
-
export function
|
|
9
|
-
platformConfig().onNotify
|
|
14
|
+
export function hasNotifySink() {
|
|
15
|
+
return typeof platformConfig().onNotify === 'function';
|
|
16
|
+
}
|
|
17
|
+
export function notifySessionError(sessionId, errorTitle, sessionTitle, extra) {
|
|
18
|
+
platformConfig().onNotify?.({
|
|
19
|
+
kind: 'session-error',
|
|
20
|
+
sessionId,
|
|
21
|
+
errorTitle,
|
|
22
|
+
sessionTitle,
|
|
23
|
+
...(extra?.projectId ? { projectId: extra.projectId } : {}),
|
|
24
|
+
});
|
|
10
25
|
}
|
|
11
26
|
export function notifyQuestion(sessionId, questionText, sessionTitle) {
|
|
12
27
|
platformConfig().onNotify?.({ kind: 'question', sessionId, questionText, sessionTitle });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const PRESENCE_INPUT_WINDOW_MS: number;
|
|
2
2
|
export declare const PRESENCE_CHECK_MS = 30000;
|
|
3
|
+
export declare const PRESENCE_AWAKE_REFRESH_MS: number;
|
|
3
4
|
export interface HumanPresenceEnv {
|
|
4
5
|
doc: Pick<Document, 'hidden' | 'addEventListener' | 'removeEventListener'>;
|
|
5
6
|
win: Pick<Window, 'addEventListener' | 'removeEventListener' | 'setInterval' | 'clearInterval'>;
|
|
@@ -12,4 +13,12 @@ export declare function presenceReporter(put: (report: {
|
|
|
12
13
|
}) => void, alerts: boolean): {
|
|
13
14
|
report(active: boolean): void;
|
|
14
15
|
setAlerts(next: boolean): void;
|
|
16
|
+
refresh(): void;
|
|
15
17
|
};
|
|
18
|
+
export declare function presenceAwakeFrom(body: {
|
|
19
|
+
awake_until?: string | null;
|
|
20
|
+
awake_cap_at?: string | null;
|
|
21
|
+
}): {
|
|
22
|
+
until: Date;
|
|
23
|
+
capAt: Date;
|
|
24
|
+
} | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const PRESENCE_INPUT_WINDOW_MS = 10 * 60_000;
|
|
2
2
|
export const PRESENCE_CHECK_MS = 30_000;
|
|
3
|
+
export const PRESENCE_AWAKE_REFRESH_MS = 5 * 60_000;
|
|
3
4
|
const INPUT_EVENTS = ['pointerdown', 'pointermove', 'keydown', 'wheel', 'touchstart', 'scroll', 'focus'];
|
|
4
5
|
export function watchHumanPresence(env, send, streamConnected, pageExit = () => false) {
|
|
5
6
|
const now = env.now ?? Date.now;
|
|
@@ -58,5 +59,16 @@ export function presenceReporter(put, alerts) {
|
|
|
58
59
|
if (present)
|
|
59
60
|
put({ active: true, alerts });
|
|
60
61
|
},
|
|
62
|
+
refresh() {
|
|
63
|
+
if (present)
|
|
64
|
+
put({ active: true, alerts });
|
|
65
|
+
},
|
|
61
66
|
};
|
|
62
67
|
}
|
|
68
|
+
export function presenceAwakeFrom(body) {
|
|
69
|
+
if (!body.awake_until || !body.awake_cap_at)
|
|
70
|
+
return null;
|
|
71
|
+
const until = new Date(body.awake_until);
|
|
72
|
+
const capAt = new Date(body.awake_cap_at);
|
|
73
|
+
return Number.isNaN(until.getTime()) || Number.isNaN(capAt.getTime()) ? null : { until, capAt };
|
|
74
|
+
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './use-prompt-attachments.js';
|
|
2
|
+
export { useSessionLogRecord } from './use-session-log.js';
|
|
2
3
|
export { useConnectorSetup, useConnectorLinkInfo, type ConnectorSetupOptions, type ConnectorSetupPhase, type ConnectorPopupOpener, } from './connector-setup.js';
|
|
3
4
|
export { useConnectorQuery, type ConnectorQueryOptions } from './use-connector-query.js';
|
|
4
5
|
export { resetIdentityState } from './reset-identity-state.js';
|
|
@@ -16,6 +17,7 @@ export { useProjectSecrets, projectSecretsKey } from './use-project-secrets.js';
|
|
|
16
17
|
export { useAccountSecretResources, useSessionProviderSecretPools } from './use-provider-secrets.js';
|
|
17
18
|
export { useProjectTriggers, projectTriggersKey, useProjectTriggerEventTypes, useProjectTriggerEventApps, projectTriggerEventAppsKey, projectTriggerEventTypesKey, } from './use-project-triggers.js';
|
|
18
19
|
export { useProjectReminders, useSessionReminders } from './use-reminders.js';
|
|
20
|
+
export * from './use-capture.js';
|
|
19
21
|
export { useSessionMessageAuthors } from './use-session-message-authors.js';
|
|
20
22
|
export { useSessionModelUsage } from './use-session-model-usage.js';
|
|
21
23
|
export { useChangeRequests, changeRequestsKey } from './use-change-requests.js';
|
|
@@ -39,6 +41,8 @@ export * from './use-project-sessions.js';
|
|
|
39
41
|
export * from './use-sessions-needing-input.js';
|
|
40
42
|
export * from './use-notifications.js';
|
|
41
43
|
export * from './session-cache-write.js';
|
|
44
|
+
export * from './use-review-summary.js';
|
|
45
|
+
export * from './use-session-list-state.js';
|
|
42
46
|
export * from './invalidate-project.js';
|
|
43
47
|
export * from './use-feature-flag.js';
|
|
44
48
|
export * from './use-project-files.js';
|
package/dist/react/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
export * from './use-prompt-attachments.js';
|
|
3
|
+
export { useSessionLogRecord } from './use-session-log.js';
|
|
3
4
|
export { useConnectorSetup, useConnectorLinkInfo, } from './connector-setup.js';
|
|
4
5
|
export { useConnectorQuery } from './use-connector-query.js';
|
|
5
6
|
export { resetIdentityState } from './reset-identity-state.js';
|
|
@@ -17,6 +18,7 @@ export { useProjectSecrets, projectSecretsKey } from './use-project-secrets.js';
|
|
|
17
18
|
export { useAccountSecretResources, useSessionProviderSecretPools } from './use-provider-secrets.js';
|
|
18
19
|
export { useProjectTriggers, projectTriggersKey, useProjectTriggerEventTypes, useProjectTriggerEventApps, projectTriggerEventAppsKey, projectTriggerEventTypesKey, } from './use-project-triggers.js';
|
|
19
20
|
export { useProjectReminders, useSessionReminders } from './use-reminders.js';
|
|
21
|
+
export * from './use-capture.js';
|
|
20
22
|
export { useSessionMessageAuthors } from './use-session-message-authors.js';
|
|
21
23
|
export { useSessionModelUsage } from './use-session-model-usage.js';
|
|
22
24
|
export { useChangeRequests, changeRequestsKey } from './use-change-requests.js';
|
|
@@ -40,6 +42,8 @@ export * from './use-project-sessions.js';
|
|
|
40
42
|
export * from './use-sessions-needing-input.js';
|
|
41
43
|
export * from './use-notifications.js';
|
|
42
44
|
export * from './session-cache-write.js';
|
|
45
|
+
export * from './use-review-summary.js';
|
|
46
|
+
export * from './use-session-list-state.js';
|
|
43
47
|
export * from './invalidate-project.js';
|
|
44
48
|
export * from './use-feature-flag.js';
|
|
45
49
|
export * from './use-project-files.js';
|
package/dist/react/opencode.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { useProjectConfig } from './use-project-config.js';
|
|
|
30
30
|
export type { ProjectConfigSummary } from '../core/rest/projects-client/index.js';
|
|
31
31
|
export { useSession, type SessionPhase, type UseSessionResult, type UseSessionOptions, } from './use-session.js';
|
|
32
32
|
export { useSessionMessages, type SessionMessagesOptions, type SessionMessagesSource, } from './use-session-messages.js';
|
|
33
|
-
export { useSessionLog, useSessionLogThread } from './use-session-log.js';
|
|
33
|
+
export { useSessionLog, useSessionLogRecord, useSessionLogThread } from './use-session-log.js';
|
|
34
34
|
export { useSessionPicks, type SessionPicks } from './use-session-picks.js';
|
|
35
35
|
export { useSessionPrompts, sessionPromptsPollMs, startSessionWithPrompt, isOptimisticSessionPrompt, optimisticSessionPrompt, applyOptimisticPrompt, settleOptimisticPrompt, removeOptimisticPrompt, reconcileOptimisticPrompts, OPTIMISTIC_PROMPT_PREFIX, SESSION_PROMPTS_POLL_MS, SESSION_PROMPTS_IDLE_POLL_MS, type StartSessionWithPromptAdapters, type UseSessionPromptsResult, } from './use-session-prompts.js';
|
|
36
36
|
export { readSessionAudit } from './use-session-audit.js';
|
package/dist/react/opencode.js
CHANGED
|
@@ -30,7 +30,7 @@ export { useProjectModelPickerCatalog, useProjectModels } from './use-project-mo
|
|
|
30
30
|
export { useProjectConfig } from './use-project-config.js';
|
|
31
31
|
export { useSession, } from './use-session.js';
|
|
32
32
|
export { useSessionMessages, } from './use-session-messages.js';
|
|
33
|
-
export { useSessionLog, useSessionLogThread } from './use-session-log.js';
|
|
33
|
+
export { useSessionLog, useSessionLogRecord, useSessionLogThread } from './use-session-log.js';
|
|
34
34
|
export { useSessionPicks } from './use-session-picks.js';
|
|
35
35
|
export { useSessionPrompts, sessionPromptsPollMs, startSessionWithPrompt, isOptimisticSessionPrompt, optimisticSessionPrompt, applyOptimisticPrompt, settleOptimisticPrompt, removeOptimisticPrompt, reconcileOptimisticPrompts, OPTIMISTIC_PROMPT_PREFIX, SESSION_PROMPTS_POLL_MS, SESSION_PROMPTS_IDLE_POLL_MS, } from './use-session-prompts.js';
|
|
36
36
|
export { readSessionAudit } from './use-session-audit.js';
|
|
@@ -45,5 +45,11 @@ export declare const FRESHNESS: {
|
|
|
45
45
|
readonly modelPicker: "config";
|
|
46
46
|
readonly gateway: "inventory";
|
|
47
47
|
readonly triggers: "config";
|
|
48
|
+
readonly captureDevices: "directory";
|
|
49
|
+
readonly captureTimeline: "inventory";
|
|
50
|
+
readonly capturePolicy: "config";
|
|
51
|
+
readonly captureWorkspace: "config";
|
|
52
|
+
readonly captureEnrollmentTokens: "config";
|
|
53
|
+
readonly captureEnrollments: "directory";
|
|
48
54
|
};
|
|
49
55
|
export {};
|
|
@@ -60,4 +60,10 @@ export const FRESHNESS = {
|
|
|
60
60
|
modelPicker: 'config',
|
|
61
61
|
gateway: 'inventory',
|
|
62
62
|
triggers: 'config',
|
|
63
|
+
captureDevices: 'directory',
|
|
64
|
+
captureTimeline: 'inventory',
|
|
65
|
+
capturePolicy: 'config',
|
|
66
|
+
captureWorkspace: 'config',
|
|
67
|
+
captureEnrollmentTokens: 'config',
|
|
68
|
+
captureEnrollments: 'directory',
|
|
63
69
|
};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import type { ReviewItemsQuery } from '../core/rest/projects-client/review.js';
|
|
1
2
|
import type { ListProjectSessionsOptions } from '../core/rest/projects-client/sessions.js';
|
|
2
|
-
type SessionListFilters = Pick<ListProjectSessionsOptions, 'parent' | 'startedBy' | 'q' | 'labels'>;
|
|
3
|
+
type SessionListFilters = Pick<ListProjectSessionsOptions, 'parent' | 'startedBy' | 'q' | 'labels' | 'view'>;
|
|
3
4
|
export declare const qk: {
|
|
5
|
+
readonly capture: {
|
|
6
|
+
readonly deviceGrant: (userCode: string) => readonly ["capture", "device-grant", string];
|
|
7
|
+
readonly account: (accountId: string) => readonly ["capture", "account", string];
|
|
8
|
+
readonly workspace: (accountId: string) => readonly ["capture", "account", string, "workspace"];
|
|
9
|
+
readonly devices: (accountId: string, scope: string, userId: string | null) => readonly ["capture", "account", string, "devices", string, string | null];
|
|
10
|
+
readonly timeline: (accountId: string) => readonly ["capture", "account", string, "timeline"];
|
|
11
|
+
readonly timelineRead: (accountId: string, kind: string, query: unknown) => readonly ["capture", "account", string, "timeline", string, unknown];
|
|
12
|
+
readonly policy: (accountId: string) => readonly ["capture", "account", string, "policy"];
|
|
13
|
+
readonly enrollmentTokens: (accountId: string) => readonly ["capture", "account", string, "enrollment-tokens"];
|
|
14
|
+
readonly enrollments: (accountId: string) => readonly ["capture", "account", string, "enrollments"];
|
|
15
|
+
};
|
|
4
16
|
readonly accounts: {
|
|
5
17
|
readonly scope: () => readonly ["kx", "accounts"];
|
|
6
18
|
readonly list: (userId: string | null | undefined) => readonly ["kx", "accounts", string];
|
|
@@ -32,6 +44,9 @@ export declare const qk: {
|
|
|
32
44
|
readonly project: {
|
|
33
45
|
readonly scope: (id: string) => readonly ["kx", "project", string];
|
|
34
46
|
readonly needsInput: (id: string) => readonly ["kx", "project", string, "needs-input"];
|
|
47
|
+
readonly reviewSummary: (id: string) => readonly ["kx", "project", string, "review-summary"];
|
|
48
|
+
readonly reviewItemsScope: (id: string) => readonly ["kx", "project", string, "review-items"];
|
|
49
|
+
readonly reviewItemPages: (id: string, query?: ReviewItemsQuery) => readonly ["kx", "project", string, "review-items", "pages", "all" | import("../index.js").ReviewSegment, "all" | import("../index.js").ReviewItemKind, string, number | "default"];
|
|
35
50
|
readonly summary: (id: string) => readonly ["kx", "project", string, "summary"];
|
|
36
51
|
readonly detail: (id: string) => readonly ["kx", "project", string, "detail"];
|
|
37
52
|
readonly config: (id: string) => readonly ["kx", "project", string, "config"];
|
|
@@ -40,6 +55,7 @@ export declare const qk: {
|
|
|
40
55
|
readonly sessionsScope: (id: string) => readonly ["kx", "project", string, "sessions"];
|
|
41
56
|
readonly sessions: (id: string, scope?: "visible" | "project") => readonly ["kx", "project", string, "sessions", "list", "project" | "visible"];
|
|
42
57
|
readonly sessionsPaged: (id: string, scope?: "visible" | "project", filters?: SessionListFilters) => readonly ["kx", "project", string, "sessions", "list-paged", "project" | "visible"] | readonly ["kx", "project", string, "sessions", "list-paged", "project" | "visible", {
|
|
58
|
+
view?: "archived" | "pinned" | undefined;
|
|
43
59
|
labels?: string[] | undefined;
|
|
44
60
|
parent: string | null;
|
|
45
61
|
startedBy: "me" | "others" | "automated" | null;
|
package/dist/react/query-keys.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
function normalizeSessionListFilters(filters) {
|
|
2
2
|
const q = filters?.q?.trim();
|
|
3
3
|
const labels = filters?.labels?.length ? [...filters.labels].sort() : null;
|
|
4
|
-
|
|
4
|
+
const view = filters?.view;
|
|
5
|
+
if (!filters?.parent && !filters?.startedBy && !q && !labels && !view)
|
|
5
6
|
return undefined;
|
|
6
7
|
return {
|
|
7
8
|
parent: filters?.parent ?? null,
|
|
8
9
|
startedBy: filters?.startedBy ?? null,
|
|
9
10
|
q: q ?? null,
|
|
10
11
|
...(labels ? { labels } : {}),
|
|
12
|
+
...(view ? { view } : {}),
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
15
|
export const qk = {
|
|
16
|
+
capture: {
|
|
17
|
+
deviceGrant: (userCode) => ['capture', 'device-grant', userCode],
|
|
18
|
+
account: (accountId) => ['capture', 'account', accountId],
|
|
19
|
+
workspace: (accountId) => [...qk.capture.account(accountId), 'workspace'],
|
|
20
|
+
devices: (accountId, scope, userId) => [...qk.capture.account(accountId), 'devices', scope, userId],
|
|
21
|
+
timeline: (accountId) => [...qk.capture.account(accountId), 'timeline'],
|
|
22
|
+
timelineRead: (accountId, kind, query) => [...qk.capture.timeline(accountId), kind, query],
|
|
23
|
+
policy: (accountId) => [...qk.capture.account(accountId), 'policy'],
|
|
24
|
+
enrollmentTokens: (accountId) => [...qk.capture.account(accountId), 'enrollment-tokens'],
|
|
25
|
+
enrollments: (accountId) => [...qk.capture.account(accountId), 'enrollments'],
|
|
26
|
+
},
|
|
14
27
|
accounts: {
|
|
15
28
|
scope: () => ['kx', 'accounts'],
|
|
16
29
|
list: (userId) => [...qk.accounts.scope(), userId ?? 'anonymous'],
|
|
@@ -44,6 +57,16 @@ export const qk = {
|
|
|
44
57
|
project: {
|
|
45
58
|
scope: (id) => ['kx', 'project', id],
|
|
46
59
|
needsInput: (id) => [...qk.project.scope(id), 'needs-input'],
|
|
60
|
+
reviewSummary: (id) => [...qk.project.scope(id), 'review-summary'],
|
|
61
|
+
reviewItemsScope: (id) => [...qk.project.scope(id), 'review-items'],
|
|
62
|
+
reviewItemPages: (id, query = {}) => [
|
|
63
|
+
...qk.project.reviewItemsScope(id),
|
|
64
|
+
'pages',
|
|
65
|
+
query.segment ?? 'all',
|
|
66
|
+
query.kind ?? 'all',
|
|
67
|
+
query.sessionId ?? 'all',
|
|
68
|
+
query.limit ?? 'default',
|
|
69
|
+
],
|
|
47
70
|
summary: (id) => [...qk.project.scope(id), 'summary'],
|
|
48
71
|
detail: (id) => [...qk.project.scope(id), 'detail'],
|
|
49
72
|
config: (id) => [...qk.project.scope(id), 'config'],
|
|
@@ -4,6 +4,7 @@ import { useSessionWorkingStore } from '../browser/stores/session-working-store.
|
|
|
4
4
|
import { useSyncStore } from '../browser/stores/sync-store.js';
|
|
5
5
|
import { resetSessionCacheOwnership } from '../browser/session-sync/session-cache-ownership.js';
|
|
6
6
|
import { resetSessionSyncControllers } from '../browser/session-sync/session-sync-registry.js';
|
|
7
|
+
import { resetSessionOpenBundles } from '../core/session/open-bundle.js';
|
|
7
8
|
import { registerIdentityReset, runIdentityResets } from './identity-reset-registry.js';
|
|
8
9
|
import { resetSessionOpenPrefetches } from './prefetch-session-open.js';
|
|
9
10
|
import './use-model-store.js';
|
|
@@ -14,6 +15,7 @@ registerIdentityReset(() => useDiagnosticsStore.getState().clearAll());
|
|
|
14
15
|
registerIdentityReset(resetSessionSyncControllers);
|
|
15
16
|
registerIdentityReset(resetSessionCacheOwnership);
|
|
16
17
|
registerIdentityReset(resetSessionOpenPrefetches);
|
|
18
|
+
registerIdentityReset(resetSessionOpenBundles);
|
|
17
19
|
export function resetIdentityState() {
|
|
18
20
|
runIdentityResets();
|
|
19
21
|
}
|
|
@@ -3,6 +3,7 @@ import { type ProjectSession } from '../core/rest/projects-client/sessions.js';
|
|
|
3
3
|
export type ProjectSessionsUpdater = (sessions: ProjectSession[]) => ProjectSession[];
|
|
4
4
|
export declare function applyToCachedSessionShape(cached: unknown, update: ProjectSessionsUpdater): unknown;
|
|
5
5
|
export declare function updateCachedProjectSessions(queryClient: QueryClient, projectId: string, update: ProjectSessionsUpdater): void;
|
|
6
|
+
export declare function findCachedProjectSession(queryClient: QueryClient, projectId: string, match: (session: ProjectSession) => boolean): ProjectSession | undefined;
|
|
6
7
|
export declare function upsertIntoCachedSessionShape(cached: unknown, session: ProjectSession): unknown;
|
|
7
8
|
export declare function removeCachedProjectSession(queryClient: QueryClient, projectId: string, sessionId: string): () => void;
|
|
8
9
|
export declare function upsertCachedProjectSession(queryClient: QueryClient, projectId: string, session: ProjectSession): void;
|
|
@@ -21,6 +21,10 @@ function sessionBelongsInList(projectId, query, session) {
|
|
|
21
21
|
return true;
|
|
22
22
|
if (filters.q)
|
|
23
23
|
return false;
|
|
24
|
+
if (filters.view === 'pinned' && !session.pinned_at)
|
|
25
|
+
return false;
|
|
26
|
+
if (filters.view === 'archived' && !session.archived_at)
|
|
27
|
+
return false;
|
|
24
28
|
if (filters.parent === 'root' && parentId !== null)
|
|
25
29
|
return false;
|
|
26
30
|
if (filters.parent && filters.parent !== 'root')
|
|
@@ -68,6 +72,22 @@ export function updateCachedProjectSessions(queryClient, projectId, update) {
|
|
|
68
72
|
predicate: (query) => isSessionCacheKey(projectId, query),
|
|
69
73
|
}, (cached) => applyToCachedSessionShape(cached, update));
|
|
70
74
|
}
|
|
75
|
+
export function findCachedProjectSession(queryClient, projectId, match) {
|
|
76
|
+
let found;
|
|
77
|
+
const entries = queryClient.getQueriesData({
|
|
78
|
+
queryKey: qk.project.sessionsScope(projectId),
|
|
79
|
+
predicate: (query) => isSessionCacheKey(projectId, query),
|
|
80
|
+
});
|
|
81
|
+
for (const [, cached] of entries) {
|
|
82
|
+
applyToCachedSessionShape(cached, (rows) => {
|
|
83
|
+
found ??= rows.find(match);
|
|
84
|
+
return rows;
|
|
85
|
+
});
|
|
86
|
+
if (found)
|
|
87
|
+
return found;
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
71
91
|
export function upsertIntoCachedSessionShape(cached, session) {
|
|
72
92
|
const upsert = (items) => {
|
|
73
93
|
const index = items.findIndex((row) => row.session_id === session.session_id);
|
|
@@ -11,7 +11,7 @@ export function useReadableSessionId(sessionId, beeuniSessionScope) {
|
|
|
11
11
|
}
|
|
12
12
|
export function selectSessionRows(state, sessionId) {
|
|
13
13
|
const rows = state.buildSessionMessages(sessionId, state.messages[sessionId], state.parts);
|
|
14
|
-
return sessionLogRowsFor(state.sessionLogs, sessionId, rows);
|
|
14
|
+
return sessionLogRowsFor(state.sessionLogs, sessionId, rows, (id) => state.optimisticEchoOf(sessionId, id));
|
|
15
15
|
}
|
|
16
16
|
const toolSignatures = new WeakMap();
|
|
17
17
|
function toolSignature(parts) {
|
|
@@ -62,9 +62,12 @@ export declare function SignInWithBeeuni({ basePath, returnTo, children, ...rest
|
|
|
62
62
|
security?: string | undefined | undefined;
|
|
63
63
|
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
64
64
|
slot?: string | undefined | undefined;
|
|
65
|
+
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
66
|
+
rel?: string | undefined | undefined;
|
|
67
|
+
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
68
|
+
onEnded?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
65
69
|
hrefLang?: string | undefined | undefined;
|
|
66
70
|
ping?: string | undefined | undefined;
|
|
67
|
-
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
68
71
|
defaultChecked?: boolean | undefined | undefined;
|
|
69
72
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
70
73
|
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
@@ -73,7 +76,7 @@ export declare function SignInWithBeeuni({ basePath, returnTo, children, ...rest
|
|
|
73
76
|
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
74
77
|
autoFocus?: boolean | undefined | undefined;
|
|
75
78
|
className?: string | undefined | undefined;
|
|
76
|
-
contentEditable?: (boolean | "true" | "false") | "
|
|
79
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
77
80
|
contextMenu?: string | undefined | undefined;
|
|
78
81
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
79
82
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
@@ -86,7 +89,6 @@ export declare function SignInWithBeeuni({ basePath, returnTo, children, ...rest
|
|
|
86
89
|
datatype?: string | undefined | undefined;
|
|
87
90
|
inlist?: any;
|
|
88
91
|
property?: string | undefined | undefined;
|
|
89
|
-
rel?: string | undefined | undefined;
|
|
90
92
|
typeof?: string | undefined | undefined;
|
|
91
93
|
vocab?: string | undefined | undefined;
|
|
92
94
|
autoCorrect?: string | undefined | undefined;
|
|
@@ -209,7 +211,6 @@ export declare function SignInWithBeeuni({ basePath, returnTo, children, ...rest
|
|
|
209
211
|
onEmptiedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
210
212
|
onEncrypted?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
211
213
|
onEncryptedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
212
|
-
onEnded?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
213
214
|
onEndedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
214
215
|
onLoadedData?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
215
216
|
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
@@ -243,7 +244,6 @@ export declare function SignInWithBeeuni({ basePath, returnTo, children, ...rest
|
|
|
243
244
|
onWaitingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
244
245
|
onAuxClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
245
246
|
onAuxClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
246
|
-
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
247
247
|
onClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
248
248
|
onContextMenu?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
249
249
|
onContextMenuCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TurnEndWatchDeps } from '../core/session/turn-end-watch.js';
|
|
2
|
+
export declare function resetTurnEndHandoffForTests(deps?: Partial<TurnEndWatchDeps>): void;
|
|
3
|
+
export declare function turnEndHandoffWatching(): string[];
|
|
4
|
+
export interface TurnEndHandoffInput {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
projectId: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
runtimeSessionId?: string | null;
|
|
9
|
+
working: boolean;
|
|
10
|
+
openTurnToken: string | null;
|
|
11
|
+
lastEndedToken: string | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function useTurnEndHandoff(input: TurnEndHandoffInput): void;
|