@askdkc/dsh-cli 0.12.2 → 0.13.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/README.md +6 -1
- package/cordis.patch.yml +12 -131
- package/lib/types/adapter/channel/session-projection.d.ts.map +1 -1
- package/lib/types/adapter/channel/session-projection.js +0 -7
- package/lib/types/adapter/ports/channel-view.d.ts +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/dsh-adapter/bundled-presets.d.ts +3 -8
- package/lib/types/dsh-adapter/bundled-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/bundled-presets.js +5 -20
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +2 -9
- package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/external-commands.js +9 -33
- package/lib/types/dsh-adapter/channel/local-actions.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +6 -2
- package/lib/types/dsh-adapter/channel/model-actions.js +3 -3
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +0 -1
- package/lib/types/dsh-adapter/channel/permissions.d.ts +1 -6
- package/lib/types/dsh-adapter/channel/permissions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/permissions.js +2 -54
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +15 -70
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +0 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +1 -4
- package/lib/types/dsh-adapter/channel/session-resume.js +2 -2
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +0 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +1 -2
- package/lib/types/dsh-adapter/channel/session-tree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree.js +9 -62
- package/lib/types/dsh-adapter/channel/skill-catalog.js +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +2 -8
- package/lib/types/dsh-adapter/channel/transcript.d.ts +0 -16
- package/lib/types/dsh-adapter/channel/transcript.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/transcript.js +0 -43
- package/lib/types/dsh-adapter/channel.js +2 -2
- package/lib/types/dsh-adapter/compat/index.d.ts +5 -25
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +5 -25
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +12 -23
- package/lib/types/dsh-adapter/compat/liveSession.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.js +15 -68
- package/lib/types/dsh-adapter/compat/messages.d.ts +1 -3
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +2 -10
- package/lib/types/dsh-adapter/compat/persistence.d.ts +2 -3
- package/lib/types/dsh-adapter/compat/persistence.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/persistence.js +9 -14
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +10 -144
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +45 -275
- package/lib/types/dsh-adapter/compat/settings.d.ts +4 -10
- package/lib/types/dsh-adapter/compat/settings.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/settings.js +6 -23
- package/lib/types/dsh-adapter/compat/shell.d.ts +2 -3
- package/lib/types/dsh-adapter/compat/shell.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/shell.js +2 -7
- package/lib/types/dsh-adapter/contract.d.ts +4 -34
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +8 -83
- package/lib/types/dsh-adapter/packaged-presets.d.ts +0 -19
- package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/packaged-presets.js +1 -83
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +25 -168
- package/lib/types/dsh-adapter/preset-resolution.d.ts +1 -22
- package/lib/types/dsh-adapter/preset-resolution.d.ts.map +1 -1
- package/lib/types/dsh-adapter/preset-resolution.js +0 -34
- package/lib/types/dsh-adapter/presets.d.ts +1 -4
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +3 -6
- package/lib/types/dsh-adapter/questions-answerer.d.ts +5 -43
- package/lib/types/dsh-adapter/questions-answerer.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions-answerer.js +7 -63
- package/lib/types/dsh-adapter/sessionTree.d.ts +0 -19
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessionTree.js +2 -112
- package/lib/types/dsh-adapter/sessions/header.d.ts +2 -2
- package/lib/types/dsh-adapter/sessions/header.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/header.js +2 -8
- package/lib/types/dsh-adapter/sessions/list.d.ts +7 -28
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +48 -103
- package/lib/types/dsh-adapter/sessions/store.d.ts +1 -2
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +7 -10
- package/lib/types/dsh-adapter/sharp.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sharp.js +0 -1
- package/lib/types/dsh-adapter/subagents.d.ts +1 -2
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +1 -12
- package/lib/types/dsh-adapter/trajectory/aggregate.d.ts +1 -1
- package/lib/types/dsh-adapter/trajectory/aggregate.js +1 -1
- package/lib/types/dsh-adapter/trajectory/guards.d.ts +5 -22
- package/lib/types/dsh-adapter/trajectory/guards.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/guards.js +5 -23
- package/lib/types/dsh-adapter/trajectory/projection.d.ts +5 -21
- package/lib/types/dsh-adapter/trajectory/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/trajectory/projection.js +4 -38
- package/lib/types/dsh-adapter/trajectory/types.d.ts +1 -1
- package/lib/types/dsh-adapter/trajectory/types.d.ts.map +1 -1
- package/lib/types/i18n.d.ts +2 -22
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +2 -10
- package/lib/types/presetPrefs.d.ts +1 -3
- package/lib/types/presetPrefs.d.ts.map +1 -1
- package/lib/types/presetPrefs.js +2 -4
- package/node_modules/@askdkc/dsh-auth/README.ja.md +28 -3
- package/node_modules/@askdkc/dsh-auth/README.md +19 -3
- package/node_modules/@askdkc/dsh-auth/dsh-plugin.json +3 -3
- package/node_modules/@askdkc/dsh-auth/lib/THIRD_PARTY_NOTICES.txt +168 -0
- package/node_modules/@askdkc/dsh-auth/lib/abortable.d.ts +2 -0
- package/node_modules/@askdkc/dsh-auth/lib/abortable.js +9 -0
- package/node_modules/@askdkc/dsh-auth/lib/auth-contract.d.ts +66 -0
- package/node_modules/@askdkc/dsh-auth/lib/auth-contract.js +1 -0
- package/node_modules/@askdkc/dsh-auth/lib/command.js +15 -1
- package/node_modules/@askdkc/dsh-auth/lib/credentials.d.ts +8 -14
- package/node_modules/@askdkc/dsh-auth/lib/credentials.js +1 -1
- package/node_modules/@askdkc/dsh-auth/lib/index.d.ts +8 -27
- package/node_modules/@askdkc/dsh-auth/lib/index.js +67 -64
- package/node_modules/@askdkc/dsh-auth/lib/interaction.d.ts +5 -5
- package/node_modules/@askdkc/dsh-auth/lib/opencode-adapter.d.ts +37 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-adapter.js +197 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-catalog.d.ts +72 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-catalog.js +252 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-codec.d.ts +6 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-codec.js +93 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-owned.generated.d.ts +113 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-owned.generated.js +2866 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-replay.d.ts +15 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-replay.js +141 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-sdk.d.ts +5 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-sdk.js +43465 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-sdk.js.map +7 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-transport.d.ts +5 -0
- package/node_modules/@askdkc/dsh-auth/lib/opencode-transport.js +69 -0
- package/node_modules/@askdkc/dsh-auth/lib/pi-ai.d.ts +2 -1
- package/node_modules/@askdkc/dsh-auth/lib/pi-ai.js +2 -1
- package/node_modules/@askdkc/dsh-auth/lib/pi-routes.d.ts +32 -0
- package/node_modules/@askdkc/dsh-auth/lib/pi-routes.js +45 -0
- package/node_modules/@askdkc/dsh-auth/lib/profiles.d.ts +2 -20
- package/node_modules/@askdkc/dsh-auth/lib/profiles.js +6 -35
- package/node_modules/@askdkc/dsh-auth/lib/routes.d.ts +20 -0
- package/node_modules/@askdkc/dsh-auth/lib/routes.js +13 -0
- package/node_modules/@askdkc/dsh-auth/lib/service.d.ts +11 -2
- package/node_modules/@askdkc/dsh-auth/lib/service.js +26 -16
- package/node_modules/@askdkc/dsh-auth/package.json +26 -14
- package/package.json +100 -96
- package/lib/types/dsh-adapter/providerGuard.d.ts +0 -75
- package/lib/types/dsh-adapter/providerGuard.d.ts.map +0 -1
- package/lib/types/dsh-adapter/providerGuard.js +0 -104
- package/lib/types/migrationPrefs.d.ts +0 -60
- package/lib/types/migrationPrefs.d.ts.map +0 -1
- package/lib/types/migrationPrefs.js +0 -97
- package/presets/liangshen/.dsh-tui-managed.json +0 -5
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One-time local migrations (`~/.dsh-tui/migrations.json`), keyed by stable
|
|
3
|
-
* migration id → ISO timestamp. Named keys (not a bare flag) so later
|
|
4
|
-
* migrations can append entries without a format change. Best-effort like
|
|
5
|
-
* every prefs file: a missing/corrupt file reads as "nothing applied yet",
|
|
6
|
-
* and a failed write simply leaves the migration to retry on a later boot.
|
|
7
|
-
*/
|
|
8
|
-
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
import { DATA_DIR } from './utils/paths.js';
|
|
11
|
-
const PREFS_DIR = DATA_DIR;
|
|
12
|
-
const MIGRATIONS_FILE = 'migrations.json';
|
|
13
|
-
/**
|
|
14
|
-
* The fullscreen factory-default flip (schema + `cordis.patch.yml`, 0.9.x):
|
|
15
|
-
* a `fullscreen: false` pinned in the settings user layer BEFORE the flip
|
|
16
|
-
* keeps overriding the new default on every boot. The first boot past this
|
|
17
|
-
* migration clears that stale explicit choice once — see
|
|
18
|
-
* {@link planFullscreenFactoryMigration} for the decision table.
|
|
19
|
-
*/
|
|
20
|
-
export const FULLSCREEN_FACTORY_MIGRATION = 'fullscreen-factory-default';
|
|
21
|
-
/**
|
|
22
|
-
* Read the applied-migration map.
|
|
23
|
-
* @param dir - Prefs directory (injectable for tests).
|
|
24
|
-
* @returns Parsed migration map; empty on any read/parse failure.
|
|
25
|
-
*/
|
|
26
|
-
export function readAppliedMigrations(dir = PREFS_DIR) {
|
|
27
|
-
try {
|
|
28
|
-
const parsed = JSON.parse(readFileSync(join(dir, MIGRATIONS_FILE), 'utf8'));
|
|
29
|
-
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
30
|
-
return {};
|
|
31
|
-
return parsed;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return {};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Record a migration as applied (merge write — other keys are never dropped).
|
|
39
|
-
* @param id - Migration id.
|
|
40
|
-
* @param dir - Prefs directory (injectable for tests).
|
|
41
|
-
* @returns True when the file was written, false on failure.
|
|
42
|
-
*/
|
|
43
|
-
export function markMigrationApplied(id, dir = PREFS_DIR) {
|
|
44
|
-
try {
|
|
45
|
-
const current = readAppliedMigrations(dir);
|
|
46
|
-
mkdirSync(dir, { recursive: true });
|
|
47
|
-
writeFileSync(join(dir, MIGRATIONS_FILE), JSON.stringify({ ...current, [id]: new Date().toISOString() }, null, 2));
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Decide the migration step from the settings scope's RESOLVED fullscreen
|
|
56
|
-
* value. The dsh-tui namespace declares no schema default and no `base`
|
|
57
|
-
* layer for `fullscreen`, so a resolved `false` can only come from the user
|
|
58
|
-
* layer — the pre-flip explicit choice this migration exists to clear:
|
|
59
|
-
* - `done` — marker present: never touch the user layer again, so a
|
|
60
|
-
* `false` written AFTER the migration (a deliberate /settings choice)
|
|
61
|
-
* always stands;
|
|
62
|
-
* - `unset` — stale pre-flip explicit `false`: the caller clears it via a
|
|
63
|
-
* settings `unset` op and boots fullscreen regardless — the doc write
|
|
64
|
-
* is async and must not race the synchronous boot decision, so the
|
|
65
|
-
* caller shadows the stale value out of its first settings apply;
|
|
66
|
-
* - `mark` — nothing to clear (unset or already `true`): record the
|
|
67
|
-
* marker now so a `false` set later is never mistaken for a stale one.
|
|
68
|
-
*/
|
|
69
|
-
export function planFullscreenFactoryMigration(resolvedFullscreen, migrations) {
|
|
70
|
-
if (migrations[FULLSCREEN_FACTORY_MIGRATION] !== undefined)
|
|
71
|
-
return 'done';
|
|
72
|
-
return resolvedFullscreen === false ? 'unset' : 'mark';
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Persist the plan's side effects. For `unset` the marker lands only after
|
|
76
|
-
* the doc write succeeds — a failed write stays unmarked and the next boot
|
|
77
|
-
* retries (that boot already ran fullscreen off the shadowed value).
|
|
78
|
-
* Never rejects.
|
|
79
|
-
* @param plan - Decision from {@link planFullscreenFactoryMigration}.
|
|
80
|
-
* @param options - `unset` thunk issuing the settings write; `dir` injects
|
|
81
|
-
* the prefs directory for tests.
|
|
82
|
-
*/
|
|
83
|
-
export async function commitFullscreenFactoryMigration(plan, options) {
|
|
84
|
-
if (plan === 'done')
|
|
85
|
-
return;
|
|
86
|
-
if (plan === 'mark') {
|
|
87
|
-
markMigrationApplied(FULLSCREEN_FACTORY_MIGRATION, options.dir);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
await options.unset();
|
|
92
|
-
markMigrationApplied(FULLSCREEN_FACTORY_MIGRATION, options.dir);
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
// Unmarked on purpose: retried next boot.
|
|
96
|
-
}
|
|
97
|
-
}
|