dsh-cool-session 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +24 -2
- package/README.zh.md +25 -0
- package/cordis.patch.yml +7 -0
- package/lib/client.js +1602 -0
- package/lib/index.js +690 -0
- package/lib/types/client/api.d.ts +30 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/archive.d.ts +43 -0
- package/lib/types/client/archive.d.ts.map +1 -0
- package/lib/types/client/icons.d.ts +32 -0
- package/lib/types/client/icons.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +28 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +143 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/nav-icon.d.ts +30 -0
- package/lib/types/client/nav-icon.d.ts.map +1 -0
- package/lib/types/client/reason.d.ts +24 -0
- package/lib/types/client/reason.d.ts.map +1 -0
- package/lib/types/client/session-menu.d.ts +65 -0
- package/lib/types/client/session-menu.d.ts.map +1 -0
- package/lib/types/client/settings-section.d.ts +43 -0
- package/lib/types/client/settings-section.d.ts.map +1 -0
- package/lib/types/client/styles.d.ts +26 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/host/deletion.d.ts +26 -0
- package/lib/types/host/deletion.d.ts.map +1 -0
- package/lib/types/host/index.d.ts +20 -0
- package/lib/types/host/index.d.ts.map +1 -0
- package/lib/types/host/refusal.d.ts +25 -0
- package/lib/types/host/refusal.d.ts.map +1 -0
- package/lib/types/host/routes.d.ts +28 -0
- package/lib/types/host/routes.d.ts.map +1 -0
- package/lib/types/shared/contract.d.ts +61 -0
- package/lib/types/shared/contract.d.ts.map +1 -0
- package/package.json +69 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client half of the package-private bridge to the Host routes.
|
|
3
|
+
*
|
|
4
|
+
* Every route answers JSON and never rejects: a transport failure becomes an
|
|
5
|
+
* `{ ok: false }` result the dialog reports in place, so the page has exactly
|
|
6
|
+
* one failure shape to render no matter how the answer went wrong.
|
|
7
|
+
*/
|
|
8
|
+
import type { DeleteManyPayload, DeletePayload } from '../shared/contract.js';
|
|
9
|
+
/**
|
|
10
|
+
* Ask the Host to delete one Session and every subagent Session beneath it.
|
|
11
|
+
*
|
|
12
|
+
* The Host stops running work first, then removes the artifacts.
|
|
13
|
+
*
|
|
14
|
+
* @param sessionId - the root Session to delete.
|
|
15
|
+
* @returns the deletion summary, or a coded refusal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function deleteSession(sessionId: string): Promise<DeletePayload>;
|
|
18
|
+
/**
|
|
19
|
+
* Ask the Host to delete several Sessions.
|
|
20
|
+
*
|
|
21
|
+
* The Host runs the same stop-then-remove sequence as {@link deleteSession} for
|
|
22
|
+
* each id, sequentially, and answers one result per id. When this Host half does
|
|
23
|
+
* not serve the batch route yet, the same work is done through the single route
|
|
24
|
+
* so the panel keeps working across a live plugin upgrade and a later restart.
|
|
25
|
+
*
|
|
26
|
+
* @param sessionIds - the root Sessions to delete, in request order.
|
|
27
|
+
* @returns the per-session summaries, or a request-level refusal.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteSessions(sessionIds: readonly string[]): Promise<DeleteManyPayload>;
|
|
30
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/client/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AA6B7E;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAEvE;AA0BD;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqB9F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archive and unarchive through DSH's own Workspace controller.
|
|
3
|
+
*
|
|
4
|
+
* The browser already holds a live Workspace snapshot and a generated remote
|
|
5
|
+
* namespace for it, so archival does not need a route of this plugin's own: the
|
|
6
|
+
* controller's call keeps the archive set authoritative on the Host and pushes
|
|
7
|
+
* the new set to every connected surface. The single failure worth wording
|
|
8
|
+
* separately is the Host's refusal of a Session with running work: the panel
|
|
9
|
+
* offers to stop that work and retry, exactly as the native sidebar does.
|
|
10
|
+
*/
|
|
11
|
+
import type { Failure } from '../shared/contract.js';
|
|
12
|
+
/** One family of work that keeps a Session from being archived. */
|
|
13
|
+
export interface ArchiveActivity {
|
|
14
|
+
/** Provider family: `turn`, `subagent`, `job`, `schedule`, or one this build does not know. */
|
|
15
|
+
readonly kind: string;
|
|
16
|
+
/** Number of active items the family reported. */
|
|
17
|
+
readonly count: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One archive attempt's outcome.
|
|
21
|
+
*
|
|
22
|
+
* `active` is the Host's "stop this first" answer; every other refusal is
|
|
23
|
+
* either a code the page words from its dictionary (`failure`), a missing
|
|
24
|
+
* service (`unavailable`), or raw diagnostic text (`message`).
|
|
25
|
+
*/
|
|
26
|
+
export interface ArchiveResult {
|
|
27
|
+
readonly ok: boolean;
|
|
28
|
+
readonly active?: readonly ArchiveActivity[];
|
|
29
|
+
readonly failure?: Failure;
|
|
30
|
+
readonly unavailable?: boolean;
|
|
31
|
+
readonly message?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Archive or restore one Session.
|
|
35
|
+
*
|
|
36
|
+
* @param workspaces - the client Workspace service, when the composition mounts one.
|
|
37
|
+
* @param sessionId - the Session to move between the two sets.
|
|
38
|
+
* @param archived - which set it should end in.
|
|
39
|
+
* @param stopActivity - ask the Host to stop running work instead of refusing.
|
|
40
|
+
* @returns the outcome the panel renders.
|
|
41
|
+
*/
|
|
42
|
+
export declare function setSessionArchived(workspaces: any, sessionId: string, archived: boolean, stopActivity: boolean): Promise<ArchiveResult>;
|
|
43
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../src/client/archive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AA2BD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,aAAa,CAAC,CA2BxB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin's icon artwork, built from `src/client/assets/*.svg`.
|
|
3
|
+
*
|
|
4
|
+
* The client bundle is one JS file the platform's module loader evaluates, so
|
|
5
|
+
* sibling asset files would never be fetched. tsdown.config.ts reads the artwork
|
|
6
|
+
* at build time and exposes it as the `__DSH_CS_ICONS__` string map this module
|
|
7
|
+
* consumes, keyed by asset filename stem — the arrangement dsh-cool-git uses.
|
|
8
|
+
*
|
|
9
|
+
* dsh-cool-git renders each asset as a React component because those glyphs live
|
|
10
|
+
* in its own trees. This plugin's glyphs have different owners: the Settings
|
|
11
|
+
* navigation cell is shell-owned DOM, so the archive artwork is exposed as the
|
|
12
|
+
* markup the patch writes into that seat (the way dsh-cool-theme installs its
|
|
13
|
+
* palette); the filter caret is drawn by this package's own page, so its markup
|
|
14
|
+
* is embedded the same way inside the trigger. Parsing still happens once, at
|
|
15
|
+
* module evaluation, with the same viewBox/inner split.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The Sessions glyph as complete markup for the shell's navigation seat.
|
|
19
|
+
*
|
|
20
|
+
* It carries its own 16px size because the asset's `1em` would resolve against
|
|
21
|
+
* the nav cell's 14px text, and the stroke is `currentColor`, so the glyph takes
|
|
22
|
+
* the label's color in both appearances.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ARCHIVE_NAV_MARKUP: string;
|
|
25
|
+
/**
|
|
26
|
+
* The caret beside the panel's two filter triggers.
|
|
27
|
+
*
|
|
28
|
+
* `assets/arrow-down.svg` strokes with `currentColor`, so the trigger's label
|
|
29
|
+
* color reaches it; the fixed 12px keeps it clear of the control's 13px text.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ARROW_DOWN_MARKUP: string;
|
|
32
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/client/icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA8CH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,QAAuC,CAAA;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAAuC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client entry for dsh-cool-session.
|
|
3
|
+
*
|
|
4
|
+
* Contributes one native Session-menu row, the frame-wide confirmation it
|
|
5
|
+
* opens, and the Sessions section of the Settings panel. The row lives in
|
|
6
|
+
* `sidebar.workspaces.session.menu.item`; the dialog lives in `shell.overlay`,
|
|
7
|
+
* because the menu unmounts as soon as it closes and cannot own a dialog that
|
|
8
|
+
* must outlive that click; the section lives in `settings.section`, which the
|
|
9
|
+
* settings shell projects into its navigation.
|
|
10
|
+
*
|
|
11
|
+
* The section reads the shell's Session and Workspace stores directly and
|
|
12
|
+
* archives through the Workspace controller, so only deletion — the operation
|
|
13
|
+
* the client face does not expose — needs this package's own Host route.
|
|
14
|
+
*/
|
|
15
|
+
export declare const name = "dsh-cool-session/client";
|
|
16
|
+
/**
|
|
17
|
+
* The locale service is a required collaborator rather than an optional one.
|
|
18
|
+
*
|
|
19
|
+
* The confirmation is worded entirely from this package's dictionaries, so a
|
|
20
|
+
* composition without the service could only draw the wrong language: declaring
|
|
21
|
+
* the dependency is what makes the framework apply this plugin once the service
|
|
22
|
+
* is there, and what makes `ctx.get('locale')` below answer. DSH mounts the
|
|
23
|
+
* service with the web client tree itself (`@deepseek-ai/dsh-web-app`), so
|
|
24
|
+
* nothing this menu row can run in is without it.
|
|
25
|
+
*/
|
|
26
|
+
export declare const inject: string[];
|
|
27
|
+
export declare function apply(ctx: any): void;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,eAAO,MAAM,IAAI,4BAA4B,CAAA;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,UAAsB,CAAA;AAiBzC,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAiHpC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The confirmation's copy, in the two locales DSH ships.
|
|
3
|
+
*
|
|
4
|
+
* Every sentence the dialog draws lives here rather than at the point it is
|
|
5
|
+
* drawn, for two reasons. The page is what knows the language to read in — the
|
|
6
|
+
* Host does not — so a refusal reaches it as a code (see `shared/contract.ts`)
|
|
7
|
+
* and is worded from the `error.<code>` entry below; and the locale service
|
|
8
|
+
* re-renders the dialog when the language is switched, which only works if the
|
|
9
|
+
* copy is looked up at render time through the `t` seat rather than captured in
|
|
10
|
+
* a constant.
|
|
11
|
+
*
|
|
12
|
+
* The two dictionaries must carry exactly the same keys: `zh` is typed as
|
|
13
|
+
* `typeof en`, so a key added to one and forgotten in the other is a compile
|
|
14
|
+
* error rather than a dialog that falls back mid-sentence.
|
|
15
|
+
*
|
|
16
|
+
* Count-bearing sentences come in the `.one` / `.other` pair the shipped
|
|
17
|
+
* dictionaries use. The locale service interpolates `{name}` placeholders but
|
|
18
|
+
* does not choose plural forms, so the caller picks the spelling from the count
|
|
19
|
+
* through {@link countKey}; Chinese spells both variants the same way.
|
|
20
|
+
*/
|
|
21
|
+
import type { FailureCode } from '../shared/contract.js';
|
|
22
|
+
/** The dictionary namespace this page owns. */
|
|
23
|
+
export declare const NS = "coolSession";
|
|
24
|
+
/**
|
|
25
|
+
* The messages whose wording follows a count.
|
|
26
|
+
*
|
|
27
|
+
* Each base owns a `.one` and an `.other` entry; nothing else may be drawn from
|
|
28
|
+
* it, so a missing plural spelling is a compile error like any other key.
|
|
29
|
+
*/
|
|
30
|
+
export type PluralBase = 'sessions.bulkPartial' | 'sessions.bulkStopped' | 'sessions.bulkArchivePartial' | 'sessions.bulkArchiveFailed' | 'sessions.activitySubagents' | 'sessions.activityJobs' | 'sessions.activitySchedules' | 'sessions.activityOther';
|
|
31
|
+
/** The copy of the menu row, the Settings page, the confirmations, and their refusals. */
|
|
32
|
+
type UiKey =
|
|
33
|
+
/** The native Session menu's row. */
|
|
34
|
+
'action.delete'
|
|
35
|
+
/** The Settings navigation entry and the page behind it. */
|
|
36
|
+
| 'settings.nav' | 'settings.title' | 'settings.description'
|
|
37
|
+
/** The management panel's controls. */
|
|
38
|
+
| 'sessions.search' | 'sessions.searchPlaceholder' | 'sessions.allWorkspaces' | 'sessions.noWorkspace' | 'sessions.allSessions' | 'sessions.unarchived' | 'sessions.archived' | 'sessions.running' | 'sessions.selectAll' | 'sessions.selectOne' | 'sessions.archiveSelected' | 'sessions.deleteSelected' | 'sessions.selectedCount' | 'sessions.columnTitle' | 'sessions.columnStatus' | 'sessions.columnActions' | 'sessions.archive' | 'sessions.unarchive' | 'sessions.delete'
|
|
39
|
+
/** The management panel's list states. */
|
|
40
|
+
| 'sessions.loading' | 'sessions.empty' | 'sessions.noMatches' | 'sessions.loadFailed' | 'sessions.retry' | 'sessions.unavailable' | 'sessions.actionFailed'
|
|
41
|
+
/** The panel's delete confirmation. */
|
|
42
|
+
| 'sessions.deleteSelectedTitle' | 'sessions.deleteBatchDescription'
|
|
43
|
+
/** The panel's stop-and-archive confirmation. */
|
|
44
|
+
| 'sessions.archiveStopTitle' | 'sessions.archiveStopDescription' | 'sessions.archiveActivity' | 'sessions.activityTurn' | 'sessions.archiveStopAction' | 'sessions.archiveStopPending'
|
|
45
|
+
/** The count-bearing messages, in their singular and plural spellings. */
|
|
46
|
+
| `${PluralBase}.one` | `${PluralBase}.other`
|
|
47
|
+
/** The native menu's confirmation and both dialogs' buttons. */
|
|
48
|
+
| 'action.cancel' | 'action.close' | 'delete.title' | 'delete.description' | 'delete.pending' | 'delete.confirm'
|
|
49
|
+
/** A Host half that has not reloaded the new delete route yet. */
|
|
50
|
+
| 'error.host-stale';
|
|
51
|
+
/** Every key the page draws from, including the refusal codes. */
|
|
52
|
+
export type MessageKey = UiKey | `error.${FailureCode}`;
|
|
53
|
+
/**
|
|
54
|
+
* The translate seat the page draws through.
|
|
55
|
+
*
|
|
56
|
+
* A key and its placeholder values, read at call time: the function a locale
|
|
57
|
+
* switch hands out is a new one, which is what re-renders the dialog.
|
|
58
|
+
*/
|
|
59
|
+
export type Translate = (key: MessageKey, params?: Readonly<Record<string, string | number>>) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Pick the singular or plural spelling of a count-bearing message.
|
|
62
|
+
*
|
|
63
|
+
* @param base - the message family, whose `.one` and `.other` entries exist.
|
|
64
|
+
* @param count - the number the sentence reports.
|
|
65
|
+
* @returns the key to translate.
|
|
66
|
+
*/
|
|
67
|
+
export declare function countKey(base: PluralBase, count: number): MessageKey;
|
|
68
|
+
/** The English copy, which is also the fallback every lookup ends at. */
|
|
69
|
+
export declare const en: {
|
|
70
|
+
'action.delete': string;
|
|
71
|
+
'action.cancel': string;
|
|
72
|
+
'action.close': string;
|
|
73
|
+
'settings.nav': string;
|
|
74
|
+
'settings.title': string;
|
|
75
|
+
'settings.description': string;
|
|
76
|
+
'sessions.search': string;
|
|
77
|
+
'sessions.searchPlaceholder': string;
|
|
78
|
+
'sessions.allWorkspaces': string;
|
|
79
|
+
'sessions.noWorkspace': string;
|
|
80
|
+
'sessions.allSessions': string;
|
|
81
|
+
'sessions.unarchived': string;
|
|
82
|
+
'sessions.archived': string;
|
|
83
|
+
'sessions.running': string;
|
|
84
|
+
'sessions.selectAll': string;
|
|
85
|
+
'sessions.selectOne': string;
|
|
86
|
+
'sessions.archiveSelected': string;
|
|
87
|
+
'sessions.deleteSelected': string;
|
|
88
|
+
'sessions.selectedCount': string;
|
|
89
|
+
'sessions.columnTitle': string;
|
|
90
|
+
'sessions.columnStatus': string;
|
|
91
|
+
'sessions.columnActions': string;
|
|
92
|
+
'sessions.archive': string;
|
|
93
|
+
'sessions.unarchive': string;
|
|
94
|
+
'sessions.delete': string;
|
|
95
|
+
'sessions.loading': string;
|
|
96
|
+
'sessions.empty': string;
|
|
97
|
+
'sessions.noMatches': string;
|
|
98
|
+
'sessions.loadFailed': string;
|
|
99
|
+
'sessions.retry': string;
|
|
100
|
+
'sessions.unavailable': string;
|
|
101
|
+
'sessions.actionFailed': string;
|
|
102
|
+
'sessions.bulkPartial.one': string;
|
|
103
|
+
'sessions.bulkPartial.other': string;
|
|
104
|
+
'sessions.bulkStopped.one': string;
|
|
105
|
+
'sessions.bulkStopped.other': string;
|
|
106
|
+
'sessions.bulkArchivePartial.one': string;
|
|
107
|
+
'sessions.bulkArchivePartial.other': string;
|
|
108
|
+
'sessions.bulkArchiveFailed.one': string;
|
|
109
|
+
'sessions.bulkArchiveFailed.other': string;
|
|
110
|
+
'sessions.deleteSelectedTitle': string;
|
|
111
|
+
'sessions.deleteBatchDescription': string;
|
|
112
|
+
'sessions.archiveStopTitle': string;
|
|
113
|
+
'sessions.archiveStopDescription': string;
|
|
114
|
+
'sessions.archiveActivity': string;
|
|
115
|
+
'sessions.activityTurn': string;
|
|
116
|
+
'sessions.activitySubagents.one': string;
|
|
117
|
+
'sessions.activitySubagents.other': string;
|
|
118
|
+
'sessions.activityJobs.one': string;
|
|
119
|
+
'sessions.activityJobs.other': string;
|
|
120
|
+
'sessions.activitySchedules.one': string;
|
|
121
|
+
'sessions.activitySchedules.other': string;
|
|
122
|
+
'sessions.activityOther.one': string;
|
|
123
|
+
'sessions.activityOther.other': string;
|
|
124
|
+
'sessions.archiveStopAction': string;
|
|
125
|
+
'sessions.archiveStopPending': string;
|
|
126
|
+
'delete.title': string;
|
|
127
|
+
'delete.description': string;
|
|
128
|
+
'delete.pending': string;
|
|
129
|
+
'delete.confirm': string;
|
|
130
|
+
'error.host-stale': string;
|
|
131
|
+
'error.missing-session': string;
|
|
132
|
+
'error.unknown-session': string;
|
|
133
|
+
'error.subagent-delete': string;
|
|
134
|
+
'error.delete-failed': string;
|
|
135
|
+
'error.delete-unsupported': string;
|
|
136
|
+
'error.delete-active': string;
|
|
137
|
+
'error.session-live': string;
|
|
138
|
+
'error.delete-partial': string;
|
|
139
|
+
};
|
|
140
|
+
/** The Chinese copy, key for key the same page. */
|
|
141
|
+
export declare const zh: typeof en;
|
|
142
|
+
export {};
|
|
143
|
+
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,+CAA+C;AAC/C,eAAO,MAAM,EAAE,gBAAgB,CAAA;AAE/B;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAClB,sBAAsB,GACtB,sBAAsB,GACtB,6BAA6B,GAC7B,4BAA4B,GAC5B,4BAA4B,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,wBAAwB,CAAA;AAE5B,0FAA0F;AAC1F,KAAK,KAAK;AACR,qCAAqC;AACnC,eAAe;AACjB,4DAA4D;GAC1D,cAAc,GACd,gBAAgB,GAChB,sBAAsB;AACxB,uCAAuC;GACrC,iBAAiB,GACjB,4BAA4B,GAC5B,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,GACvB,wBAAwB,GACxB,kBAAkB,GAClB,oBAAoB,GACpB,iBAAiB;AACnB,0CAA0C;GACxC,kBAAkB,GAClB,gBAAgB,GAChB,oBAAoB,GACpB,qBAAqB,GACrB,gBAAgB,GAChB,sBAAsB,GACtB,uBAAuB;AACzB,uCAAuC;GACrC,8BAA8B,GAC9B,iCAAiC;AACnC,iDAAiD;GAC/C,2BAA2B,GAC3B,iCAAiC,GACjC,0BAA0B,GAC1B,uBAAuB,GACvB,4BAA4B,GAC5B,6BAA6B;AAC/B,0EAA0E;GACxE,GAAG,UAAU,MAAM,GACnB,GAAG,UAAU,QAAQ;AACvB,gEAAgE;GAC9D,eAAe,GACf,cAAc,GACd,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,gBAAgB;AAClB,kEAAkE;GAChE,kBAAkB,CAAA;AAEtB,kEAAkE;AAClE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,WAAW,EAAE,CAAA;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,UAAU,EACf,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,KAC/C,MAAM,CAAA;AAEX;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAEpE;AAED,yEAAyE;AACzE,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EuB,CAAA;AAEtC,mDAAmD;AACnD,eAAO,MAAM,EAAE,EAAE,OAAO,EA8EvB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The archive glyph on the Settings panel's Sessions entry.
|
|
3
|
+
*
|
|
4
|
+
* A section registration carries a label, not an icon: the shipped settings
|
|
5
|
+
* shell picks its navigation glyph from the section id (`navIcon(row.id)` in
|
|
6
|
+
* ui-settings-general), and every id it does not know — a plugin's id included —
|
|
7
|
+
* gets the generic gear. The entry therefore owns its glyph the only way a
|
|
8
|
+
* plugin can: after the cell renders, hide the shell's gear and put the parsed
|
|
9
|
+
* `assets/archive.svg` artwork in the seat beside the label. dsh-cool-theme
|
|
10
|
+
* patches its palette into the same seat for the same reason.
|
|
11
|
+
*
|
|
12
|
+
* Matching is by the rendered label rather than by class hash, because the
|
|
13
|
+
* shell's CSS module hashes rotate between releases. The observer only watches
|
|
14
|
+
* child-list changes: opening and closing Settings replaces the cell's children,
|
|
15
|
+
* while typing elsewhere in the page usually edits text nodes and must not
|
|
16
|
+
* trigger a scan.
|
|
17
|
+
*/
|
|
18
|
+
import { type Translate } from './locales.js';
|
|
19
|
+
/**
|
|
20
|
+
* Keep the Sessions entry's glyph patched for the plugin's lifetime.
|
|
21
|
+
*
|
|
22
|
+
* Runs once for a panel that is already open and again whenever the shell mounts
|
|
23
|
+
* or re-renders the navigation. The disposer removes the inserted spans and
|
|
24
|
+
* restores the gears, so an HMR update does not leave two glyphs in the seat.
|
|
25
|
+
*
|
|
26
|
+
* @param t - the plugin's translate seat, for the current locale's label.
|
|
27
|
+
* @returns the disposer that stops observation and restores the shell's DOM.
|
|
28
|
+
*/
|
|
29
|
+
export declare function installSessionNavIcon(t: Translate): () => void;
|
|
30
|
+
//# sourceMappingURL=nav-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-icon.d.ts","sourceRoot":"","sources":["../../../src/client/nav-icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AA6DrD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,IAAI,CA8B9D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One Host answer's refusal, as the sentence a page shows.
|
|
3
|
+
*
|
|
4
|
+
* A coded refusal is worded here from the page's dictionary, so the same answer
|
|
5
|
+
* reads in the active language; diagnostics another program wrote stay verbatim.
|
|
6
|
+
* Both the native menu's dialog and the management panel render their failures
|
|
7
|
+
* through this one function, which keeps the two surfaces agreeing about a
|
|
8
|
+
* partial deletion's detail line.
|
|
9
|
+
*/
|
|
10
|
+
import type { DeletePayload } from '../shared/contract.js';
|
|
11
|
+
import type { MessageKey, Translate } from './locales.js';
|
|
12
|
+
/** The refusal fragment any Host answer may carry. */
|
|
13
|
+
type Refusal = Pick<DeletePayload, 'failure' | 'error'>;
|
|
14
|
+
/**
|
|
15
|
+
* Word one refused answer.
|
|
16
|
+
*
|
|
17
|
+
* @param t - the page's translate seat.
|
|
18
|
+
* @param payload - the Host answer.
|
|
19
|
+
* @param fallback - the entry to state when the answer carried no reason.
|
|
20
|
+
* @returns the reason to show.
|
|
21
|
+
*/
|
|
22
|
+
export declare function reasonOf(t: Translate, payload: Refusal, fallback: MessageKey): string;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=reason.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reason.d.ts","sourceRoot":"","sources":["../../../src/client/reason.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEzD,sDAAsD;AACtD,KAAK,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,OAAO,CAAC,CAAA;AAEvD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,GAAG,MAAM,CAYrF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The native Session menu's delete row and its confirmation overlay.
|
|
3
|
+
*
|
|
4
|
+
* The row is contributed to `sidebar.workspaces.session.menu.item` by builds
|
|
5
|
+
* that have no `contextMenus` service; the client entry registers a plain-data
|
|
6
|
+
* action instead wherever that service exists, because the shipped Archive row
|
|
7
|
+
* is a footer action and only a footer action can follow it. Menus unmount as
|
|
8
|
+
* soon as they close, so either row only records a request; the frame-wide
|
|
9
|
+
* `shell.overlay` entry owns the dialog's state and the Host call. That split is
|
|
10
|
+
* also what lets the dialog survive the menu's portal disappearing on click.
|
|
11
|
+
*
|
|
12
|
+
* Deletion is permanent, so the confirmation is the only path: it asks before
|
|
13
|
+
* the Host stops running work and removes the artifacts, and disables itself
|
|
14
|
+
* while that happens.
|
|
15
|
+
*/
|
|
16
|
+
import { type ReactElement } from 'react';
|
|
17
|
+
import type { Translate } from './locales.js';
|
|
18
|
+
/**
|
|
19
|
+
* Open the delete confirmation for one Session.
|
|
20
|
+
*
|
|
21
|
+
* @param sessionId - the Session the menu row belongs to.
|
|
22
|
+
*/
|
|
23
|
+
export declare function requestDeleteSession(sessionId: string): void;
|
|
24
|
+
/** Dismiss the confirmation without deleting. */
|
|
25
|
+
export declare function clearDeleteRequest(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Stop drawing the legacy Slot row.
|
|
28
|
+
*
|
|
29
|
+
* The client entry installs that row when `apply` runs before `contextMenus` is
|
|
30
|
+
* mounted; the service then contributes Delete as a footer action so it can
|
|
31
|
+
* follow Archive. This flag keeps the two paths from drawing the row twice.
|
|
32
|
+
*/
|
|
33
|
+
export declare function retireLegacyDeleteRow(): void;
|
|
34
|
+
/** The menu row's owner share and the slot's menu-open hook. */
|
|
35
|
+
interface DeleteMenuItemProps {
|
|
36
|
+
readonly sessionId: string;
|
|
37
|
+
readonly useMenuOpenState: () => readonly [boolean, (open: boolean) => void];
|
|
38
|
+
readonly t: Translate;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The legacy delete row for builds without `contextMenus`, placed after Copy
|
|
42
|
+
* Session ID and separated from the shipped group. Selecting it closes the menu
|
|
43
|
+
* and raises the confirmation overlay.
|
|
44
|
+
*
|
|
45
|
+
* @param props - the row identity, menu hook, and locale seat.
|
|
46
|
+
* @returns the menu row, or null once the menu service owns it.
|
|
47
|
+
*/
|
|
48
|
+
export declare function SessionDeleteMenuItem({ sessionId, useMenuOpenState, t, }: DeleteMenuItemProps): ReactElement | null;
|
|
49
|
+
/** The dialog's injected callback, supplied by the client entry. */
|
|
50
|
+
interface DeleteDialogProps {
|
|
51
|
+
readonly t: Translate;
|
|
52
|
+
/** Called after a successful deletion so the shell can clear its main view. */
|
|
53
|
+
readonly onDeleted?: (sessionId: string) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The frame-wide confirmation entry, drawn with DSH's own `Modal` primitive so
|
|
57
|
+
* its chrome, blurred mask, focus trap, and Escape handling match the rest of
|
|
58
|
+
* the product instead of being re-implemented here.
|
|
59
|
+
*
|
|
60
|
+
* @param props - the locale seat and the post-delete callback.
|
|
61
|
+
* @returns the dialog, or null while no delete is pending.
|
|
62
|
+
*/
|
|
63
|
+
export declare function SessionDeleteDialog({ t, onDeleted }: DeleteDialogProps): ReactElement | null;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=session-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-menu.d.ts","sourceRoot":"","sources":["../../../src/client/session-menu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA6C,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAIpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAyB7C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAG5D;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAKD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,gEAAgE;AAChE,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAAA;IAC5E,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,gBAAgB,EAChB,CAAC,GACF,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAiB3C;AAED,oEAAoE;AACpE,UAAU,iBAAiB;IACzB,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAA;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAmE5F"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Sessions page of the Settings panel: list, search, filter, selection,
|
|
3
|
+
* archive, and deletion.
|
|
4
|
+
*
|
|
5
|
+
* The list itself is not fetched here. DSH already keeps the Host-authoritative
|
|
6
|
+
* Session catalog and Workspace archive set in the two client stores the shell
|
|
7
|
+
* exposes to every slot (`useSessions` / `useWorkspaces`), and every archive is
|
|
8
|
+
* a Workspace-controller call whose reply updates those stores. Reading them
|
|
9
|
+
* directly means this page shares the sidebar's rows and running states instead
|
|
10
|
+
* of maintaining a second, drifting catalog; deletion is the one operation the
|
|
11
|
+
* client face does not expose, so it still crosses this package's own Host
|
|
12
|
+
* route.
|
|
13
|
+
*
|
|
14
|
+
* Search is deliberately title-only: the row's title is the display title the
|
|
15
|
+
* shell computes (durable title, then project directory name, then id), so the
|
|
16
|
+
* text a reader can see in the row is exactly the text the box matches.
|
|
17
|
+
*/
|
|
18
|
+
import { type ReactElement } from 'react';
|
|
19
|
+
import type { ArchiveResult } from './archive.js';
|
|
20
|
+
import { type Translate } from './locales.js';
|
|
21
|
+
/** The selector-hook shape DSH hands every slot component. */
|
|
22
|
+
type SelectorHook = (selector: (state: any) => any) => any;
|
|
23
|
+
/** The section's injected share: the locale seat plus the Host-backed actions. */
|
|
24
|
+
export interface SessionsSectionProps {
|
|
25
|
+
readonly t: Translate;
|
|
26
|
+
readonly useSessions: SelectorHook;
|
|
27
|
+
readonly useWorkspaces: SelectorHook;
|
|
28
|
+
/** Archive or restore one Session through the Workspace controller. */
|
|
29
|
+
readonly setArchived?: (sessionId: string, archived: boolean, stopActivity: boolean) => Promise<ArchiveResult>;
|
|
30
|
+
/** Ask the Session catalog to refresh after a deletion. */
|
|
31
|
+
readonly refresh?: () => void;
|
|
32
|
+
/** Clear the shell's main view when its Session disappeared. */
|
|
33
|
+
readonly onDeleted?: (sessionId: string) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render the Sessions page.
|
|
37
|
+
*
|
|
38
|
+
* @param props - the locale seat, the two catalog hooks, and the injected actions.
|
|
39
|
+
* @returns the management surface and its confirmations.
|
|
40
|
+
*/
|
|
41
|
+
export declare function SessionsSection({ t, useSessions, useWorkspaces, setArchived, refresh, onDeleted, }: SessionsSectionProps): ReactElement;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=settings-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../../src/client/settings-section.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAO/E,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxE,8DAA8D;AAC9D,KAAK,YAAY,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,KAAK,GAAG,CAAA;AAkC1D,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAA;IAClC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAA;IACpC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAC9G,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACjD;AA8LD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,CAAC,EACD,WAAW,EACX,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,GACV,EAAE,oBAAoB,GAAG,YAAY,CA4jBrC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned stylesheet for the plugin's three surfaces.
|
|
3
|
+
*
|
|
4
|
+
* The native Session menu row and both confirmations are drawn by DSH's own
|
|
5
|
+
* primitives, so this sheet only adds the danger tint on the legacy menu row and
|
|
6
|
+
* on the dialogs' confirm action, the inline refusal blocks, and the Settings
|
|
7
|
+
* page's own controls and table. (Where the menu service carries Delete, its
|
|
8
|
+
* `danger` flag supplies the red row instead.) The section follows the shipped
|
|
9
|
+
* sections' heading and row rhythm. Every color is a `--dsw-*` theme token, so
|
|
10
|
+
* every surface follows the active light or dark appearance — including
|
|
11
|
+
* third-party theme presets — instead of forcing a palette of its own.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Insert the stylesheet once for the plugin lifetime.
|
|
15
|
+
*
|
|
16
|
+
* The tag carries the platform's style-ownership record — `data-plugin` with this
|
|
17
|
+
* package's id, which is what every DSH bundle writes on the tags it injects. A
|
|
18
|
+
* tag carrying no attribute is claimed by whichever module materializes next and
|
|
19
|
+
* deleted with it, so naming the owner here keeps the sheet this plugin's own:
|
|
20
|
+
* only a reload of `dsh-cool-session` retires it, and this effect's disposer
|
|
21
|
+
* removes it then anyway.
|
|
22
|
+
*
|
|
23
|
+
* @returns disposer that removes exactly this element.
|
|
24
|
+
*/
|
|
25
|
+
export declare function insertStyles(): () => void;
|
|
26
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/client/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAyGH;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,IAAI,MAAM,IAAI,CASzC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On-disk Session deletion, including the subagent Sessions beneath one root.
|
|
3
|
+
*
|
|
4
|
+
* DSH exposes no deletion command of its own, so this Host module treats the
|
|
5
|
+
* Session artifact as the unit of removal. It first stops whatever the Session
|
|
6
|
+
* still runs, retires the live Session entry, and only then removes the
|
|
7
|
+
* header-verified directory. Paths never come from the request: every directory
|
|
8
|
+
* is derived from the persistence backend's own `locate()` answer and checked
|
|
9
|
+
* to be exactly one Session directory below the configured root.
|
|
10
|
+
*
|
|
11
|
+
* The operation is intentionally fail-closed. A descendant scan that cannot be
|
|
12
|
+
* completed, a directory that leaves the root, a symlink, an artifact whose
|
|
13
|
+
* header names another Session, or a Session that cannot be retired all abort
|
|
14
|
+
* the delete before the first `rm`. A failure after some descendants were
|
|
15
|
+
* already removed is reported as `delete-partial`, with the remaining ids.
|
|
16
|
+
*/
|
|
17
|
+
import type { DeletePayload } from '../shared/contract.js';
|
|
18
|
+
/**
|
|
19
|
+
* Delete one Session and every subagent Session beneath it.
|
|
20
|
+
*
|
|
21
|
+
* @param ctx - the Host plugin context.
|
|
22
|
+
* @param sessionId - the root Session to delete.
|
|
23
|
+
* @returns the deletion summary, or one coded refusal.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deleteSession(ctx: any, sessionId: string): Promise<DeletePayload>;
|
|
26
|
+
//# sourceMappingURL=deletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deletion.d.ts","sourceRoot":"","sources":["../../../src/host/deletion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAwB,MAAM,uBAAuB,CAAA;AA4ahF;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAsGvF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host entry for dsh-cool-session.
|
|
3
|
+
*
|
|
4
|
+
* The browser half owns the native Session-menu row and its confirmation; this
|
|
5
|
+
* half owns the one destructive artifact operation behind that confirmation.
|
|
6
|
+
* Every question the page asks crosses a same-origin HTTP route served by the
|
|
7
|
+
* `webServer` carrier, because an out-of-tree bundle cannot generate a
|
|
8
|
+
* `ctx.remote` namespace and its Client half never sees the Host Cordis context.
|
|
9
|
+
*
|
|
10
|
+
* The Session and Agent capabilities are read per request rather than declared
|
|
11
|
+
* as hard dependencies: a composition without them still loads the plugin and
|
|
12
|
+
* answers one clear refusal instead of failing the menu row.
|
|
13
|
+
*/
|
|
14
|
+
export declare const name = "dsh-cool-session";
|
|
15
|
+
/** The web carrier is a hard dependency: without it there is no route to serve. */
|
|
16
|
+
export declare const inject: string[];
|
|
17
|
+
/** The route table, exported so a probe or test can address the route by name. */
|
|
18
|
+
export { ROUTES } from './routes.js';
|
|
19
|
+
export declare function apply(ctx: any): void;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,eAAO,MAAM,IAAI,qBAAqB,CAAA;AAEtC,mFAAmF;AACnF,eAAO,MAAM,MAAM,UAAgB,CAAA;AAEnC,kFAAkF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAIpC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one Host answer refuses, in the two forms the payloads carry.
|
|
3
|
+
*
|
|
4
|
+
* A refusal this plugin can name travels as a code, because the page is what
|
|
5
|
+
* knows the language to word it in: `shared/contract.ts` defines the code and
|
|
6
|
+
* its params, and `client/locales.ts` owns the sentences. Anything else is text
|
|
7
|
+
* another program wrote — a DSH service message above all — which no dictionary
|
|
8
|
+
* can own, so it travels verbatim.
|
|
9
|
+
*/
|
|
10
|
+
import type { Failure, FailureCode } from '../shared/contract.js';
|
|
11
|
+
/** One refusal, as an `ok: false` payload carries it. */
|
|
12
|
+
export type Refusal = {
|
|
13
|
+
readonly failure: Failure;
|
|
14
|
+
} | {
|
|
15
|
+
readonly error: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One coded refusal, shaped as a payload carries it.
|
|
19
|
+
*
|
|
20
|
+
* @param code - the refusal, whose sentence the page owns.
|
|
21
|
+
* @param params - the values that sentence interpolates, when it has any.
|
|
22
|
+
* @returns the payload fragment to spread into an `ok: false` answer.
|
|
23
|
+
*/
|
|
24
|
+
export declare function coded(code: FailureCode, params?: Readonly<Record<string, string | number>>): Refusal;
|
|
25
|
+
//# sourceMappingURL=refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../../src/host/refusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjE,yDAAyD;AACzD,MAAM,MAAM,OAAO,GACf;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9B;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,OAAO,CAEpG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Host half's HTTP surface.
|
|
3
|
+
*
|
|
4
|
+
* The browser half has no Cordis context and no remote namespace of its own, so
|
|
5
|
+
* the destructive command crosses same-origin routes registered on the
|
|
6
|
+
* `webServer` carrier: one Session per request from the native menu, and one
|
|
7
|
+
* selection per request from the management panel. The routes answer JSON and
|
|
8
|
+
* never reject: a transport, service, or filesystem failure becomes an
|
|
9
|
+
* `{ ok: false }` result the page reports in place.
|
|
10
|
+
*
|
|
11
|
+
* The Host stays authoritative about *what* is deleted. A request names a
|
|
12
|
+
* Session id but never a directory or an Agent: the artifact path is derived and
|
|
13
|
+
* verified by `deletion.ts`, never by the caller. That keeps the page a
|
|
14
|
+
* management surface over DSH's own state rather than a second source of truth.
|
|
15
|
+
*/
|
|
16
|
+
/** Route table, kept in one place so the two halves cannot drift. */
|
|
17
|
+
export declare const ROUTES: {
|
|
18
|
+
readonly delete: "/dsh-cool-session/api/delete";
|
|
19
|
+
readonly deleteMany: "/dsh-cool-session/api/delete-many";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Serve the deletion routes for one plugin instance.
|
|
23
|
+
*
|
|
24
|
+
* @param ctx - the Host plugin context.
|
|
25
|
+
* @returns a disposer that unregisters exactly this route.
|
|
26
|
+
*/
|
|
27
|
+
export declare function registerRoutes(ctx: any): () => void;
|
|
28
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/host/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,qEAAqE;AACrE,eAAO,MAAM,MAAM;;;CAGT,CAAA;AAqIV;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,IAAI,CAwCnD"}
|