@fbincon/claude-code-statusline 3.3.0 → 3.4.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 +73 -70
- package/candidate.json +190 -139
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profile-command.d.ts +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profile-command.js +101 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profile-command.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.d.ts +54 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js +199 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +5 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +4 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/command.js +9 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/command.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.d.ts +8 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js +6 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +2 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +3 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +4 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +30 -8
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/configuration.d.ts +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/configuration.js +59 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/configuration.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +15 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/command.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/command.js +25 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/service.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/service.js +93 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/tasks/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +5 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +33 -8
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +89 -3
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +54 -4
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +8 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/profile-manager.ts +239 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/task-detail.ts +27 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +53 -3
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +768 -6
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +2 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +16 -14
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +6 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +3 -3
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js +69 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +82 -3
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +71 -4
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.d.ts +60 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js +330 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/task-detail.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/task-detail.js +25 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/task-detail.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +762 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +768 -6
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/details.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/details.js +153 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/details.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +128 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +128 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +128 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +128 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +128 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +128 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/project-paths.d.ts +8 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/project-paths.js +41 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/project-paths.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +5 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +2 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +2 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +3 -2
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +7 -3
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +18 -2
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ArgumentError } from '../config/arguments.js';
|
|
2
|
+
import { taskDetailLines } from '@fbincon/statusline-core/editor/task-detail';
|
|
3
|
+
import { pythonJson } from '@fbincon/statusline-core/json-text';
|
|
4
|
+
import { detailService } from './service.js';
|
|
5
|
+
export function taskCommand(args, context, language) {
|
|
6
|
+
if (args[0] !== 'show')
|
|
7
|
+
throw new ArgumentError('task requires show');
|
|
8
|
+
const values = {};
|
|
9
|
+
for (let i = 1; i < args.length; i++) {
|
|
10
|
+
const key = args[i];
|
|
11
|
+
if (!['--session-id', '--prompt-id', '--json', '--config-dir'].includes(key) || values[key] !== undefined)
|
|
12
|
+
throw new ArgumentError('Unknown or repeated task option: ' + key);
|
|
13
|
+
if (key === '--json')
|
|
14
|
+
values[key] = true;
|
|
15
|
+
else {
|
|
16
|
+
const value = args[++i];
|
|
17
|
+
if (!value || value.startsWith('--'))
|
|
18
|
+
throw new ArgumentError(key + ' requires a value');
|
|
19
|
+
values[key] = value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const result = detailService({ session_id: values['--session-id'], prompt_id: values['--prompt-id'] ?? null }, context);
|
|
23
|
+
return values['--json'] ? pythonJson(result, { ensureAscii: false, indent: 2 }) : taskDetailLines(result, language).join('\n');
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=command.js.map
|
|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MAAM,GAAC,aAAa,CAAC,EAAC,UAAU,EAAC,MAAM,CAAC,cAAc,CAAC,EAAC,SAAS,EAAC,MAAM,CAAC,aAAa,CAAC,IAAI,IAAI,EAAC,EAAC,OAAO,CAAC,CAAC;IAChH,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAC,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,EAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5H,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DiagnosticFiles } from '@fbincon/statusline-platform/diagnostic-files';
|
|
2
|
+
import { type RuntimeContext } from '../runtime/context.js';
|
|
3
|
+
export declare function detailService(payload: unknown, context: RuntimeContext, files?: DiagnosticFiles): import("@fbincon/statusline-core/contracts/ui").TaskDetails;
|
|
4
|
+
export declare const taskAdapter: (directory: string) => (payload: unknown) => import("@fbincon/statusline-core/contracts/ui").TaskDetails;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { taskDetails } from '@fbincon/statusline-core/runtime/tasks/details';
|
|
3
|
+
import { storeFromState } from '@fbincon/statusline-core/runtime/tasks/model';
|
|
4
|
+
import { validateState, fresh } from '@fbincon/statusline-core/runtime/live/state';
|
|
5
|
+
import { object, int, numeric } from '@fbincon/statusline-core/runtime/values';
|
|
6
|
+
import { ConfigError } from '@fbincon/statusline-core/config/validation';
|
|
7
|
+
import { isLosslessNumber } from '@fbincon/statusline-core/json';
|
|
8
|
+
import { sha256 } from '@fbincon/statusline-platform/hash';
|
|
9
|
+
import { diagnosticFiles } from '@fbincon/statusline-platform/diagnostic-files';
|
|
10
|
+
import { decodeUtf8 } from '@fbincon/statusline-platform/utf8';
|
|
11
|
+
import { readDataJson } from '../runtime/json-data.js';
|
|
12
|
+
import { runtimeContext } from '../runtime/context.js';
|
|
13
|
+
import { loadRuntime } from '../config/runtime-preferences.js';
|
|
14
|
+
const identity = (value) => typeof value === 'string' && !!value && [...value].length <= 1024 && !/[\p{Cc}\p{Cs}]/u.test(value);
|
|
15
|
+
export function detailService(payload, context, files = diagnosticFiles) {
|
|
16
|
+
if (!object(payload) || !identity(payload.session_id) ||
|
|
17
|
+
payload.prompt_id !== undefined && payload.prompt_id !== null && !identity(payload.prompt_id) ||
|
|
18
|
+
!Object.keys(payload).every(k => ['session_id', 'prompt_id', 'host_agents'].includes(k)))
|
|
19
|
+
throw new ConfigError('task.error.input', {}, 'invalid_request');
|
|
20
|
+
const session = payload.session_id, now = context.nowMs(), sample = context.sample(), evidence = (source) => ({ source, scope: 'task', status: 'not_observed', observed_at: null, freshness: 'unknown' });
|
|
21
|
+
const taskEvidence = evidence('task_store'), liveEvidence = { ...evidence('live_store'), scope: 'session' };
|
|
22
|
+
const read = (folder, result) => {
|
|
23
|
+
try {
|
|
24
|
+
const raw = files.read(join(context.runtimeRoot, folder, sha256(session) + '.json'));
|
|
25
|
+
if (raw === null)
|
|
26
|
+
return null;
|
|
27
|
+
const data = readDataJson(decodeUtf8(raw));
|
|
28
|
+
if (!object(data) || data.session_id !== session) {
|
|
29
|
+
result.status = 'session_mismatch';
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
result.status = 'observed';
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
result.status = 'source_unavailable';
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
let history = null, live = null;
|
|
41
|
+
const state = read('turns', taskEvidence);
|
|
42
|
+
if (state) {
|
|
43
|
+
if (int(state.schema) !== 1n)
|
|
44
|
+
taskEvidence.status = 'invalid_field';
|
|
45
|
+
else
|
|
46
|
+
history = storeFromState(state, session);
|
|
47
|
+
}
|
|
48
|
+
const liveRaw = read('live', liveEvidence);
|
|
49
|
+
if (liveRaw) {
|
|
50
|
+
live = validateState(liveRaw, session);
|
|
51
|
+
if (!live)
|
|
52
|
+
liveEvidence.status = 'invalid_field';
|
|
53
|
+
else {
|
|
54
|
+
const stamp = numeric(live.heartbeat_at_ms);
|
|
55
|
+
if (stamp !== null && stamp >= 0 && stamp <= 8640000000000000)
|
|
56
|
+
liveEvidence.observed_at = new Date(stamp).toISOString();
|
|
57
|
+
liveEvidence.freshness = stamp === null ? 'unknown' : fresh(live, now) ? 'current' : 'stale';
|
|
58
|
+
if (liveEvidence.freshness === 'stale')
|
|
59
|
+
liveEvidence.status = 'stale';
|
|
60
|
+
if (stamp !== null && stamp > now) {
|
|
61
|
+
liveEvidence.status = 'newer_than_input';
|
|
62
|
+
liveEvidence.freshness = 'newer_than_input';
|
|
63
|
+
live = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
let nativeTiming = false, liveMetrics = false;
|
|
68
|
+
try {
|
|
69
|
+
const preferences = loadRuntime(context.configDir, files);
|
|
70
|
+
nativeTiming = preferences.native_timing;
|
|
71
|
+
liveMetrics = preferences.live_metrics;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
liveEvidence.status = 'preferences_unavailable';
|
|
75
|
+
live = null;
|
|
76
|
+
}
|
|
77
|
+
let hostAgents;
|
|
78
|
+
if (payload.host_agents !== undefined) {
|
|
79
|
+
const supplied = payload.host_agents;
|
|
80
|
+
if (!object(supplied) || Object.keys(supplied).sort().join(',') !== 'agents,observed_at' ||
|
|
81
|
+
!(typeof supplied.observed_at === 'number' || isLosslessNumber(supplied.observed_at)) || numeric(supplied.observed_at) === null ||
|
|
82
|
+
numeric(supplied.observed_at) < 0 || numeric(supplied.observed_at) > 8640000000000000 ||
|
|
83
|
+
!Array.isArray(supplied.agents) || supplied.agents.length > 256 ||
|
|
84
|
+
!supplied.agents.every(a => object(a) && Object.keys(a).sort().join(',') === 'id,name' && identity(a.id) && (a.name === null || identity(a.name))) ||
|
|
85
|
+
new Set(supplied.agents.map(a => a.id)).size !== supplied.agents.length)
|
|
86
|
+
throw new ConfigError('task.error.input', {}, 'invalid_request');
|
|
87
|
+
hostAgents = { observed_at: numeric(supplied.observed_at), agents: supplied.agents };
|
|
88
|
+
}
|
|
89
|
+
return taskDetails({ session, prompt: typeof payload.prompt_id === 'string' ? payload.prompt_id : null, history, live, taskEvidence, liveEvidence,
|
|
90
|
+
now, sample, nativeTiming, liveMetrics, hostAgents });
|
|
91
|
+
}
|
|
92
|
+
export const taskAdapter = (directory) => (payload) => detailService(payload, runtimeContext(directory));
|
|
93
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/tasks/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAkB,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,KAAK,EAAkB,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAwB,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAuB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,MAAM,QAAQ,GA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AE,CAAC;IACnI,CAAC;IACD,OAAO,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY;QAC7I,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAC;AAC9D,CAAC;AACD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
|
@@ -3,8 +3,8 @@ import type { Diagnose } from '../diagnostics/service.js';
|
|
|
3
3
|
import * as contracts from '@fbincon/statusline-core/contracts/ui';
|
|
4
4
|
import type { Draft } from '@fbincon/statusline-core/contracts/ui';
|
|
5
5
|
import { ConfigurationService, type EffectiveConfig } from '../config/service.js';
|
|
6
|
-
export declare const BACKEND_VERSION = "3.
|
|
7
|
-
export declare const OPERATIONS: readonly ["describe", "read", "preview", "apply", "import", "export", "preset", "read_ui_preferences", "set_ui_language", "review_import", "explain", "diagnose"];
|
|
6
|
+
export declare const BACKEND_VERSION = "3.4.0";
|
|
7
|
+
export declare const OPERATIONS: readonly ["describe", "read", "preview", "apply", "import", "export", "preset", "read_ui_preferences", "set_ui_language", "review_import", "explain", "diagnose", "profiles_read", "profiles_apply", "profile_import", "profile_export", "task_details"];
|
|
8
8
|
export type Preview = (draft: Draft, width: number, trace?: RenderTrace) => contracts.PreviewResult;
|
|
9
9
|
export declare function capabilities(version: readonly number[] | null): contracts.Capabilities;
|
|
10
10
|
export declare function configurationOptions(): contracts.ConfigurationOptions;
|
|
@@ -14,7 +14,9 @@ export declare class ConfigurationProtocol {
|
|
|
14
14
|
readonly nextId: () => string;
|
|
15
15
|
readonly diagnose?: Diagnose | undefined;
|
|
16
16
|
constructor(service: ConfigurationService, preview?: Preview | undefined, nextId?: () => string, diagnose?: Diagnose | undefined);
|
|
17
|
-
readResult(effective: EffectiveConfig
|
|
17
|
+
readResult(effective: EffectiveConfig & {
|
|
18
|
+
configuration?: contracts.ResolvedConfiguration;
|
|
19
|
+
}): Record<string, unknown>;
|
|
18
20
|
dispatch(request: unknown): unknown;
|
|
19
21
|
handle(raw: string, diagnostics?: (error: unknown) => void): {
|
|
20
22
|
response: unknown;
|
|
@@ -6,7 +6,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
6
6
|
import * as contracts from '@fbincon/statusline-core/contracts/ui';
|
|
7
7
|
import { requestObject, validateDraft } from '@fbincon/statusline-core/config/draft';
|
|
8
8
|
import { isSchema } from '@fbincon/statusline-core/config/display';
|
|
9
|
-
import { ConfigError } from '@fbincon/statusline-core/config/validation';
|
|
9
|
+
import { ConfigError, object } from '@fbincon/statusline-core/config/validation';
|
|
10
10
|
import { ITEMS } from '@fbincon/statusline-core/config/catalog';
|
|
11
11
|
import { applyPreset } from '@fbincon/statusline-core/config/presets';
|
|
12
12
|
import { differences } from '@fbincon/statusline-core/config/import-review';
|
|
@@ -18,8 +18,10 @@ import { readPreferences, setLanguage } from '../config/preferences.js';
|
|
|
18
18
|
import { importFile, exportFile } from '../config/transfer.js';
|
|
19
19
|
import { localizedError } from '../errors.js';
|
|
20
20
|
import { errorDescription } from '@fbincon/statusline-platform/errors';
|
|
21
|
+
import { ProfileService } from '../config/profiles.js';
|
|
22
|
+
import { taskAdapter } from '../tasks/service.js';
|
|
21
23
|
export const BACKEND_VERSION = VERSION;
|
|
22
|
-
export const OPERATIONS = ['describe', 'read', 'preview', 'apply', 'import', 'export', 'preset', 'read_ui_preferences', 'set_ui_language', 'review_import', 'explain', 'diagnose'];
|
|
24
|
+
export const OPERATIONS = ['describe', 'read', 'preview', 'apply', 'import', 'export', 'preset', 'read_ui_preferences', 'set_ui_language', 'review_import', 'explain', 'diagnose', 'profiles_read', 'profiles_apply', 'profile_import', 'profile_export', 'task_details'];
|
|
23
25
|
export function capabilities(version) {
|
|
24
26
|
return {
|
|
25
27
|
host_version: version?.join('.') ?? null,
|
|
@@ -49,7 +51,8 @@ export class ConfigurationProtocol {
|
|
|
49
51
|
this.diagnose = diagnose;
|
|
50
52
|
}
|
|
51
53
|
readResult(effective) {
|
|
52
|
-
return { draft: draft(effective), revision: effective.revision, installed: effective.installed, installation: effective.installation, capabilities: capabilities(this.service.context.hostVersion()), backend_version: BACKEND_VERSION
|
|
54
|
+
return { draft: draft(effective), revision: effective.revision, installed: effective.installed, installation: effective.installation, capabilities: capabilities(this.service.context.hostVersion()), backend_version: BACKEND_VERSION,
|
|
55
|
+
...(effective.configuration ? { configuration: effective.configuration } : {}) };
|
|
53
56
|
}
|
|
54
57
|
dispatch(request) {
|
|
55
58
|
requestObject(request, ['protocol_version', 'operation', 'payload'], 'request');
|
|
@@ -59,6 +62,25 @@ export class ConfigurationProtocol {
|
|
|
59
62
|
if (typeof operation !== 'string' || !OPERATIONS.includes(operation))
|
|
60
63
|
throw new ConfigError('errors.protocol.unsupported_configuration_operation', {}, 'unsupported_operation');
|
|
61
64
|
const payload = request.payload;
|
|
65
|
+
if (operation === 'task_details')
|
|
66
|
+
return taskAdapter(this.service.context.configDir)(payload);
|
|
67
|
+
if (operation === 'profiles_read' || operation === 'profiles_apply' || operation === 'profile_import' || operation === 'profile_export') {
|
|
68
|
+
const profiles = new ProfileService(this.service, this.nextId);
|
|
69
|
+
if (operation === 'profiles_read') {
|
|
70
|
+
requestObject(payload, [], 'payload');
|
|
71
|
+
return profiles.read();
|
|
72
|
+
}
|
|
73
|
+
if (operation === 'profiles_apply')
|
|
74
|
+
return profiles.mutate(payload);
|
|
75
|
+
requestObject(payload, operation === 'profile_import' ? ['path'] : ['path', 'name', 'display', 'overwrite'], 'payload');
|
|
76
|
+
if (typeof payload.path !== 'string' || !payload.path.trim() || payload.path.includes('\0'))
|
|
77
|
+
throw new ConfigError('errors.protocol.path_must_be_nonempty_text_without_nul', {}, 'invalid_request');
|
|
78
|
+
if (operation === 'profile_import')
|
|
79
|
+
return profiles.import(payload.path);
|
|
80
|
+
if (typeof payload.name !== 'string' || typeof payload.overwrite !== 'boolean')
|
|
81
|
+
throw new ConfigError('profiles.error.invalid', { value: '' }, 'invalid_request');
|
|
82
|
+
return profiles.export(payload.path, payload.name, payload.display, payload.overwrite);
|
|
83
|
+
}
|
|
62
84
|
if (operation === 'read_ui_preferences' || operation === 'set_ui_language') {
|
|
63
85
|
requestObject(payload, operation === 'read_ui_preferences' ? [] : ['ui_language'], 'payload');
|
|
64
86
|
return operation === 'read_ui_preferences' ? readPreferences(this.service.context.configDir, this.service.io) : setLanguage(this.service.context.configDir, payload.ui_language, this.service.io);
|
|
@@ -85,17 +107,20 @@ export class ConfigurationProtocol {
|
|
|
85
107
|
return { path: exportFile(path, current, this.service.context.configDir, payload.overwrite) };
|
|
86
108
|
}
|
|
87
109
|
if (operation === 'describe' || operation === 'read')
|
|
88
|
-
requestObject(payload, [], 'payload');
|
|
110
|
+
requestObject(payload, operation === 'read' && object(payload) && Object.hasOwn(payload, 'target') ? ['target'] : [], 'payload');
|
|
89
111
|
if (operation === 'describe')
|
|
90
112
|
return { presets: contracts.PRESETS, editor_fields: contracts.EDITOR_FIELDS, catalog: ITEMS, options: configurationOptions(), capabilities: capabilities(this.service.context.hostVersion()), backend_version: BACKEND_VERSION, operations: [...OPERATIONS], formatting_options: contracts.FORMAT_CHOICES };
|
|
91
|
-
if (operation === 'read')
|
|
92
|
-
|
|
113
|
+
if (operation === 'read') {
|
|
114
|
+
const scoped = object(payload) && Object.hasOwn(payload, 'target');
|
|
115
|
+
return this.readResult(scoped ? new ProfileService(this.service).readTarget(payload.target) : this.service.read());
|
|
116
|
+
}
|
|
93
117
|
if (operation === 'apply') {
|
|
94
|
-
|
|
118
|
+
const scoped = object(payload) && Object.hasOwn(payload, 'target');
|
|
119
|
+
requestObject(payload, ['draft', 'expected_revision', ...(scoped ? ['target'] : [])], 'payload');
|
|
95
120
|
const parsed = validateDraft(payload.draft, true), revision = payload.expected_revision;
|
|
96
121
|
if (typeof revision !== 'string' || !/^[0-9a-f]{64}$/u.test(revision))
|
|
97
122
|
throw new ConfigError('errors.protocol.expected_revision_must_be_the_revision_returned', {}, 'invalid_request');
|
|
98
|
-
const result = this.service.apply(parsed, revision);
|
|
123
|
+
const result = scoped ? new ProfileService(this.service).applyTarget(parsed, revision, payload.target) : this.service.apply(parsed, revision);
|
|
99
124
|
return { ...this.readResult(result.effective), changed: result.changed, backup_dir: result.backup_dir };
|
|
100
125
|
}
|
|
101
126
|
if (operation === 'diagnose') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/ui/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAU,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,e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AAM,EAAE,CAAC,EAAE,CAAC;QAC7H,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { taskDetailLines } from '../lib/editor/task-detail.ts';
|
|
1
2
|
import { receivePreset } from '../lib/editor/quick-setup.ts';
|
|
3
|
+
import { performProfileAction } from '../lib/editor/profile-manager.ts';
|
|
2
4
|
import type {
|
|
3
5
|
Register,
|
|
6
|
+
On,
|
|
4
7
|
EngineInterface,
|
|
5
8
|
PluginOptions,
|
|
6
9
|
Timer,
|
|
@@ -16,6 +19,7 @@ import { createReview } from '../lib/editor/import-review.ts';
|
|
|
16
19
|
import { canEdit, validPreferenceValue, preferences, preferenceChanged } from '../lib/preferences.ts';
|
|
17
20
|
import type {
|
|
18
21
|
Draft,
|
|
22
|
+
TaskDetails,
|
|
19
23
|
Operation,
|
|
20
24
|
ResultFor,
|
|
21
25
|
} from '../lib/generated-contracts.ts';
|
|
@@ -152,7 +156,7 @@ async function load(
|
|
|
152
156
|
$.ui.invalidate('ui.render');
|
|
153
157
|
try {
|
|
154
158
|
const description = await callBackend($, options, 'describe');
|
|
155
|
-
const current = await callBackend($, options, 'read');
|
|
159
|
+
const current = await callBackend($, options, 'read', { target: { kind: 'project', path: await $.session.cwd() } });
|
|
156
160
|
if (state.epoch !== opening) return;
|
|
157
161
|
if (description.backend_version !== current.backend_version) {
|
|
158
162
|
throw new BackendError(
|
|
@@ -217,7 +221,7 @@ async function reconcile(
|
|
|
217
221
|
setMessage(state.view, "busy", localizedText("native.hooks.register.checking_saved_configuration"));
|
|
218
222
|
$.ui.invalidate('ui.render');
|
|
219
223
|
try {
|
|
220
|
-
const current = await callBackend($, options, 'read');
|
|
224
|
+
const current = await callBackend($, options, 'read', editor.baseline.configuration ? { target: editor.baseline.configuration.target } : {});
|
|
221
225
|
if (state.epoch !== saving) return;
|
|
222
226
|
if (
|
|
223
227
|
sameDraft(current.draft, submitted.draft) &&
|
|
@@ -278,6 +282,7 @@ async function save(
|
|
|
278
282
|
const result = await callBackend($, options, 'apply', {
|
|
279
283
|
draft: submitted.draft,
|
|
280
284
|
expected_revision: submitted.revision,
|
|
285
|
+
...(editor.baseline.configuration ? { target: editor.baseline.configuration.target } : {}),
|
|
281
286
|
});
|
|
282
287
|
if (state.epoch !== saving) return;
|
|
283
288
|
editor.committed(result);
|
|
@@ -482,7 +487,82 @@ async function openEditor(
|
|
|
482
487
|
return {};
|
|
483
488
|
}
|
|
484
489
|
|
|
490
|
+
/** Task host calls stay in this statically inspected entry; presentation is shared in core. */
|
|
491
|
+
const TASK_COMMAND = 'statusline-task', TASK_PANE = 'statusline-task-details';
|
|
492
|
+
export interface TaskPaneState {
|
|
493
|
+
owned: boolean; loading: boolean; generation: number; offset: number;
|
|
494
|
+
language: Language; report: TaskDetails | null; error: string;
|
|
495
|
+
}
|
|
496
|
+
export function taskPaneState(): TaskPaneState {
|
|
497
|
+
return { owned:false, loading:false, generation:0, offset:0, language:'en', report:null, error:'' };
|
|
498
|
+
}
|
|
499
|
+
export async function startTaskDetails($: EngineInterface, state: TaskPaneState): Promise<void> {
|
|
500
|
+
state.generation++; state.loading=false; state.report=null; state.error=''; state.offset=0; state.owned=false;
|
|
501
|
+
const commands=await $.command.list();
|
|
502
|
+
if(!commands.some(c=>c.name===TASK_COMMAND && c.plugin!=='statusline-native')) {
|
|
503
|
+
await $.command.register({name:TASK_COMMAND,description:t('task.title',state.language)}); state.owned=true;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
async function refreshTaskDetails($: EngineInterface, options: PluginOptions, state: TaskPaneState): Promise<void> {
|
|
507
|
+
if (state.loading) return;
|
|
508
|
+
state.loading=true; state.error=''; const epoch=state.generation;
|
|
509
|
+
$.ui.invalidate('ui.render');
|
|
510
|
+
try {
|
|
511
|
+
const launch=binding(options,await $.env.get('CLAUDE_STATUSLINE_NATIVE_EXECUTABLE') || undefined);
|
|
512
|
+
const directory=await $.env.get('CLAUDE_CONFIG_DIR') || (typeof options.configDir==='string' ? options.configDir : '');
|
|
513
|
+
const argv=[launch.executable,...launch.args,'ui',...(directory ? ['--config-dir',directory] : [])];
|
|
514
|
+
const session=await $.session.id();
|
|
515
|
+
let host_agents: { observed_at:number; agents:{id:string;name:string|null}[] } | undefined;
|
|
516
|
+
try {
|
|
517
|
+
const agents=await $.agent.list();
|
|
518
|
+
host_agents={observed_at:await $.clock.now(),agents:agents.slice(0,256).map(a=>({id:a.id,name:[...(a.name ?? a.description ?? '').replace(/[\p{Cc}\p{Cs}]/gu,'')].slice(0,256).join('') || null}))};
|
|
519
|
+
} catch { /* Published evidence remains usable without a host snapshot. */ }
|
|
520
|
+
const preference=parseResponse('read_ui_preferences',await $.process.run(argv,{stdin:requestText('read_ui_preferences',{}),timeoutMs:30000}));
|
|
521
|
+
const result=parseResponse('task_details',await $.process.run(argv,{stdin:requestText('task_details',{session_id:session,...(host_agents ? {host_agents} : {})}),timeoutMs:30000}));
|
|
522
|
+
if(result.session_id!==session)throw new Error(t('task.error.input',state.language));
|
|
523
|
+
if(state.generation!==epoch)return;
|
|
524
|
+
state.report=result;state.language=preference.ui_language;state.offset=0;
|
|
525
|
+
} catch(failure) {
|
|
526
|
+
if(state.generation===epoch)state.error=failure instanceof Error ? failure.message : String(failure);
|
|
527
|
+
} finally {
|
|
528
|
+
if(state.generation===epoch){state.loading=false;$.ui.invalidate('ui.render');}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
export function registerTaskDetails(on: On, options: PluginOptions, state: TaskPaneState): void {
|
|
532
|
+
const tr=(key:string)=>t(key,state.language);
|
|
533
|
+
on('command.run',{command:'statusline-task'},async($,e,next)=>{
|
|
534
|
+
if(!state.owned)return next(e);
|
|
535
|
+
const opened=await $.ui.open({id:TASK_PANE,title:tr('task.title'),focus:true,closeOnEscape:true,rows:24,columns:88});
|
|
536
|
+
if(!opened.isPlaced)return {text:tr('task.fallback')};
|
|
537
|
+
await refreshTaskDetails($,options,state);return {};
|
|
538
|
+
});
|
|
539
|
+
on('ui.close',{id:'statusline-task-details'},async($,e,next)=>{
|
|
540
|
+
state.generation++;state.loading=false;state.report=null;state.error='';return next(e);
|
|
541
|
+
});
|
|
542
|
+
on('ui.render',{component:'Pane',requestId:'statusline-task-details'},async($,e,next)=>{
|
|
543
|
+
if(!state.owned)return next(e);
|
|
544
|
+
const {Box,Text,Button}=$.ui.resolve(e);
|
|
545
|
+
if(e.surface!=='terminal')return Text({...styles.text,children:[tr('task.fallback')]});
|
|
546
|
+
const width=Math.max(2,e.props.bodyColumns),height=Math.max(4,e.props.scroll.bodyRows),capacity=Math.max(1,height-3);
|
|
547
|
+
const lines=state.report ? taskDetailLines(state.report,state.language,Math.max(2,width-2)) : [tr(state.loading?'profiles.loading':'task.unknown')];
|
|
548
|
+
state.offset=Math.max(0,Math.min(state.offset,Math.max(0,lines.length-capacity)));
|
|
549
|
+
return Box({width,height,flexDirection:'column',children:[
|
|
550
|
+
Text({...styles.accent,bold:true,wrap:'truncate',children:[tr('task.title')+' · '+(state.loading?tr('profiles.loading'):tr('task.readonly'))]}),
|
|
551
|
+
...lines.slice(state.offset,state.offset+capacity).map(line=>Text({...styles.text,wrap:'truncate',children:[line]})),
|
|
552
|
+
...(state.error?[Text({...styles.error,wrap:'truncate',children:[state.error.replace(/[\p{Cc}\p{Cs}]/gu,'')]} )]:[]),
|
|
553
|
+
Box({flexDirection:'row',columnGap:1,children:[
|
|
554
|
+
Button({...recoveryButton,key:'task-up',label:'↑',hotkey:'k',onPress:()=>{state.offset=Math.max(0,state.offset-capacity);$.ui.invalidate('ui.render');}}),
|
|
555
|
+
Button({...recoveryButton,key:'task-down',label:'↓',hotkey:'j',onPress:()=>{state.offset=Math.min(Math.max(0,lines.length-capacity),state.offset+capacity);$.ui.invalidate('ui.render');}}),
|
|
556
|
+
Button({...recoveryButton,key:'task-refresh',label:tr('profiles.refresh'),hotkey:'r',onPress:()=>refreshTaskDetails($,options,state)}),
|
|
557
|
+
Button({...recoveryButton,key:'task-close',label:tr('task.close'),hotkey:'q',onPress:()=>$.ui.close({id:TASK_PANE})}),
|
|
558
|
+
]}),
|
|
559
|
+
]});
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
|
|
485
563
|
export const register: Register = (on, options) => {
|
|
564
|
+
const taskDetails = taskPaneState();
|
|
565
|
+
registerTaskDetails(on, options, taskDetails);
|
|
486
566
|
const tr = (key: string, params: Record<string, unknown> = {}) => t(key, state.view.language ?? 'en', params);
|
|
487
567
|
|
|
488
568
|
const state: Session = {
|
|
@@ -505,6 +585,7 @@ export const register: Register = (on, options) => {
|
|
|
505
585
|
};
|
|
506
586
|
|
|
507
587
|
on('session.start', async ($, e, next) => {
|
|
588
|
+
await startTaskDetails($, taskDetails);
|
|
508
589
|
state.ownsCommand = false;
|
|
509
590
|
discard(state);
|
|
510
591
|
const open = await $.ui.panes();
|
|
@@ -602,6 +683,11 @@ export const register: Register = (on, options) => {
|
|
|
602
683
|
state.placed = true;
|
|
603
684
|
} else if (effect === 'reconcile') await reconcile($, state, options);
|
|
604
685
|
else if (effect === 'transfer') await transferDraft($, state, options);
|
|
686
|
+
else if (effect === 'profiles' && state.view.editor) {
|
|
687
|
+
state.writing = true;
|
|
688
|
+
try { await performProfileAction(state.view.editor, { request: (operation, payload) => callBackend($, options, operation, payload) }); }
|
|
689
|
+
finally { state.writing = false; state.previewKey = ''; }
|
|
690
|
+
}
|
|
605
691
|
else if (effect === 'applyPreferences')
|
|
606
692
|
await applyPreferences($, state, options);
|
|
607
693
|
else if (effect === 'retry') state.previewKey = '';
|
|
@@ -671,7 +757,7 @@ export const register: Register = (on, options) => {
|
|
|
671
757
|
state.columns = width;
|
|
672
758
|
state.rows = height;
|
|
673
759
|
const editor = state.view.editor;
|
|
674
|
-
const previewDraft = editor?.quick?.candidate ?? editor?.review?.result.draft ?? editor?.draft;
|
|
760
|
+
const previewDraft = editor?.profiles?.candidate ? { ...editor.draft, display: editor.profiles.candidate } : editor?.quick?.candidate ?? editor?.review?.result.draft ?? editor?.draft;
|
|
675
761
|
const previewColumns = contentColumns(width, height);
|
|
676
762
|
const explanation=editor?.explanation;
|
|
677
763
|
const key = `${state.epoch}:${previewColumns}:${explanation ? explanation.scope+':'+explanation.id : ''}:${previewDraft ? JSON.stringify(previewDraft) : ''}`;
|
|
@@ -443,6 +443,7 @@ export function parseResponse<O extends Operation>(
|
|
|
443
443
|
!STATUSLINELANGUAGE_VALUES.some(language => language === result.ui_language) ||
|
|
444
444
|
!(result.warning === null || isLocalizedText(result.warning))) fail();
|
|
445
445
|
} else if (operation === 'read' || operation === 'apply') {
|
|
446
|
+
if (result.configuration !== undefined && !isConfiguration(result.configuration)) fail();
|
|
446
447
|
if (
|
|
447
448
|
!isDraft(result.draft) ||
|
|
448
449
|
typeof result.revision !== 'string' ||
|
|
@@ -464,7 +465,13 @@ export function parseResponse<O extends Operation>(
|
|
|
464
465
|
if (!exact(result, ['draft','changes']) || !isDraft(result.draft) || !Array.isArray(result.changes) || !result.changes.every(isImportChange)) fail();
|
|
465
466
|
} else if (operation === 'import' || operation === 'preset') {
|
|
466
467
|
if (!isDraft(result.draft)) fail();
|
|
467
|
-
} else if (operation === '
|
|
468
|
+
} else if (operation === 'profiles_read' || operation === 'profiles_apply') {
|
|
469
|
+
if (!isProfiles(result) || operation === 'profiles_apply' && (typeof result.changed !== 'boolean' || !(result.backup_dir === null || text(result.backup_dir)))) fail();
|
|
470
|
+
} else if (operation === 'profile_import') {
|
|
471
|
+
if (!exact(result, ['name','display']) || !text(result.name) || !displayDraft(result.display)) fail();
|
|
472
|
+
} else if (operation === 'task_details') {
|
|
473
|
+
if (!isTaskDetails(result)) fail();
|
|
474
|
+
} else if (operation === 'export' || operation === 'profile_export') {
|
|
468
475
|
if (!text(result.path) || !result.path) fail();
|
|
469
476
|
} else if (operation === 'explain') {
|
|
470
477
|
if (!exact(result,['sample','scope','width','actual_availability','preview','instances']) || result.sample!==true ||
|
|
@@ -497,8 +504,8 @@ export function parseResponse<O extends Operation>(
|
|
|
497
504
|
!result.backend_version ||
|
|
498
505
|
!isOptions(result.options) ||
|
|
499
506
|
!isCapabilities(result.capabilities) ||
|
|
500
|
-
!selection(result.operations, ['describe', 'read', 'preview', 'apply', 'import', 'export', 'preset', 'read_ui_preferences', 'set_ui_language', 'review_import', 'explain', 'diagnose']) ||
|
|
501
|
-
result.operations.length !==
|
|
507
|
+
!selection(result.operations, ['describe', 'read', 'preview', 'apply', 'import', 'export', 'preset', 'read_ui_preferences', 'set_ui_language', 'review_import', 'explain', 'diagnose', 'profiles_read', 'profiles_apply', 'profile_import', 'profile_export', 'task_details']) ||
|
|
508
|
+
result.operations.length !== 17 ||
|
|
502
509
|
JSON.stringify(result.editor_fields) !== JSON.stringify(EDITOR_FIELDS) ||
|
|
503
510
|
JSON.stringify(result.presets) !== JSON.stringify(PRESETS) ||
|
|
504
511
|
!object(result.formatting_options) ||
|
|
@@ -510,10 +517,53 @@ export function parseResponse<O extends Operation>(
|
|
|
510
517
|
return result as unknown as ResultFor<O>;
|
|
511
518
|
}
|
|
512
519
|
|
|
520
|
+
function displayDraft(display: unknown): boolean {
|
|
521
|
+
return isDraft({ display, host: { padding: 0, refresh_interval: 'event', hide_vim_mode_indicator: false } });
|
|
522
|
+
}
|
|
523
|
+
function isConfiguration(value: unknown): boolean {
|
|
524
|
+
if (!object(value) || !exact(value, ['target','profile_id','profile_name','project_root','reason','shared_projects']) || !object(value.target)) return false;
|
|
525
|
+
const target = value.target;
|
|
526
|
+
return (target.kind === 'user' && exact(target,['kind']) || target.kind === 'profile' && exact(target,['kind','id']) && text(target.id) ||
|
|
527
|
+
target.kind === 'project' && exact(target,['kind','path']) && text(target.path)) &&
|
|
528
|
+
['profile_id','profile_name','project_root'].every(k => value[k] === null || text(value[k])) && text(value.reason) && strings(value.shared_projects);
|
|
529
|
+
}
|
|
530
|
+
function isProfiles(value: Record<string, unknown>): boolean {
|
|
531
|
+
if (value.version !== 1 || !text(value.revision) || !/^[a-f0-9]{64}$/u.test(value.revision) ||
|
|
532
|
+
!Array.isArray(value.profiles) || !Array.isArray(value.bindings) || value.profiles.length > 128 || value.bindings.length > 512) return false;
|
|
533
|
+
const ids = new Set<string>(), names = new Set<string>(), roots = new Set<string>();
|
|
534
|
+
return value.profiles.every(p => {
|
|
535
|
+
if (!object(p) || !exact(p,['id','name','display']) || !text(p.id) || !text(p.name) || ids.has(p.id) || names.has(p.name) || !displayDraft(p.display)) return false;
|
|
536
|
+
ids.add(p.id); names.add(p.name); return true;
|
|
537
|
+
}) && value.bindings.every(b => {
|
|
538
|
+
if (!object(b) || !exact(b,['root','profile_id']) || !text(b.root) || !text(b.profile_id) || roots.has(b.root)) return false;
|
|
539
|
+
roots.add(b.root); return true;
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
function isTaskDetails(value: Record<string, unknown>): boolean {
|
|
543
|
+
const nullable = (v: unknown) => v === null || text(v);
|
|
544
|
+
const count = (v: unknown) => v === null || typeof v === 'number' && Number.isFinite(v) && v >= 0;
|
|
545
|
+
const stamp = (v: unknown) => v === null || text(v) && Number.isFinite(Date.parse(v));
|
|
546
|
+
const evidence = (v: unknown) => object(v) && exact(v,['source','scope','status','observed_at','freshness']) && text(v.source) &&
|
|
547
|
+
text(v.scope) && text(v.status) && stamp(v.observed_at) && ['current','stale','unknown','newer_than_input'].includes(String(v.freshness));
|
|
548
|
+
if (!exact(value,['version','session_id','prompt_id','captured_at','status','phase','elapsed_seconds','active_seconds','progress','agents','evidence','limitations']) ||
|
|
549
|
+
value.version !== 1 || !text(value.session_id) || !nullable(value.prompt_id) || !text(value.captured_at) || !stamp(value.captured_at) ||
|
|
550
|
+
!nullable(value.status) || !nullable(value.phase) || !count(value.elapsed_seconds) || !count(value.active_seconds) ||
|
|
551
|
+
!Array.isArray(value.evidence) || !value.evidence.every(evidence) || !strings(value.limitations) || !Array.isArray(value.agents)) return false;
|
|
552
|
+
if (value.progress !== null && (!object(value.progress) || !exact(value.progress,['completed','total']) || !range(value.progress.completed,0,100000) ||
|
|
553
|
+
!range(value.progress.total,0,100000) || Number(value.progress.completed) > Number(value.progress.total))) return false;
|
|
554
|
+
const ids = new Set<string>();
|
|
555
|
+
return value.agents.every(agent => {
|
|
556
|
+
if (!object(agent) || !exact(agent,['id','parent_id','name','status','evidence']) || !text(agent.id) || ids.has(agent.id) ||
|
|
557
|
+
!nullable(agent.parent_id) || !nullable(agent.name) || !nullable(agent.status) || !Array.isArray(agent.evidence) || !agent.evidence.every(evidence)) return false;
|
|
558
|
+
ids.add(agent.id); return true;
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
|
|
513
562
|
function isDiagnosis(value: Record<string, unknown>): boolean {
|
|
514
563
|
const nullable = (v: unknown) => v === null || text(v);
|
|
515
564
|
const stamp = (v: unknown) => v === null || typeof v === 'string' && Number.isFinite(Date.parse(v));
|
|
516
|
-
if (!exact(value, ['sample','scope','width','source','observed_at','diagnosed_at','session_id','prompt_id','host_version','include_local','output','instances','host_fields']) ||
|
|
565
|
+
if (!exact(value, ['sample','scope','width','source','observed_at','diagnosed_at','session_id','prompt_id','host_version','include_local','output','instances','host_fields', ...(value.configuration !== undefined ? ['configuration'] : [])]) ||
|
|
566
|
+
value.configuration !== undefined && !isConfiguration(value.configuration) ||
|
|
517
567
|
value.sample !== false || !['main','subagent'].includes(String(value.scope)) || !range(value.width,2,10000) || !text(value.source) ||
|
|
518
568
|
!stamp(value.observed_at) || value.diagnosed_at === null || !stamp(value.diagnosed_at) || !nullable(value.session_id) || !nullable(value.prompt_id) ||
|
|
519
569
|
!nullable(value.host_version) || typeof value.include_local !== 'boolean' || !Array.isArray(value.output) || !Array.isArray(value.instances) || !object(value.host_fields)) return false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { openExplanation, explanationKey } from '../editor/explanation.ts';
|
|
2
2
|
import { openQuick, controlQuick } from '../editor/quick-setup.ts';
|
|
3
|
+
import { openProfiles, profilesKey } from '../editor/profile-manager.ts';
|
|
3
4
|
import { inputKey } from '../editor/text-input.ts';
|
|
4
5
|
import type { NativeKeyEvent } from './messages.ts';
|
|
5
6
|
import { setMessage, failureMessage } from '../i18n/messages.ts';
|
|
@@ -13,7 +14,7 @@ import { formSelection, pageSelection } from '../editor/navigation.ts';
|
|
|
13
14
|
import { guidanceLines } from '../editor/guidance.ts';
|
|
14
15
|
import { navigateReview } from '../editor/import-review.ts';
|
|
15
16
|
|
|
16
|
-
export type Effect = 'save' | 'finish' | 'close' | 'reload' | 'reconcile' | 'retry' | 'applyPreferences' | 'transfer' | 'previewBackground' | 'uiLanguage' | 'reviewPreview' | 'explain' | null;
|
|
17
|
+
export type Effect = 'save' | 'finish' | 'close' | 'reload' | 'reconcile' | 'retry' | 'applyPreferences' | 'transfer' | 'previewBackground' | 'uiLanguage' | 'reviewPreview' | 'explain' | 'profiles' | null;
|
|
17
18
|
|
|
18
19
|
export function cancelInput(view: View): void {
|
|
19
20
|
const input = view.input, e = view.editor;
|
|
@@ -34,6 +35,11 @@ export function handleKey(view: View, event: NativeKeyEvent, columns: number, ro
|
|
|
34
35
|
const shortcut = /^[A-Z]$/.test(key) ? key.toLowerCase() : key;
|
|
35
36
|
if (!e || view.busy) return null;
|
|
36
37
|
if (event.overflow) { setMessage(view, 'message', localizedText('input.overflow')); return null; }
|
|
38
|
+
if (e.profiles) return profilesKey(e, { ...event, key: key === 'return' ? 'enter' : key });
|
|
39
|
+
if (event.ctrl && key.toLowerCase() === 'o' && !view.input && !e.detail && !e.adding && !e.review && !e.quick && !e.explanation && !view.uncertain) {
|
|
40
|
+
if (e.acceptNumeric()) { openProfiles(e); return 'profiles'; }
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
37
43
|
if (event.text && (!view.input || view.input.kind === 'category')) return null;
|
|
38
44
|
if(e.explanation) { if(!explanationKey(e.explanation,event.ctrl && key.toLowerCase()==='g'?'cancel':event.ctrl||event.meta?'':key,Math.max(1,rows-10))) e.explanation=null; return null; }
|
|
39
45
|
if (e.quick) return controlQuick(e,event.ctrl && key.toLowerCase()==='g' ? 'cancel' : event.ctrl || event.meta ? '' : key);
|
|
@@ -191,6 +197,7 @@ export function handleKey(view: View, event: NativeKeyEvent, columns: number, ro
|
|
|
191
197
|
return isSettings && e.setting === 'preview-background' ? 'previewBackground' : isSettings && e.setting === 'ui-language' ? 'uiLanguage' : null;
|
|
192
198
|
} else if (key === 'return' || key === ' ' || key === 'space') {
|
|
193
199
|
if (!isSettings) { if(!e.toggle(scope, selected))setMessage(view,"message",localizedText("composition.invalid")); }
|
|
200
|
+
else if (e.setting === 'profiles') { if (e.acceptNumeric()) { openProfiles(e); return 'profiles'; } }
|
|
194
201
|
else if (e.setting === 'quick-setup') { if (e.acceptNumeric()) e.quick=openQuick(e.draft); }
|
|
195
202
|
else if(e.setting==='item-explain' && e.detail) { e.explanation=openExplanation(e.detail.scope,e.detail.id); return 'explain'; }
|
|
196
203
|
else if (e.setting === 'item-guidance') e.guidanceScroll = 0;
|
package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts
CHANGED
|
@@ -97,6 +97,7 @@ export function settingRows(view: View): SettingRow[] {
|
|
|
97
97
|
rows.push(...fields.filter(row => row.group !== 'Appearance'));
|
|
98
98
|
rows.push(
|
|
99
99
|
{ key: 'ui-language', label: 'Interface language (saved immediately)', group: 'Interface', value: LANGUAGE_NAMES[view.language ?? 'en'], editable: true },
|
|
100
|
+
{ key: 'profiles', label: 'Display schemes and projects', group: 'Presets / portable files', value: 'Enter', editable: true },
|
|
100
101
|
{ key: 'quick-setup', label: 'Quick setup', group: 'Presets / portable files', value: 'Enter', editable: true },
|
|
101
102
|
{ key: 'preset-select', label: 'Preset', group: 'Presets / portable files', value: e.preset, editable: true },
|
|
102
103
|
{ key: 'preset-apply', label: 'Expand selected preset', group: 'Presets / portable files', value: 'replace draft; save later', editable: true },
|
package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by tools/generation/resources.ts; do not edit.
|
|
2
2
|
import type { ExplanationView } from './explanation.ts';
|
|
3
|
+
import type { ProfileManager } from './profile-manager.ts';
|
|
3
4
|
import type { QuickSetup } from './quick-setup.ts';
|
|
4
5
|
import { t, type Language } from '../i18n/index.ts';
|
|
5
6
|
import { nodes, newInstance, reconcileRows } from './instances.ts';
|
|
@@ -43,6 +44,7 @@ export class Editor {
|
|
|
43
44
|
review: ReviewState | null = null;
|
|
44
45
|
quick: QuickSetup | null = null;
|
|
45
46
|
explanation: ExplanationView | null = null;
|
|
47
|
+
profiles: ProfileManager | null = null;
|
|
46
48
|
preset = 'minimal';
|
|
47
49
|
path = 'statusline.json';
|
|
48
50
|
pendingTransfer: 'import' | 'export' | 'preset' | null = null;
|