@agi-fans/dsh-tui 0.14.0 → 0.15.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/lib/CHANGELOG.md +48 -1
- package/lib/chrome/goal-bar.d.ts +13 -0
- package/lib/chrome/goal-bar.js +45 -0
- package/lib/chrome/goal-bar.js.map +1 -0
- package/lib/chrome/grapheme.d.ts +15 -0
- package/lib/chrome/grapheme.js +49 -0
- package/lib/chrome/grapheme.js.map +1 -0
- package/lib/chrome/markdown.js +96 -28
- package/lib/chrome/markdown.js.map +1 -1
- package/lib/chrome/renderer.d.ts +5 -61
- package/lib/chrome/renderer.js +17 -181
- package/lib/chrome/renderer.js.map +1 -1
- package/lib/chrome/status-config.d.ts +9 -4
- package/lib/chrome/status-config.js +13 -4
- package/lib/chrome/status-config.js.map +1 -1
- package/lib/chrome/status-line.d.ts +2 -0
- package/lib/chrome/status-line.js +4 -1
- package/lib/chrome/status-line.js.map +1 -1
- package/lib/chrome/tool-renderers.js +48 -2
- package/lib/chrome/tool-renderers.js.map +1 -1
- package/lib/commands/diff.d.ts +32 -0
- package/lib/commands/diff.js +116 -0
- package/lib/commands/diff.js.map +1 -0
- package/lib/commands/jobs.d.ts +14 -0
- package/lib/commands/jobs.js +82 -0
- package/lib/commands/jobs.js.map +1 -0
- package/lib/commands/model.d.ts +25 -0
- package/lib/commands/model.js +168 -4
- package/lib/commands/model.js.map +1 -1
- package/lib/commands/permission.d.ts +10 -1
- package/lib/commands/permission.js +23 -14
- package/lib/commands/permission.js.map +1 -1
- package/lib/commands/session.js +72 -1
- package/lib/commands/session.js.map +1 -1
- package/lib/definition.d.ts +25 -3
- package/lib/definition.js.map +1 -1
- package/lib/input/editor.d.ts +2 -0
- package/lib/input/editor.js +19 -9
- package/lib/input/editor.js.map +1 -1
- package/lib/input/keybindings-config.d.ts +1 -1
- package/lib/input/keybindings-config.js +9 -0
- package/lib/input/keybindings-config.js.map +1 -1
- package/lib/runtime/agent-profile.d.ts +11 -0
- package/lib/runtime/agent-profile.js +20 -1
- package/lib/runtime/agent-profile.js.map +1 -1
- package/lib/runtime/provider-local.d.ts +9 -1
- package/lib/runtime/provider-local.js +317 -89
- package/lib/runtime/provider-local.js.map +1 -1
- package/lib/runtime/runner.js +33 -8
- package/lib/runtime/runner.js.map +1 -1
- package/lib/runtime/tool-presentation.js +13 -2
- package/lib/runtime/tool-presentation.js.map +1 -1
- package/lib/session/job-notice.d.ts +28 -0
- package/lib/session/job-notice.js +34 -0
- package/lib/session/job-notice.js.map +1 -0
- package/lib/session/live-attempt-tracker.d.ts +43 -0
- package/lib/session/live-attempt-tracker.js +58 -0
- package/lib/session/live-attempt-tracker.js.map +1 -0
- package/lib/session/project-context.d.ts +2 -0
- package/lib/session/project-context.js +22 -11
- package/lib/session/project-context.js.map +1 -1
- package/lib/session/session-configuration.js +1 -1
- package/lib/session/session-configuration.js.map +1 -1
- package/lib/session/session-controller.d.ts +10 -4
- package/lib/session/session-controller.js +289 -64
- package/lib/session/session-controller.js.map +1 -1
- package/lib/session/subagent-roster.d.ts +37 -0
- package/lib/session/subagent-roster.js +79 -14
- package/lib/session/subagent-roster.js.map +1 -1
- package/lib/session/tui-settings.js +1 -0
- package/lib/session/tui-settings.js.map +1 -1
- package/lib/views/event-views.d.ts +43 -1
- package/lib/views/event-views.js +191 -64
- package/lib/views/event-views.js.map +1 -1
- package/lib/views/hotkeys.js +11 -4
- package/lib/views/hotkeys.js.map +1 -1
- package/lib/views/settings-list.js +1 -0
- package/lib/views/settings-list.js.map +1 -1
- package/lib/views/stream-time.d.ts +14 -0
- package/lib/views/stream-time.js +32 -0
- package/lib/views/stream-time.js.map +1 -0
- package/lib/views/streaming-reveal.js +14 -5
- package/lib/views/streaming-reveal.js.map +1 -1
- package/lib/views/trajectory.d.ts +47 -1
- package/lib/views/trajectory.js +393 -58
- package/lib/views/trajectory.js.map +1 -1
- package/lib/views/transcript-search.d.ts +42 -0
- package/lib/views/transcript-search.js +84 -0
- package/lib/views/transcript-search.js.map +1 -0
- package/package.json +41 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-presentation.js","sourceRoot":"","sources":["../../src/runtime/tool-presentation.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAQ7E,MAAM,CAAC,MAAM,IAAI,GAAG,yBAAyB,CAAA;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;AAc/B,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC;AAED,MAAM,uBAAuB;IAClB,IAAI,CAAS;IAEtB,YAAY,GAAY;QACtB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,KAAY,EAAE,KAAmB;QACrC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;YAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;YAC9D,IAAI,UAAU,EAAE,WAAW,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAA;YAC3D,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;gBAC1E,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAA;YAClD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,SAAS,CAAA;YAClB,CAAC;QACH,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa;YAAE,OAAO,SAAS,CAAA;QAClD,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;QAC5E,CAAC;QACD,OAAO,aAAa,CAAA;IACtB,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,UAAU,4BAA4B,CAAC,GAAY;IACvD,OAAO,IAAI,uBAAuB,CAAC,GAAG,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,4BAA4B,CAAC,GAAG,CAAC,CAAC,CAAA;AACvE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-facing job wording shared by the `/jobs` panel and the completion
|
|
3
|
+
* notice, so one job reads the same in both surfaces.
|
|
4
|
+
* @module @agi-fans/dsh-tui/job-notice
|
|
5
|
+
*/
|
|
6
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
7
|
+
import type { JobKind, JobStatus } from '@deepseek-ai/dsh-jobs';
|
|
8
|
+
/** Past- or present-tense word for one lifecycle status. */
|
|
9
|
+
export declare const JOB_STATUS_WORD: Record<JobStatus, string>;
|
|
10
|
+
/** One human-facing completion line for a background job. */
|
|
11
|
+
export declare function formatJobNotice(snapshot: {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly status: JobStatus;
|
|
15
|
+
readonly detail?: string;
|
|
16
|
+
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* Completion notice for one settlement, or `undefined` when it must stay
|
|
19
|
+
* silent: subagent work is already reported by the live roster, and a job
|
|
20
|
+
* owned by another session is not this terminal's business.
|
|
21
|
+
*/
|
|
22
|
+
export declare function jobNoticeFor(snapshot: {
|
|
23
|
+
readonly kind: JobKind;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly status: JobStatus;
|
|
27
|
+
readonly detail?: string;
|
|
28
|
+
}, owner: Agent | undefined, active: Agent | undefined): string | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-facing job wording shared by the `/jobs` panel and the completion
|
|
3
|
+
* notice, so one job reads the same in both surfaces.
|
|
4
|
+
* @module @agi-fans/dsh-tui/job-notice
|
|
5
|
+
*/
|
|
6
|
+
/** Past- or present-tense word for one lifecycle status. */
|
|
7
|
+
export const JOB_STATUS_WORD = {
|
|
8
|
+
running: 'running',
|
|
9
|
+
stopping: 'stopping',
|
|
10
|
+
completed: 'completed',
|
|
11
|
+
killed: 'stopped',
|
|
12
|
+
failed: 'failed',
|
|
13
|
+
};
|
|
14
|
+
/** One human-facing completion line for a background job. */
|
|
15
|
+
export function formatJobNotice(snapshot) {
|
|
16
|
+
const label = snapshot.label.trim();
|
|
17
|
+
const detail = snapshot.detail === undefined ? '' : snapshot.detail.trim();
|
|
18
|
+
return `Background job ${snapshot.id} ${JOB_STATUS_WORD[snapshot.status]}`
|
|
19
|
+
+ (label === '' ? '' : ` · ${label}`)
|
|
20
|
+
+ (detail === '' ? '' : ` · ${detail}`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Completion notice for one settlement, or `undefined` when it must stay
|
|
24
|
+
* silent: subagent work is already reported by the live roster, and a job
|
|
25
|
+
* owned by another session is not this terminal's business.
|
|
26
|
+
*/
|
|
27
|
+
export function jobNoticeFor(snapshot, owner, active) {
|
|
28
|
+
if (snapshot.kind === 'subagent')
|
|
29
|
+
return undefined;
|
|
30
|
+
if (owner === undefined || owner !== active)
|
|
31
|
+
return undefined;
|
|
32
|
+
return formatJobNotice(snapshot);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=job-notice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-notice.js","sourceRoot":"","sources":["../../src/session/job-notice.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;CACjB,CAAA;AAED,6DAA6D;AAC7D,MAAM,UAAU,eAAe,CAAC,QAK/B;IACC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;IAC1E,OAAO,kBAAkB,QAAQ,CAAC,EAAE,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;UACtE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC;UACnC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,QAAuI,EACvI,KAAwB,EACxB,MAAyB;IAEzB,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,SAAS,CAAA;IAClD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,SAAS,CAAA;IAC7D,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dense `agent/assistant-stream` frame state for live transcript folding.
|
|
3
|
+
*
|
|
4
|
+
* Upstream advances `revision` on every emitted frame (start, each chunk, and
|
|
5
|
+
* end) and `index` per chunk, dense from zero. A real run therefore delivers
|
|
6
|
+
* start(rev N, index -), chunk(rev N+1, index 0), chunk(rev N+2, index 1), …
|
|
7
|
+
* and end(rev N+k+1). The tracker keeps the per-attempt continuation state,
|
|
8
|
+
* buffers every accepted delta for transcript rebuilds, and drops the stream
|
|
9
|
+
* on a revision or index gap until the next start frame.
|
|
10
|
+
* @module @agi-fans/dsh-tui/live-attempt-tracker
|
|
11
|
+
*/
|
|
12
|
+
import type { StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
13
|
+
import type { StreamDelta } from '../views/event-views.ts';
|
|
14
|
+
/**
|
|
15
|
+
* One keyed attempt at a time per agent session; the caller owns the key
|
|
16
|
+
* (`${sessionId}:${attemptId}`) and the frame routing.
|
|
17
|
+
*/
|
|
18
|
+
export declare class LiveAttemptTracker {
|
|
19
|
+
#private;
|
|
20
|
+
/** Record the opening start frame, replacing any prior attempt under the same key. */
|
|
21
|
+
start(key: string, frame: {
|
|
22
|
+
readonly revision: number;
|
|
23
|
+
readonly turn: number;
|
|
24
|
+
readonly step: number;
|
|
25
|
+
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* Fold one chunk frame.
|
|
28
|
+
* @returns the live delta to present, or `undefined` when the frame broke
|
|
29
|
+
* continuation (revision jump or index gap) and the attempt was dropped.
|
|
30
|
+
*/
|
|
31
|
+
chunk(key: string, frame: {
|
|
32
|
+
readonly revision: number;
|
|
33
|
+
readonly index: number;
|
|
34
|
+
readonly time: number;
|
|
35
|
+
readonly chunk: StreamChunk;
|
|
36
|
+
}): StreamDelta | undefined;
|
|
37
|
+
/** Clear one attempt at its end frame or disposal. */
|
|
38
|
+
end(key: string): void;
|
|
39
|
+
/** Buffered deltas for one attempt, for replaying a rebuilt transcript. */
|
|
40
|
+
deltas(key: string): readonly StreamDelta[];
|
|
41
|
+
/** Live attempt keys currently tracked. */
|
|
42
|
+
activeKeys(): IterableIterator<string>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dense `agent/assistant-stream` frame state for live transcript folding.
|
|
3
|
+
*
|
|
4
|
+
* Upstream advances `revision` on every emitted frame (start, each chunk, and
|
|
5
|
+
* end) and `index` per chunk, dense from zero. A real run therefore delivers
|
|
6
|
+
* start(rev N, index -), chunk(rev N+1, index 0), chunk(rev N+2, index 1), …
|
|
7
|
+
* and end(rev N+k+1). The tracker keeps the per-attempt continuation state,
|
|
8
|
+
* buffers every accepted delta for transcript rebuilds, and drops the stream
|
|
9
|
+
* on a revision or index gap until the next start frame.
|
|
10
|
+
* @module @agi-fans/dsh-tui/live-attempt-tracker
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* One keyed attempt at a time per agent session; the caller owns the key
|
|
14
|
+
* (`${sessionId}:${attemptId}`) and the frame routing.
|
|
15
|
+
*/
|
|
16
|
+
export class LiveAttemptTracker {
|
|
17
|
+
#attempts = new Map();
|
|
18
|
+
/** Record the opening start frame, replacing any prior attempt under the same key. */
|
|
19
|
+
start(key, frame) {
|
|
20
|
+
this.#attempts.set(key, {
|
|
21
|
+
turn: frame.turn,
|
|
22
|
+
step: frame.step,
|
|
23
|
+
deltas: [],
|
|
24
|
+
nextRevision: frame.revision + 1,
|
|
25
|
+
nextIndex: 0,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Fold one chunk frame.
|
|
30
|
+
* @returns the live delta to present, or `undefined` when the frame broke
|
|
31
|
+
* continuation (revision jump or index gap) and the attempt was dropped.
|
|
32
|
+
*/
|
|
33
|
+
chunk(key, frame) {
|
|
34
|
+
const attempt = this.#attempts.get(key);
|
|
35
|
+
if (attempt === undefined || frame.revision !== attempt.nextRevision || frame.index !== attempt.nextIndex) {
|
|
36
|
+
this.#attempts.delete(key);
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
attempt.nextRevision += 1;
|
|
40
|
+
attempt.nextIndex += 1;
|
|
41
|
+
const delta = { turn: attempt.turn, step: attempt.step, chunk: frame.chunk };
|
|
42
|
+
attempt.deltas.push(delta);
|
|
43
|
+
return delta;
|
|
44
|
+
}
|
|
45
|
+
/** Clear one attempt at its end frame or disposal. */
|
|
46
|
+
end(key) {
|
|
47
|
+
this.#attempts.delete(key);
|
|
48
|
+
}
|
|
49
|
+
/** Buffered deltas for one attempt, for replaying a rebuilt transcript. */
|
|
50
|
+
deltas(key) {
|
|
51
|
+
return this.#attempts.get(key)?.deltas ?? [];
|
|
52
|
+
}
|
|
53
|
+
/** Live attempt keys currently tracked. */
|
|
54
|
+
activeKeys() {
|
|
55
|
+
return this.#attempts.keys();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=live-attempt-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-attempt-tracker.js","sourceRoot":"","sources":["../../src/session/live-attempt-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAaH;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACpB,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAA;IAEnD,sFAAsF;IACtF,KAAK,CAAC,GAAW,EAAE,KAAkF;QACnG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE;YACtB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC;YAChC,SAAS,EAAE,CAAC;SACb,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAW,EAAE,KAKlB;QACC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACvC,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,YAAY,IAAI,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC;YAC1G,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAC1B,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,OAAO,CAAC,YAAY,IAAI,CAAC,CAAA;QACzB,OAAO,CAAC,SAAS,IAAI,CAAC,CAAA;QACtB,MAAM,KAAK,GAAgB,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAA;QACzF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC1B,OAAO,KAAK,CAAA;IACd,CAAC;IAED,sDAAsD;IACtD,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC;IAED,2EAA2E;IAC3E,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,EAAE,CAAA;IAC9C,CAAC;IAED,2CAA2C;IAC3C,UAAU;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IAC9B,CAAC;CACF"}
|
|
@@ -11,3 +11,5 @@ export interface ProjectContext {
|
|
|
11
11
|
export type GitRunner = (cwd: string, args: readonly string[]) => string;
|
|
12
12
|
/** Resolve a cwd to its worktree root, branch, and compact dirty counters. */
|
|
13
13
|
export declare function resolveProjectContext(cwd: string, runner?: GitRunner): ProjectContext;
|
|
14
|
+
/** Re-resolve one cwd immediately, refreshing the default-cache entry. */
|
|
15
|
+
export declare function refreshProjectContext(cwd: string, runner?: GitRunner): ProjectContext;
|
|
@@ -4,6 +4,8 @@ const runGit = (cwd, args) => execFileSync('git', ['-C', cwd, ...args], {
|
|
|
4
4
|
encoding: 'utf8',
|
|
5
5
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
6
6
|
});
|
|
7
|
+
/** Bounded freshness so an agent checkpoint or checkout is reflected without a restart. */
|
|
8
|
+
const PROJECT_CONTEXT_TTL_MS = 15_000;
|
|
7
9
|
const defaultCache = new Map();
|
|
8
10
|
function attempt(runner, cwd, args) {
|
|
9
11
|
try {
|
|
@@ -16,15 +18,27 @@ function attempt(runner, cwd, args) {
|
|
|
16
18
|
}
|
|
17
19
|
/** Resolve a cwd to its worktree root, branch, and compact dirty counters. */
|
|
18
20
|
export function resolveProjectContext(cwd, runner = runGit) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (runner === runGit) {
|
|
22
|
+
const cached = defaultCache.get(cwd);
|
|
23
|
+
if (cached !== undefined && Date.now() - cached.at < PROJECT_CONTEXT_TTL_MS)
|
|
24
|
+
return cached.value;
|
|
25
|
+
}
|
|
26
|
+
const result = resolveProjectContextFresh(cwd, runner);
|
|
27
|
+
if (runner === runGit)
|
|
28
|
+
defaultCache.set(cwd, { at: Date.now(), value: result });
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
/** Re-resolve one cwd immediately, refreshing the default-cache entry. */
|
|
32
|
+
export function refreshProjectContext(cwd, runner = runGit) {
|
|
33
|
+
const result = resolveProjectContextFresh(cwd, runner);
|
|
34
|
+
if (runner === runGit)
|
|
35
|
+
defaultCache.set(cwd, { at: Date.now(), value: result });
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
function resolveProjectContextFresh(cwd, runner) {
|
|
22
39
|
const root = attempt(runner, cwd, ['rev-parse', '--show-toplevel']);
|
|
23
40
|
if (root === undefined) {
|
|
24
|
-
|
|
25
|
-
if (runner === runGit)
|
|
26
|
-
defaultCache.set(cwd, result);
|
|
27
|
-
return result;
|
|
41
|
+
return { root: cwd, modified: 0, untracked: 0 };
|
|
28
42
|
}
|
|
29
43
|
const branch = attempt(runner, root, ['symbolic-ref', '--quiet', '--short', 'HEAD'])
|
|
30
44
|
?? attempt(runner, root, ['rev-parse', '--short', 'HEAD'])
|
|
@@ -44,9 +58,6 @@ export function resolveProjectContext(cwd, runner = runGit) {
|
|
|
44
58
|
const gitLabel = branch
|
|
45
59
|
+ (modified > 0 ? ` *${modified}` : '')
|
|
46
60
|
+ (untracked > 0 ? ` ?${untracked}` : '');
|
|
47
|
-
|
|
48
|
-
if (runner === runGit)
|
|
49
|
-
defaultCache.set(cwd, result);
|
|
50
|
-
return result;
|
|
61
|
+
return { root, branch, modified, untracked, gitLabel };
|
|
51
62
|
}
|
|
52
63
|
//# sourceMappingURL=project-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../../src/session/project-context.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAcjD,MAAM,MAAM,GAAc,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE;IACjF,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;CACpC,CAAC,CAAA;AACF,MAAM,YAAY,GAAG,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"project-context.js","sourceRoot":"","sources":["../../src/session/project-context.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAcjD,MAAM,MAAM,GAAc,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE;IACjF,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;CACpC,CAAC,CAAA;AACF,2FAA2F;AAC3F,MAAM,sBAAsB,GAAG,MAAM,CAAA;AACrC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAiD,CAAA;AAE7E,SAAS,OAAO,CAAC,MAAiB,EAAE,GAAW,EAAE,IAAuB;IACtE,IAAI,CAAC;QACH,MAAM,K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AO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -20,7 +20,7 @@ export function isBlankSession(session) {
|
|
|
20
20
|
|| event.type === 'request/context'
|
|
21
21
|
|| event.type === 'turn/start'
|
|
22
22
|
|| event.type === 'step/start'
|
|
23
|
-
|| event.type === 'assistant/
|
|
23
|
+
|| event.type === 'assistant/attempt'
|
|
24
24
|
|| event.type === 'tool/call'
|
|
25
25
|
|| event.type === 'tool/result');
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-configuration.js","sourceRoot":"","sources":["../../src/session/session-configuration.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,yBAAyB,EAAgB,MAAM,0BAA0B,CAAA;AAGlF;;;GAGG;AACH,SAAS,gCAAgC;IACtC,yBAAyC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;AACxE,CAAC;AAED,gCAAgC,EAAE,CAAA;AAElC,+EAA+E;AAC/E,MAAM,UAAU,yBAAyB,CAAC,WAAmB;IAC3D,OAAO,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;AAClD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACrD,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB;WACzE,KAAK,CAAC,IAAI,KAAK,iBAAiB;WAChC,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,YAAY;WAC3B,KAAK,CAAC,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"session-configuration.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ModelSelection } from '@deepseek-ai/dsh-agent';
|
|
|
11
11
|
import type { AgentPreset } from '@deepseek-ai/dsh-agent-presets';
|
|
12
12
|
import { type LlmResolvedModelInfo, type UserMessage } from '@deepseek-ai/dsh-llm';
|
|
13
13
|
import type { ImageAttachmentRef, SaveImageAttachment, StoredImageAttachment } from '@deepseek-ai/dsh-attachment';
|
|
14
|
-
import type {
|
|
14
|
+
import type { CommandSubmitAttachment } from '@deepseek-ai/dsh-commands';
|
|
15
15
|
import type { PermissionSelect } from '@deepseek-ai/dsh-permission-presets/types';
|
|
16
16
|
import type { PlanProjection } from '@deepseek-ai/dsh-plan-mode/types';
|
|
17
17
|
import { type SkillSummary } from '@deepseek-ai/dsh-skill';
|
|
18
18
|
import type { SessionStatsProjection } from '@deepseek-ai/dsh-session-stats/types';
|
|
19
19
|
import type { ContextBreakdownProjection, ContextPressureProjection, TokenUsageProjection } from '@deepseek-ai/dsh-token-meter/client';
|
|
20
20
|
import { type SessionEvent } from '@deepseek-ai/dsh-session';
|
|
21
|
+
import type { GoalProjection } from '@deepseek-ai/dsh-goal/types';
|
|
21
22
|
import type { TuiCommand, TuiRecentSession, TuiService, TuiSessionControls, TuiSessionStats, TuiSubmission, TuiInputImage } from '../definition.ts';
|
|
22
23
|
import type { ContextDiagnostics } from './context-diagnostics.ts';
|
|
23
24
|
/** Projection values consumed as one consistent snapshot when the units exist. */
|
|
@@ -28,6 +29,9 @@ export interface TuiStatsProjection {
|
|
|
28
29
|
contextBreakdown?: ContextBreakdownProjection;
|
|
29
30
|
plan?: PlanProjection;
|
|
30
31
|
permissions?: PermissionSelect;
|
|
32
|
+
goal?: GoalProjection | null;
|
|
33
|
+
/** Last logged sandbox-mode override, or null before one; outranks the preset while set. */
|
|
34
|
+
sandboxMode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
|
|
31
35
|
}
|
|
32
36
|
/** Present only the session controls whose owning Harness plugins are composed. */
|
|
33
37
|
export declare function sessionControls(projection?: TuiStatsProjection): TuiSessionControls;
|
|
@@ -91,7 +95,7 @@ export declare function createSubmissionMessage(submission: TuiSubmission, attac
|
|
|
91
95
|
};
|
|
92
96
|
} & Pick<UserMessage, "id" | "role">>;
|
|
93
97
|
/** Encode composer drafts for `ctx.commands.execute`. */
|
|
94
|
-
export declare function
|
|
98
|
+
export declare function encodeCommandAttachments(images: readonly TuiInputImage[]): CommandSubmitAttachment[];
|
|
95
99
|
/** Rehydrate one durable human inbox message into an editable composer draft. */
|
|
96
100
|
export declare function restoreSubmissionMessage(message: UserMessage, attachments?: RestoreAttachmentStore): Promise<TuiSubmission>;
|
|
97
101
|
/** Own one switchable top-level Agent and project it onto a TuiService. */
|
|
@@ -117,8 +121,10 @@ export declare class SessionRuntime {
|
|
|
117
121
|
get recentSessions(): readonly TuiRecentSession[];
|
|
118
122
|
/** Current model selection for the active Agent. */
|
|
119
123
|
selection(agent?: Agent): ModelSelection;
|
|
120
|
-
/** Replace the active Agent's selection
|
|
121
|
-
changeSelection(agent: Agent, selection: ModelSelection, info?: LlmResolvedModelInfo
|
|
124
|
+
/** Replace the active Agent's selection, optionally persisting it as the next default. */
|
|
125
|
+
changeSelection(agent: Agent, selection: ModelSelection, info?: LlmResolvedModelInfo, options?: {
|
|
126
|
+
persist?: boolean;
|
|
127
|
+
}): Promise<void>;
|
|
122
128
|
/** Start a new top-level session with the current model selection. */
|
|
123
129
|
newSession(agent: Agent): Promise<void>;
|
|
124
130
|
/** Replace the active top-level session with one durable session. */
|