dsh-working-activity 0.2.3 → 0.2.5

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.
@@ -1,37 +1,37 @@
1
- // Working-line dock entry: one dim full-width row above the composer card
2
- // showing the live working-activity snapshot — phase-colored breathing
3
- // marker, the host-composed status line, and the turn's tool count badge.
4
- // Renders for every live phase (waiting/thinking/tool) and the done summary;
5
- // hides while idle or before the first publish.
6
- //
7
- // The 'conversation.input.dock' SlotMap declaration lives in
8
- // @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts); this
9
- // entry contributes into it without owning it.
10
- import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
11
- import css from './WorkingLine.module.css'
12
-
13
- /** Full props of the dock entry: the input-zone runtime share (session standard kit). */
14
- export type WorkingLineProps = PropsRuntime<'conversation.input.dock'>
15
-
16
- /** Tool-count badge copy (no locale seat: the line text itself is host-composed). */
17
- const TOOLS_LABEL = 'tools this turn'
18
-
19
- /**
20
- * Working-line dock entry: reads the latest activity snapshot off the
21
- * conversation snapshot and renders the row, or nothing when idle/absent.
22
- */
23
- export function WorkingLine({ useSession }: WorkingLineProps) {
24
- const activity = useSession(s => s.activity)
25
- if (activity === null || activity.phase === 'idle' || activity.line === '') return null
26
- return (
27
- <div className={css.line} data-activity-phase={activity.phase}>
28
- <span className={css.marker} aria-hidden="true" />
29
- <span className={css.text}>{activity.line}</span>
30
- {activity.toolCount > 0 && (
31
- <span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>
32
- {activity.toolCount}
33
- </span>
34
- )}
35
- </div>
36
- )
37
- }
1
+ // Working-line dock entry: one dim full-width row above the composer card
2
+ // showing the live working-activity snapshot — phase-colored breathing
3
+ // marker, the host-composed status line, and the turn's tool count badge.
4
+ // Renders for every live phase (waiting/thinking/tool) and the done summary;
5
+ // hides while idle or before the first publish.
6
+ //
7
+ // The 'conversation.input.dock' SlotMap declaration lives in
8
+ // @deepseek-ai/dsh-client-ui-conversation/client (contract/slots.ts); this
9
+ // entry contributes into it without owning it.
10
+ import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
11
+ import css from './WorkingLine.module.css'
12
+
13
+ /** Full props of the dock entry: the input-zone runtime share (session standard kit). */
14
+ export type WorkingLineProps = PropsRuntime<'conversation.input.dock'>
15
+
16
+ /** Tool-count badge copy (no locale seat: the line text itself is host-composed). */
17
+ const TOOLS_LABEL = 'tools this turn'
18
+
19
+ /**
20
+ * Working-line dock entry: reads the latest activity snapshot off the
21
+ * conversation snapshot and renders the row, or nothing when idle/absent.
22
+ */
23
+ export function WorkingLine({ useSession }: WorkingLineProps) {
24
+ const activity = useSession(s => s.activity)
25
+ if (activity === null || activity.phase === 'idle' || activity.line === '') return null
26
+ return (
27
+ <div className={css.line} data-activity-phase={activity.phase}>
28
+ <span className={css.marker} aria-hidden="true" />
29
+ <span className={css.text}>{activity.line}</span>
30
+ {activity.toolCount > 0 && (
31
+ <span className={css.tools} title={`${activity.toolCount} ${TOOLS_LABEL}`}>
32
+ {activity.toolCount}
33
+ </span>
34
+ )}
35
+ </div>
36
+ )
37
+ }
@@ -1,50 +1,50 @@
1
- /**
2
- * Client-side activity snapshot type + the ConversationSnapshot merge that
3
- * carries it.
4
- *
5
- * The host half (@deepseek-ai/dsh-working-activity's node side) publishes
6
- * `activity/status` session events; the web runtime patch (dsh-client-runtime
7
- * activity field, shipping separately) narrows those frames into the
8
- * conversation snapshot's `activity` member. Until that runtime release lands
9
- * on npm, this module re-declares the field via declaration merging so the
10
- * dock component type-checks against the published rc.6 types.
11
- *
12
- * REMOVE the `declare module` block below once
13
- * `@deepseek-ai/dsh-client-runtime/client` ships `ConversationSnapshot.activity`
14
- * natively (the runtime's own `ActivityStatusView` is structurally identical
15
- * to {@link ActivitySnapshot}; the two then agree by construction).
16
- * @module @deepseek-ai/dsh-working-activity/client/activity
17
- */
18
-
19
- /** The `activity/status` phase vocabulary, mirroring the host's ActivityPhase. */
20
- export type ActivityPhase = 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'
21
-
22
- /** One `activity/status` snapshot as rendered by the dock line. */
23
- export interface ActivitySnapshot {
24
- /** Which activity phase the model is in right now. */
25
- readonly phase: ActivityPhase
26
- /** Full human-readable status line (plain text, no ANSI). */
27
- readonly line: string
28
- /** Short label of the current work (tool action or stage), when any. */
29
- readonly label?: string
30
- /** Detail fragment (path / command / search pattern), when any. */
31
- readonly detail?: string
32
- /** The playful phrase currently shown, when any. */
33
- readonly phrase?: string
34
- /** Tools completed in the current turn. */
35
- readonly toolCount: number
36
- /** Wall-clock milliseconds since the current turn started (0 when idle). */
37
- readonly turnElapsedMs: number
38
- /** Wall-clock time the current phase started, for animations. */
39
- readonly phaseStartedAt: number
40
- }
41
-
42
- declare module '@deepseek-ai/dsh-client-runtime/client' {
43
- interface ConversationSnapshot {
44
- /**
45
- * Latest validated `activity/status` snapshot (the working-activity
46
- * plugin's live working line), or null before the first publish.
47
- */
48
- activity: ActivitySnapshot | null
49
- }
50
- }
1
+ /**
2
+ * Client-side activity snapshot type + the ConversationSnapshot merge that
3
+ * carries it.
4
+ *
5
+ * The host half (@deepseek-ai/dsh-working-activity's node side) publishes
6
+ * `activity/status` session events; the web runtime patch (dsh-client-runtime
7
+ * activity field, shipping separately) narrows those frames into the
8
+ * conversation snapshot's `activity` member. Until that runtime release lands
9
+ * on npm, this module re-declares the field via declaration merging so the
10
+ * dock component type-checks against the published rc.6 types.
11
+ *
12
+ * REMOVE the `declare module` block below once
13
+ * `@deepseek-ai/dsh-client-runtime/client` ships `ConversationSnapshot.activity`
14
+ * natively (the runtime's own `ActivityStatusView` is structurally identical
15
+ * to {@link ActivitySnapshot}; the two then agree by construction).
16
+ * @module @deepseek-ai/dsh-working-activity/client/activity
17
+ */
18
+
19
+ /** The `activity/status` phase vocabulary, mirroring the host's ActivityPhase. */
20
+ export type ActivityPhase = 'idle' | 'waiting' | 'thinking' | 'tool' | 'done'
21
+
22
+ /** One `activity/status` snapshot as rendered by the dock line. */
23
+ export interface ActivitySnapshot {
24
+ /** Which activity phase the model is in right now. */
25
+ readonly phase: ActivityPhase
26
+ /** Full human-readable status line (plain text, no ANSI). */
27
+ readonly line: string
28
+ /** Short label of the current work (tool action or stage), when any. */
29
+ readonly label?: string
30
+ /** Detail fragment (path / command / search pattern), when any. */
31
+ readonly detail?: string
32
+ /** The playful phrase currently shown, when any. */
33
+ readonly phrase?: string
34
+ /** Tools completed in the current turn. */
35
+ readonly toolCount: number
36
+ /** Wall-clock milliseconds since the current turn started (0 when idle). */
37
+ readonly turnElapsedMs: number
38
+ /** Wall-clock time the current phase started, for animations. */
39
+ readonly phaseStartedAt: number
40
+ }
41
+
42
+ declare module '@deepseek-ai/dsh-client-runtime/client' {
43
+ interface ConversationSnapshot {
44
+ /**
45
+ * Latest validated `activity/status` snapshot (the working-activity
46
+ * plugin's live working line), or null before the first publish.
47
+ */
48
+ activity: ActivitySnapshot | null
49
+ }
50
+ }
@@ -1,6 +1,6 @@
1
- /* CSS Modules ambient declaration for the client half (tsc only; the tsdown
2
- bundle inlines compiled class maps). */
3
- declare module '*.module.css' {
4
- const classes: Readonly<Record<string, string>>
5
- export default classes
6
- }
1
+ /* CSS Modules ambient declaration for the client half (tsc only; the tsdown
2
+ bundle inlines compiled class maps). */
3
+ declare module '*.module.css' {
4
+ const classes: Readonly<Record<string, string>>
5
+ export default classes
6
+ }
@@ -1,42 +1,42 @@
1
- /**
2
- * Working-activity surface plugin, browser half: the working-line entry in
3
- * the conversation.input.dock strip. This package's node half emits
4
- * `activity/status` session events; the web runtime patch narrows them into
5
- * the conversation snapshot's `activity` member, so this dock entry reads
6
- * the live frame through the standard session kit and owns no store, no
7
- * refresh chain, and no event listener.
8
- *
9
- * Mount contract (see the root README's "Web UI 集成" section): the web
10
- * client's client-modules host scans loader entries for `dsh.client`
11
- * declarations and serves this package's `./client` bundle at
12
- * /plugins/dsh-working-activity/client.js. The entry contributes into the
13
- * input dock — no official-source patch is involved.
14
- */
15
- import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'
16
- // Type-only: pulls the ui-conversation SlotMap merge (the input.dock entry)
17
- // through the Client assembly boundary.
18
- import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
19
- import { WorkingLine } from './WorkingLine.tsx'
20
- import type { ActivityPhase, ActivitySnapshot } from './activity.ts'
21
-
22
- export { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'
23
- export type { ActivityPhase, ActivitySnapshot } from './activity.ts'
24
-
25
- /** Required services for the dock registration. */
26
- export const inject = ['slots']
27
-
28
- /**
29
- * Client plugin body: the working-line dock entry.
30
- * @param ctx - client root context.
31
- */
32
- export function apply(ctx: ClientContext): void {
33
- ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({
34
- name: 'conversation.input.dock',
35
- // The pre-slots patch used the same id in ui-conversation; entries with
36
- // equal order render in registration order, and goal (10) / queue (20)
37
- // keep their seats — this row sits between them.
38
- id: 'activity',
39
- order: 15,
40
- registrant: 'dsh-working-activity',
41
- }, WorkingLine))
42
- }
1
+ /**
2
+ * Working-activity surface plugin, browser half: the working-line entry in
3
+ * the conversation.input.dock strip. This package's node half emits
4
+ * `activity/status` session events; the web runtime patch narrows them into
5
+ * the conversation snapshot's `activity` member, so this dock entry reads
6
+ * the live frame through the standard session kit and owns no store, no
7
+ * refresh chain, and no event listener.
8
+ *
9
+ * Mount contract (see the root README's "Web UI 集成" section): the web
10
+ * client's client-modules host scans loader entries for `dsh.client`
11
+ * declarations and serves this package's `./client` bundle at
12
+ * /plugins/dsh-working-activity/client.js. The entry contributes into the
13
+ * input dock — no official-source patch is involved.
14
+ */
15
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'
16
+ // Type-only: pulls the ui-conversation SlotMap merge (the input.dock entry)
17
+ // through the Client assembly boundary.
18
+ import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
19
+ import { WorkingLine } from './WorkingLine.tsx'
20
+ import type { ActivityPhase, ActivitySnapshot } from './activity.ts'
21
+
22
+ export { WorkingLine, type WorkingLineProps } from './WorkingLine.tsx'
23
+ export type { ActivityPhase, ActivitySnapshot } from './activity.ts'
24
+
25
+ /** Required services for the dock registration. */
26
+ export const inject = ['slots']
27
+
28
+ /**
29
+ * Client plugin body: the working-line dock entry.
30
+ * @param ctx - client root context.
31
+ */
32
+ export function apply(ctx: ClientContext): void {
33
+ ctx.slots.inject('conversation.input.dock', () => ctx.slots.register({
34
+ name: 'conversation.input.dock',
35
+ // The pre-slots patch used the same id in ui-conversation; entries with
36
+ // equal order render in registration order, and goal (10) / queue (20)
37
+ // keep their seats — this row sits between them.
38
+ id: 'activity',
39
+ order: 15,
40
+ registrant: 'dsh-working-activity',
41
+ }, WorkingLine))
42
+ }
package/src/events.ts CHANGED
@@ -1,45 +1,45 @@
1
- /**
2
- * `activity/status` session event — a log-only, non-surface snapshot of the
3
- * model's current working activity, published by this plugin for any UI
4
- * consumer (Web client, telemetry, …). It never enters derived model history
5
- * (no `surfaceOp`), so it cannot leak into prompts; UIs render it like
6
- * `todo/write` or `plan/mode`.
7
- * @module @deepseek-ai/dsh-working-activity/events
8
- */
9
-
10
- import type { ActivityPhase } from './status.js'
11
-
12
- /** Durable payload of one `activity/status` snapshot. */
13
- export interface ActivityStatusEvent {
14
- /** Which activity phase the model is in. */
15
- readonly phase: ActivityPhase
16
- /** Human-readable status line (plain text, no ANSI). */
17
- readonly line: string
18
- /** Short label of the current work, when any. */
19
- readonly label?: string
20
- /** Detail fragment (path / command / pattern), when any. */
21
- readonly detail?: string
22
- /** The playful phrase currently shown, when the copy pool is on. */
23
- readonly phrase?: string
24
- /** Tools completed in the current turn. */
25
- readonly toolCount: number
26
- /** Milliseconds since the current turn started (0 when idle). */
27
- readonly turnElapsedMs: number
28
- /** Wall-clock time (epoch ms) the current phase started, for animations. */
29
- readonly phaseStartedAt: number
30
- }
31
-
32
- /** The `activity/status` phase vocabulary, exported for wire consumers. */
33
- export type { ActivityPhase }
34
-
35
- declare module '@deepseek-ai/dsh-session/types' {
36
- interface SessionEventMap {
37
- /**
38
- * Log-only UI snapshot of the model's working activity (thinking copy,
39
- * running tool, turn elapsed). Never a surface event: UIs render it, the
40
- * model never sees it.
41
- * @param data - The rendered status snapshot.
42
- */
43
- 'activity/status': ActivityStatusEvent
44
- }
45
- }
1
+ /**
2
+ * `activity/status` session event — a log-only, non-surface snapshot of the
3
+ * model's current working activity, published by this plugin for any UI
4
+ * consumer (Web client, telemetry, …). It never enters derived model history
5
+ * (no `surfaceOp`), so it cannot leak into prompts; UIs render it like
6
+ * `todo/write` or `plan/mode`.
7
+ * @module @deepseek-ai/dsh-working-activity/events
8
+ */
9
+
10
+ import type { ActivityPhase } from './status.js'
11
+
12
+ /** Durable payload of one `activity/status` snapshot. */
13
+ export interface ActivityStatusEvent {
14
+ /** Which activity phase the model is in. */
15
+ readonly phase: ActivityPhase
16
+ /** Human-readable status line (plain text, no ANSI). */
17
+ readonly line: string
18
+ /** Short label of the current work, when any. */
19
+ readonly label?: string
20
+ /** Detail fragment (path / command / pattern), when any. */
21
+ readonly detail?: string
22
+ /** The playful phrase currently shown, when the copy pool is on. */
23
+ readonly phrase?: string
24
+ /** Tools completed in the current turn. */
25
+ readonly toolCount: number
26
+ /** Milliseconds since the current turn started (0 when idle). */
27
+ readonly turnElapsedMs: number
28
+ /** Wall-clock time (epoch ms) the current phase started, for animations. */
29
+ readonly phaseStartedAt: number
30
+ }
31
+
32
+ /** The `activity/status` phase vocabulary, exported for wire consumers. */
33
+ export type { ActivityPhase }
34
+
35
+ declare module '@deepseek-ai/dsh-session/types' {
36
+ interface SessionEventMap {
37
+ /**
38
+ * Log-only UI snapshot of the model's working activity (thinking copy,
39
+ * running tool, turn elapsed). Never a surface event: UIs render it, the
40
+ * model never sees it.
41
+ * @param data - The rendered status snapshot.
42
+ */
43
+ 'activity/status': ActivityStatusEvent
44
+ }
45
+ }