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.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +24 -2
  3. package/README.zh.md +25 -0
  4. package/cordis.patch.yml +7 -0
  5. package/lib/client.js +1602 -0
  6. package/lib/index.js +690 -0
  7. package/lib/types/client/api.d.ts +30 -0
  8. package/lib/types/client/api.d.ts.map +1 -0
  9. package/lib/types/client/archive.d.ts +43 -0
  10. package/lib/types/client/archive.d.ts.map +1 -0
  11. package/lib/types/client/icons.d.ts +32 -0
  12. package/lib/types/client/icons.d.ts.map +1 -0
  13. package/lib/types/client/index.d.ts +28 -0
  14. package/lib/types/client/index.d.ts.map +1 -0
  15. package/lib/types/client/locales.d.ts +143 -0
  16. package/lib/types/client/locales.d.ts.map +1 -0
  17. package/lib/types/client/nav-icon.d.ts +30 -0
  18. package/lib/types/client/nav-icon.d.ts.map +1 -0
  19. package/lib/types/client/reason.d.ts +24 -0
  20. package/lib/types/client/reason.d.ts.map +1 -0
  21. package/lib/types/client/session-menu.d.ts +65 -0
  22. package/lib/types/client/session-menu.d.ts.map +1 -0
  23. package/lib/types/client/settings-section.d.ts +43 -0
  24. package/lib/types/client/settings-section.d.ts.map +1 -0
  25. package/lib/types/client/styles.d.ts +26 -0
  26. package/lib/types/client/styles.d.ts.map +1 -0
  27. package/lib/types/host/deletion.d.ts +26 -0
  28. package/lib/types/host/deletion.d.ts.map +1 -0
  29. package/lib/types/host/index.d.ts +20 -0
  30. package/lib/types/host/index.d.ts.map +1 -0
  31. package/lib/types/host/refusal.d.ts +25 -0
  32. package/lib/types/host/refusal.d.ts.map +1 -0
  33. package/lib/types/host/routes.d.ts +28 -0
  34. package/lib/types/host/routes.d.ts.map +1 -0
  35. package/lib/types/shared/contract.d.ts +61 -0
  36. package/lib/types/shared/contract.d.ts.map +1 -0
  37. package/package.json +69 -3
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The wire contract both halves of dsh-cool-session agree on.
3
+ *
4
+ * The browser half never sees the Host Cordis context, so the one destructive
5
+ * command crosses a same-origin HTTP route as JSON shaped by the types below.
6
+ * Nothing here touches Node or the DOM, so the module is bundled into both
7
+ * halves unchanged.
8
+ *
9
+ * Every answer carries `ok`: an `ok: false` result is a normal answer the dialog
10
+ * reports in place, never a rejected promise. The one exception is a transport
11
+ * failure, which the fetch wrapper turns into the same shape.
12
+ *
13
+ * An `ok: false` answer says why in one of two ways. `failure` is a code plus the
14
+ * values its sentence interpolates: only the browser knows the language to name
15
+ * it in, so the page words it from its own dictionaries. `error` is raw diagnostic
16
+ * text from another program, which no dictionary can own.
17
+ */
18
+ /**
19
+ * Every refusal this plugin can name, as a code rather than a sentence.
20
+ *
21
+ * The page renders each one from its own dictionary, so the same refusal reads
22
+ * in whatever language the browser is set to. The sentences live in
23
+ * `client/locales.ts` keyed `error.<code>`.
24
+ */
25
+ export type FailureCode = 'missing-session' | 'unknown-session' | 'subagent-delete' | 'delete-failed' | 'delete-unsupported' | 'delete-active' | 'session-live' | 'delete-partial';
26
+ /** One coded refusal, with the values its sentence interpolates. */
27
+ export interface Failure {
28
+ /** The refusal, whose sentence is the page's `error.<code>` entry. */
29
+ readonly code: FailureCode;
30
+ /** Values for the sentence's `{name}` placeholders. */
31
+ readonly params?: Readonly<Record<string, string | number>>;
32
+ }
33
+ /** `POST /delete-many`: remove several Sessions in one request, in order. */
34
+ export interface DeleteManyPayload {
35
+ readonly ok: boolean;
36
+ /**
37
+ * Raw refusal when a batch request could not be carried out. Results from
38
+ * batches that finished before it are still present.
39
+ */
40
+ readonly error?: string;
41
+ /** One answer per attempted Session, in request order. */
42
+ readonly results?: readonly DeletePayload[];
43
+ }
44
+ /** `POST /delete`: remove one Session and every subagent Session beneath it. */
45
+ export interface DeletePayload {
46
+ readonly ok: boolean;
47
+ readonly error?: string;
48
+ readonly failure?: Failure;
49
+ readonly sessionId?: string;
50
+ /** Every Session whose artifact was removed, descendants first. */
51
+ readonly deletedSessions?: readonly string[];
52
+ /** The subagent Sessions included in {@link deletedSessions}. */
53
+ readonly deletedSubagents?: readonly string[];
54
+ /** Sessions still present after a partial deletion. */
55
+ readonly remainingSessions?: readonly string[];
56
+ /** Whether at least one on-disk Session directory was removed. */
57
+ readonly filesRemoved?: boolean;
58
+ /** Cleanup that failed after the artifacts were already removed. */
59
+ readonly warnings?: readonly string[];
60
+ }
61
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../src/shared/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAEnB,iBAAiB,GAEjB,iBAAiB,GACjB,iBAAiB,GAEjB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,cAAc,GACd,gBAAgB,CAAA;AAEpB,oEAAoE;AACpE,MAAM,WAAW,OAAO;IACtB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CAAA;CAC5D;AAED,6EAA6E;AAC7E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;CAC5C;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5C,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7C,uDAAuD;IACvD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9C,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC"}
package/package.json CHANGED
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "name": "dsh-cool-session",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "DeepSeek Harness session management plugin — a Sessions page in Settings for search, filters, archive, and batch delete, plus a delete row in the session menu.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "CoolTea",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/CoolTea001/dsh-cool-plugins.git",
11
+ "directory": "plugins/dsh-cool-session"
12
+ },
13
+ "homepage": "https://github.com/CoolTea001/dsh-cool-plugins/tree/master/plugins/dsh-cool-session#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/CoolTea001/dsh-cool-plugins/issues"
16
+ },
17
+ "keywords": [
18
+ "dsh",
19
+ "cordis",
20
+ "plugin",
21
+ "session",
22
+ "deepseek-harness"
23
+ ],
24
+ "main": "lib/index.js",
25
+ "types": "lib/types/host/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./lib/types/host/index.d.ts",
29
+ "default": "./lib/index.js"
30
+ },
31
+ "./client": {
32
+ "types": "./lib/types/client/index.d.ts",
33
+ "default": "./lib/client.js"
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "files": [
38
+ "lib",
39
+ "cordis.patch.yml",
40
+ "README.md",
41
+ "README.zh.md"
42
+ ],
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
+ },
47
+ "dsh": {
48
+ "bundle": {
49
+ "patch": "./cordis.patch.yml"
50
+ },
51
+ "client": {
52
+ "inject": [],
53
+ "platform": "web"
54
+ }
55
+ },
56
+ "engines": {
57
+ "node": "^22.19.0 || >=24.0.0"
58
+ },
59
+ "devDependencies": {
60
+ "@dsh-cool/tsdown-config": "0.0.0"
61
+ },
62
+ "peerDependencies": {
63
+ "react": "^18.2.0"
64
+ },
65
+ "scripts": {
66
+ "build": "tsdown && tsc -p tsconfig.json --emitDeclarationOnly",
67
+ "typecheck": "tsc -p tsconfig.json --noEmit",
68
+ "check": "pnpm typecheck && pnpm build",
69
+ "dev": "tsdown --watch",
70
+ "dev:types": "tsc -p tsconfig.json --watch --emitDeclarationOnly"
71
+ }
6
72
  }