@kortix/ui 0.14.14 → 0.14.16
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/dist/_vendor/shared/channel-descriptors.d.ts +5 -1
- package/dist/customize/agents/agent-tabs.d.ts +1 -0
- package/dist/customize/agents/agent-tabs.js +1 -0
- package/dist/customize/shared/capability-library.js +7 -2
- package/dist/files/drives/drive-storage.d.ts +47 -0
- package/dist/files/drives/drive-storage.js +144 -0
- package/dist/files/drives/session-drives-chip.js +20 -2
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1 -0
- package/dist/files/project/components/drive-explorer.js +13 -5
- package/dist/files/project/components/drive-upload-tray.js +1 -1
- package/dist/files/project/upload-batch.d.ts +3 -1
- package/dist/files/project/upload-batch.js +5 -2
- package/dist/i18n/en.d.ts +32 -16
- package/dist/i18n/en.js +35 -19
- package/dist/internal/chrome/use-chrome-offered.d.ts +14 -5
- package/dist/internal/chrome/use-chrome-offered.js +15 -6
- package/dist/internal/lib/use-project-feature-flags.js +0 -2
- package/dist/internal/lib/utils/kortix-system-tags.d.ts +2 -8
- package/dist/internal/lib/utils/kortix-system-tags.js +4 -58
- package/dist/session/composer/context-usage.d.ts +2 -0
- package/dist/session/composer/context-usage.js +7 -0
- package/dist/session/header/compact-modal.js +5 -2
- package/dist/session/header/session-site-header.js +5 -2
- package/dist/session/status/session-starting-loader.js +15 -5
- package/dist/session/thread/transcript.js +2 -2
- package/dist/session/tool/tools/kortix-tool-card.d.ts +4 -81
- package/dist/session/tool/tools/kortix-tool-card.js +4 -184
- package/dist/session/tool/tools/workflow-run.d.ts +4 -126
- package/dist/session/tool/tools/workflow-run.js +4 -249
- package/dist/session/turn/burst-step-body.js +2 -2
- package/dist/session/turn/compaction-card.d.ts +23 -1
- package/dist/session/turn/compaction-card.js +20 -8
- package/dist/session/turn/subagent-notice.d.ts +4 -56
- package/dist/session/turn/subagent-notice.js +4 -109
- package/dist/styles.css +1 -1
- package/dist/workspace/sidebar/project-nav-items.d.ts +0 -11
- package/dist/workspace/sidebar/project-nav-items.js +10 -77
- package/dist/workspace/sidebar/project-sidebar.js +4 -3
- package/package.json +3 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/internal/stores/sidebar-nav-store.d.ts +0 -78
- package/dist/internal/stores/sidebar-nav-store.js +0 -125
- package/dist/workspace/sidebar/customize-sidebar-modal.d.ts +0 -9
- package/dist/workspace/sidebar/customize-sidebar-modal.js +0 -198
- package/dist/workspace/sidebar/nav-row-meta.d.ts +0 -14
- package/dist/workspace/sidebar/nav-row-meta.js +0 -94
|
@@ -1,111 +1,6 @@
|
|
|
1
|
-
import { parsePeerMessagePrompt, tagBlocks } from '../../_vendor/kortix-shared.js';
|
|
2
|
-
import { extractSessionReport } from '../../internal/lib/utils/kortix-system-tags.js';
|
|
3
|
-
const SUBAGENT_LEAD = 'A background subagent you started has finished.';
|
|
4
|
-
const TEAMMATE_LEAD = /^Your teammate (\S+) finished its turn and is idle\./;
|
|
5
|
-
const PEER_IDLE_HEAD = '[idle notice from ';
|
|
6
|
-
const STATUSES = new Set(['completed', 'failed', 'stopped']);
|
|
7
|
-
/** `session-notice-batch.ts` `NOTICE_BATCH_MAX`; a longer prompt is not a batch it wrote. */
|
|
8
|
-
const MAX_NOTICES = 20;
|
|
9
|
-
function block(text, tag) {
|
|
10
|
-
const found = tagBlocks(text, tag, { limit: 1 })[0];
|
|
11
|
-
return found ? found.body.trim() : null;
|
|
12
|
-
}
|
|
13
|
-
/** The first line with words, without Markdown heading, list and emphasis marks. */
|
|
14
|
-
export function firstLine(text) {
|
|
15
|
-
for (const raw of text.split('\n')) {
|
|
16
|
-
const line = raw
|
|
17
|
-
.replace(/^\s*(?:#{1,6}\s+|[-*+]\s+|>\s*|\d+\.\s+)/, '')
|
|
18
|
-
.replace(/[*_`]+/g, '')
|
|
19
|
-
.trim();
|
|
20
|
-
if (line)
|
|
21
|
-
return line;
|
|
22
|
-
}
|
|
23
|
-
return '';
|
|
24
|
-
}
|
|
25
|
-
/** The background subagent or teammate notice a text carries (one notice, not a batch), or null. */
|
|
26
|
-
export function parseSubagentNotice(text) {
|
|
27
|
-
if (!text)
|
|
28
|
-
return null;
|
|
29
|
-
const body = text.trimStart();
|
|
30
|
-
const teammate = TEAMMATE_LEAD.exec(body);
|
|
31
|
-
if (!teammate && !body.startsWith(SUBAGENT_LEAD))
|
|
32
|
-
return null;
|
|
33
|
-
const report = extractSessionReport(body);
|
|
34
|
-
const head = body.slice(0, 600);
|
|
35
|
-
const sessionId = /^task_id:\s*(\S+)/m.exec(head)?.[1] ?? report?.sessionId ?? '';
|
|
36
|
-
if (!sessionId)
|
|
37
|
-
return null;
|
|
38
|
-
const stated = /^status:\s*(\w+)/m.exec(head)?.[1];
|
|
39
|
-
// The API writes `error` for a turn that ended on an error; it reads as a failure.
|
|
40
|
-
const normalized = stated === 'error' ? 'failed' : stated;
|
|
41
|
-
const status = normalized && STATUSES.has(normalized)
|
|
42
|
-
? normalized
|
|
43
|
-
: report?.status === 'FAILED'
|
|
44
|
-
? 'failed'
|
|
45
|
-
: 'completed';
|
|
46
|
-
const resultXml = report?.result ?? '';
|
|
47
|
-
const answer = block(resultXml, 'task_result');
|
|
48
|
-
const error = block(resultXml, 'task_error');
|
|
49
|
-
const result = (status === 'completed' ? answer : (error ?? answer)) ?? resultXml;
|
|
50
|
-
const title = report?.prompt?.replace(/\s*\(@[^)]*\bsubagent\)\s*$/i, '').trim() || null;
|
|
51
|
-
const handle = teammate?.[1] ?? null;
|
|
52
|
-
const owned = handle ? /^Tasks \S+ still owns: (.+?)\.?$/m.exec(body)?.[1]?.trim() : undefined;
|
|
53
|
-
return {
|
|
54
|
-
kind: teammate ? 'teammate' : 'subagent',
|
|
55
|
-
sessionId,
|
|
56
|
-
status,
|
|
57
|
-
handle,
|
|
58
|
-
agent: report?.project?.trim() || null,
|
|
59
|
-
title,
|
|
60
|
-
result,
|
|
61
|
-
excerpt: firstLine(result),
|
|
62
|
-
ownedTasks: owned || null,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
/** True when a notice of any kind starts at `index` of `text`. */
|
|
66
|
-
function startsNotice(text, index) {
|
|
67
|
-
return (text.startsWith(SUBAGENT_LEAD, index) ||
|
|
68
|
-
text.startsWith(PEER_IDLE_HEAD, index) ||
|
|
69
|
-
(text.startsWith('Your teammate ', index) && TEAMMATE_LEAD.test(text.slice(index, index + 300))));
|
|
70
|
-
}
|
|
71
1
|
/**
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* never splits one. Every piece must parse: one that does not makes the whole
|
|
76
|
-
* prompt "not a batch", and it renders as the turn it is.
|
|
2
|
+
* The background subagent, teammate and peer idle notices the API delivers
|
|
3
|
+
* into a session as a prompt. The parsers live in `@kortix/sdk`
|
|
4
|
+
* (`core/turns/subagent-notice.ts`); this file keeps the old import path.
|
|
77
5
|
*/
|
|
78
|
-
export
|
|
79
|
-
if (!text)
|
|
80
|
-
return null;
|
|
81
|
-
const body = text.trim();
|
|
82
|
-
if (!startsNotice(body, 0))
|
|
83
|
-
return null;
|
|
84
|
-
const starts = [0];
|
|
85
|
-
for (let at = body.indexOf('\n\n'); at !== -1; at = body.indexOf('\n\n', at + 2)) {
|
|
86
|
-
// Several blank lines in a row: the notice starts at the first non-newline.
|
|
87
|
-
let index = at + 2;
|
|
88
|
-
while (body[index] === '\n')
|
|
89
|
-
index += 1;
|
|
90
|
-
if (index > starts[starts.length - 1] && startsNotice(body, index))
|
|
91
|
-
starts.push(index);
|
|
92
|
-
if (starts.length > MAX_NOTICES)
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
const items = [];
|
|
96
|
-
for (const [i, start] of starts.entries()) {
|
|
97
|
-
const piece = body.slice(start, starts[i + 1] ?? body.length).trim();
|
|
98
|
-
if (piece.startsWith(PEER_IDLE_HEAD)) {
|
|
99
|
-
const info = parsePeerMessagePrompt(piece);
|
|
100
|
-
if (!info || info.kind !== 'idle_notice')
|
|
101
|
-
return null;
|
|
102
|
-
items.push({ kind: 'peer_idle', info });
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
const notice = parseSubagentNotice(piece);
|
|
106
|
-
if (!notice)
|
|
107
|
-
return null;
|
|
108
|
-
items.push({ kind: notice.kind, notice });
|
|
109
|
-
}
|
|
110
|
-
return items;
|
|
111
|
-
}
|
|
6
|
+
export { noticeFirstLine as firstLine, parseNoticeBatch, parseSubagentNotice, } from '@kortix/sdk';
|