gestalt-mobile 0.64.1 → 0.65.1
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 +18 -2
- package/dist/client/assets/index-BPykjYhf.js +128 -0
- package/dist/client/assets/{index-DS139o-V.css → index-tqrTVa26.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server/composition.js +9 -4
- package/dist/server/server/features/sessions/get-history/endpoint.js +1 -1
- package/dist/server/server/features/skills/list-available/endpoint.js +1 -0
- package/dist/server/server/features/skills/model/skill-profile.js +8 -0
- package/dist/server/server/platform/kimi/kimi-skill-catalog.js +29 -3
- package/dist/server/server/platform/kimi/kimi-skills-materializer.js +6 -5
- package/dist/server/server/platform/retrieval/xerj-index-diagnostic.js +6 -0
- package/dist/server/server/platform/retrieval/xerj-indexer.js +21 -7
- package/dist/server/server/platform/skills/cached-skill-catalog.js +9 -5
- package/dist/server/server/platform/skills/managed-skill-catalog.js +61 -0
- package/dist/server/server/platform/skills/managed-skill-provenance.js +173 -0
- package/dist/server/server/platform/skills/verified-skill-catalog.js +30 -0
- package/dist/server/shared/contracts/autopilot-recovery.js +5 -2
- package/package.json +1 -1
- package/dist/client/assets/index-Cj7IlGeB.js +0 -128
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
5
|
*/
|
|
6
6
|
import { mkdirSync, readdirSync, rmSync, symlinkSync } from 'node:fs';
|
|
7
|
-
import { basename, isAbsolute, join } from 'node:path';
|
|
7
|
+
import { basename, dirname, isAbsolute, join } from 'node:path';
|
|
8
8
|
/**
|
|
9
9
|
* Materializes a kimi skills directory from a gestalt skill selection: one
|
|
10
10
|
* symlink per enabled entry, named by the entry's basename. kimi discovers
|
|
11
11
|
* both directory skills (a folder holding `SKILL.md`) and flat `.md` skills
|
|
12
|
-
* in an `extra_skill_dirs` entry
|
|
13
|
-
*
|
|
12
|
+
* in an `extra_skill_dirs` entry. Canonical SKILL.md identities link their
|
|
13
|
+
* parent folder so names and relative references retain the directory shape.
|
|
14
14
|
*
|
|
15
15
|
* Note: `extra_skill_dirs` only *adds* directories on top of kimi's automatic
|
|
16
16
|
* user/project discovery — unlike codex's `skills.config` override, kimi web
|
|
@@ -28,12 +28,13 @@ export function materializeKimiSkillsDir(skillsDir, selection) {
|
|
|
28
28
|
continue;
|
|
29
29
|
if (!isAbsolute(entry.path))
|
|
30
30
|
continue;
|
|
31
|
-
const
|
|
31
|
+
const target = basename(entry.path) === 'SKILL.md' ? dirname(entry.path) : entry.path;
|
|
32
|
+
const name = basename(target);
|
|
32
33
|
if (taken.has(name)) {
|
|
33
34
|
skipped.push(entry.path);
|
|
34
35
|
continue;
|
|
35
36
|
}
|
|
36
|
-
symlinkSync(
|
|
37
|
+
symlinkSync(target, join(skillsDir, name));
|
|
37
38
|
taken.add(name);
|
|
38
39
|
linked.push(entry.path);
|
|
39
40
|
}
|
|
@@ -9,6 +9,9 @@ import { join } from 'node:path';
|
|
|
9
9
|
/** Classify bounded native prose; never retain it or copy arbitrary native fields. */
|
|
10
10
|
export function xerjIndexDiagnostic(message) {
|
|
11
11
|
const text = typeof message === 'string' ? message.slice(0, 16_384) : '';
|
|
12
|
+
const pass = /^watch: pass (\d+) FAILED after (\d+(?:\.\d+)?)s:/.exec(text);
|
|
13
|
+
const number = pass ? Number(pass[1]) : Number.NaN;
|
|
14
|
+
const durationSeconds = pass ? Number(pass[2]) : Number.NaN;
|
|
12
15
|
const code = text.includes('refusing ambiguous assignment')
|
|
13
16
|
? 'ambiguous-assignment'
|
|
14
17
|
: /\b(timeout|timed out)\b/i.test(text)
|
|
@@ -32,6 +35,9 @@ export function xerjIndexDiagnostic(message) {
|
|
|
32
35
|
occurredAt: new Date().toISOString(),
|
|
33
36
|
code,
|
|
34
37
|
messageDigest: text ? createHash('sha256').update(text).digest('hex') : null,
|
|
38
|
+
...(Number.isSafeInteger(number) && Number.isFinite(durationSeconds)
|
|
39
|
+
? { watchPass: { number, durationSeconds } }
|
|
40
|
+
: {}),
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
/** One private atomic record per root; repeated warnings cannot grow a log. */
|
|
@@ -218,7 +218,13 @@ export class XerjIndexer {
|
|
|
218
218
|
const percent = typeof event.pct === 'number' && event.pct >= 0 && event.pct <= 100
|
|
219
219
|
? event.pct
|
|
220
220
|
: undefined;
|
|
221
|
-
this.value = {
|
|
221
|
+
this.value = {
|
|
222
|
+
...this.value,
|
|
223
|
+
state: 'indexing',
|
|
224
|
+
phase,
|
|
225
|
+
percent,
|
|
226
|
+
message: 'XERJ indexing is in progress. Index coverage is unverified until this pass succeeds.',
|
|
227
|
+
};
|
|
222
228
|
}
|
|
223
229
|
else if (event.event === 'done') {
|
|
224
230
|
if (event.ok !== true) {
|
|
@@ -270,17 +276,25 @@ export class XerjIndexer {
|
|
|
270
276
|
reference);
|
|
271
277
|
return;
|
|
272
278
|
}
|
|
273
|
-
if (diagnostic.code === 'watch-pass-failed') {
|
|
274
|
-
this.fail('XERJ index update failed. The watcher is still running and will retry after a source change; existing index coverage is unverified until an update succeeds.' +
|
|
275
|
-
reference);
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
279
|
if (diagnostic.code === 'ambiguous-assignment') {
|
|
279
280
|
this.fail('XERJ incremental dataset assignment failed; the index is stale. See the XERJ recovery guide for this upstream limitation.' +
|
|
280
281
|
reference);
|
|
281
282
|
return;
|
|
282
283
|
}
|
|
283
|
-
|
|
284
|
+
const cause = {
|
|
285
|
+
timeout: 'An indexing operation timed out.',
|
|
286
|
+
authentication: 'The indexing backend rejected authentication or access.',
|
|
287
|
+
connection: 'The indexing backend connection failed.',
|
|
288
|
+
capacity: 'Indexing ran out of memory or disk space.',
|
|
289
|
+
'watch-pass-failed': 'The underlying cause could not be classified.',
|
|
290
|
+
'unknown-warning': 'The warning could not be classified.',
|
|
291
|
+
}[diagnostic.code];
|
|
292
|
+
const pass = diagnostic.watchPass;
|
|
293
|
+
this.fail((pass
|
|
294
|
+
? `XERJ watch pass ${pass.number} failed after ${pass.durationSeconds}s. `
|
|
295
|
+
: 'XERJ indexing reported a warning. ') +
|
|
296
|
+
cause +
|
|
297
|
+
' The watcher is still running and is waiting for a source change to retry; index coverage is unverified until an update succeeds.' +
|
|
284
298
|
reference);
|
|
285
299
|
}
|
|
286
300
|
}
|
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
5
|
*/
|
|
6
6
|
import { resolve } from 'node:path';
|
|
7
|
+
import { verifySkillProvenance } from './verified-skill-catalog.js';
|
|
7
8
|
/** In-memory editor catalog: discovery runs only when the relay starts or a user refreshes it. */
|
|
8
9
|
export class CachedSkillCatalog {
|
|
9
10
|
discover;
|
|
10
11
|
validate;
|
|
12
|
+
provenance;
|
|
11
13
|
entries = new Map();
|
|
12
|
-
constructor(discover, validate) {
|
|
14
|
+
constructor(discover, validate, provenance) {
|
|
13
15
|
this.discover = discover;
|
|
14
16
|
this.validate = validate;
|
|
17
|
+
this.provenance = provenance;
|
|
15
18
|
}
|
|
16
19
|
async list(provider, profile, workspace) {
|
|
17
20
|
const result = this.entries.get(this.key(provider, profile, workspace)) ?? {
|
|
@@ -22,18 +25,19 @@ export class CachedSkillCatalog {
|
|
|
22
25
|
},
|
|
23
26
|
],
|
|
24
27
|
};
|
|
25
|
-
if (!this.validate)
|
|
26
|
-
return result;
|
|
27
28
|
// Validation is a live capability projection over the last discovered
|
|
28
29
|
// catalog. Keep the discovery baseline so a transient outage can recover
|
|
29
30
|
// on the next list without requiring package rediscovery.
|
|
30
|
-
|
|
31
|
+
const current = this.validate
|
|
32
|
+
? await this.validate(provider, profile, workspace, result)
|
|
33
|
+
: result;
|
|
34
|
+
return this.provenance ? verifySkillProvenance(current, this.provenance) : current;
|
|
31
35
|
}
|
|
32
36
|
async refresh(provider, profile, workspace) {
|
|
33
37
|
try {
|
|
34
38
|
const result = await this.discover(provider, profile, workspace);
|
|
35
39
|
this.entries.set(this.key(provider, profile, workspace), result);
|
|
36
|
-
return result;
|
|
40
|
+
return this.provenance ? verifySkillProvenance(result, this.provenance) : result;
|
|
37
41
|
}
|
|
38
42
|
catch {
|
|
39
43
|
const result = {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2026 Dyne.org foundation
|
|
3
|
+
* Designed by Denis Roio <jaromil@dyne.org>
|
|
4
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
+
*/
|
|
6
|
+
import { readFile, readdir, realpath } from 'node:fs/promises';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { parseDocument } from 'yaml';
|
|
9
|
+
/**
|
|
10
|
+
* Make the optional collection available to providers that do not discover
|
|
11
|
+
* Codex home. This is ordinary filesystem discovery: receipt/integrity failures
|
|
12
|
+
* affect provenance independently, never whether a user can select a skill.
|
|
13
|
+
*/
|
|
14
|
+
export class ManagedSkillCatalog {
|
|
15
|
+
codexHome;
|
|
16
|
+
constructor(codexHome) {
|
|
17
|
+
this.codexHome = codexHome;
|
|
18
|
+
}
|
|
19
|
+
async list() {
|
|
20
|
+
const skills = [];
|
|
21
|
+
const root = join(this.codexHome, 'gestalt-skills', 'skills');
|
|
22
|
+
try {
|
|
23
|
+
for (const entry of await readdir(root, { withFileTypes: true })) {
|
|
24
|
+
if (!entry.isDirectory() || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(entry.name))
|
|
25
|
+
continue;
|
|
26
|
+
try {
|
|
27
|
+
const path = await realpath(join(root, entry.name, 'SKILL.md'));
|
|
28
|
+
const text = await readFile(path, 'utf8');
|
|
29
|
+
const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(text);
|
|
30
|
+
if (!frontmatter)
|
|
31
|
+
continue;
|
|
32
|
+
const document = parseDocument(frontmatter[1], { strict: true, uniqueKeys: true });
|
|
33
|
+
if (document.errors.length)
|
|
34
|
+
continue;
|
|
35
|
+
const metadata = document.toJS();
|
|
36
|
+
if (metadata?.name !== entry.name)
|
|
37
|
+
continue;
|
|
38
|
+
skills.push({
|
|
39
|
+
name: entry.name,
|
|
40
|
+
path,
|
|
41
|
+
enabled: true,
|
|
42
|
+
scope: 'user',
|
|
43
|
+
...(typeof metadata.description === 'string'
|
|
44
|
+
? { description: metadata.description }
|
|
45
|
+
: {}),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// A missing/invalid entry cannot suppress other installed skills.
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// The optional collection may not be installed.
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
skills: skills.sort((left, right) => left.path.localeCompare(right.path)),
|
|
58
|
+
errors: [],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2026 Dyne.org foundation
|
|
3
|
+
* Designed by Denis Roio <jaromil@dyne.org>
|
|
4
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
+
*/
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
import { lstat, readFile, readdir, realpath } from 'node:fs/promises';
|
|
8
|
+
import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
9
|
+
import { parseDocument } from 'yaml';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
const repository = 'dyne/gestalt-skills';
|
|
12
|
+
const source = 'https://github.com/dyne/gestalt-skills';
|
|
13
|
+
const digest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
14
|
+
const bundledFile = z.object({ path: z.string().min(1).max(512), sha256: digest }).strict();
|
|
15
|
+
const collectionSkill = z
|
|
16
|
+
.object({
|
|
17
|
+
name: z
|
|
18
|
+
.string()
|
|
19
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
20
|
+
.max(63),
|
|
21
|
+
entry: z.string().min(1).max(512),
|
|
22
|
+
files: z.array(bundledFile).min(1).max(4096),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
const manifestSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
schemaVersion: z.literal(1),
|
|
28
|
+
repository: z.literal(repository),
|
|
29
|
+
source: z.literal(source),
|
|
30
|
+
version: z.string().regex(/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/),
|
|
31
|
+
skills: z.array(collectionSkill).min(1).max(256),
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
const receiptSchema = manifestSchema
|
|
35
|
+
.omit({ source: true })
|
|
36
|
+
.extend({
|
|
37
|
+
source: z.literal(source),
|
|
38
|
+
revision: z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),
|
|
39
|
+
manifestSha256: digest,
|
|
40
|
+
managedRoot: z.string(),
|
|
41
|
+
discoveryRoot: z.string(),
|
|
42
|
+
verifiedSource: z.literal(true),
|
|
43
|
+
packageFiles: z.array(bundledFile).length(1),
|
|
44
|
+
installedAt: z.iso.datetime(),
|
|
45
|
+
transactionId: z.string().regex(/^[a-f0-9]{48}$/),
|
|
46
|
+
})
|
|
47
|
+
.strict();
|
|
48
|
+
function sha256(bytes) {
|
|
49
|
+
return createHash('sha256').update(bytes).digest('hex');
|
|
50
|
+
}
|
|
51
|
+
async function ordinaryBytes(path, limit) {
|
|
52
|
+
const stat = await lstat(path);
|
|
53
|
+
if (!stat.isFile() || stat.size > limit)
|
|
54
|
+
throw new Error('Invalid managed file.');
|
|
55
|
+
return readFile(path);
|
|
56
|
+
}
|
|
57
|
+
function json(bytes) {
|
|
58
|
+
const text = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
59
|
+
// JSON.parse enforces JSON syntax; the YAML reader additionally rejects
|
|
60
|
+
// duplicate decoded mapping keys, including JSON escape spellings.
|
|
61
|
+
const value = JSON.parse(text);
|
|
62
|
+
if (parseDocument(text, { strict: true, uniqueKeys: true }).errors.length)
|
|
63
|
+
throw new Error('Invalid managed JSON.');
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
function inside(root, path) {
|
|
67
|
+
const child = relative(root, path);
|
|
68
|
+
return child !== '' && child !== '..' && !child.startsWith(`..${sep}`) && !isAbsolute(child);
|
|
69
|
+
}
|
|
70
|
+
function bundledPath(root, path) {
|
|
71
|
+
if (path.includes('\\') || path.split('/').some((part) => !part || part === '.' || part === '..'))
|
|
72
|
+
throw new Error('Invalid bundled path.');
|
|
73
|
+
const absolute = resolve(root, path);
|
|
74
|
+
if (!inside(root, absolute) || isAbsolute(path))
|
|
75
|
+
throw new Error('Invalid bundled path.');
|
|
76
|
+
return absolute;
|
|
77
|
+
}
|
|
78
|
+
async function inventory(root) {
|
|
79
|
+
const result = [];
|
|
80
|
+
for (const entry of await readdir(root, { withFileTypes: true })) {
|
|
81
|
+
const path = join(root, entry.name);
|
|
82
|
+
if (entry.isDirectory())
|
|
83
|
+
result.push(...(await inventory(path)));
|
|
84
|
+
else if (entry.isFile())
|
|
85
|
+
result.push(path);
|
|
86
|
+
else
|
|
87
|
+
throw new Error('Invalid managed inventory.');
|
|
88
|
+
}
|
|
89
|
+
return result.sort();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Trust only the configured home, never a root inferred from a discovered path.
|
|
93
|
+
* Verification is local provenance/integrity, not protection against an owner
|
|
94
|
+
* replacing both the package and its installer receipt. No state is cached.
|
|
95
|
+
*/
|
|
96
|
+
export class ManagedSkillProvenance {
|
|
97
|
+
codexHome;
|
|
98
|
+
constructor(codexHome) {
|
|
99
|
+
this.codexHome = codexHome;
|
|
100
|
+
}
|
|
101
|
+
async verify(paths) {
|
|
102
|
+
const verified = new Map();
|
|
103
|
+
if (!paths.length)
|
|
104
|
+
return verified;
|
|
105
|
+
try {
|
|
106
|
+
const home = await realpath(this.codexHome);
|
|
107
|
+
const root = join(home, 'gestalt-skills');
|
|
108
|
+
const discovery = join(home, 'skills');
|
|
109
|
+
// Home aliases are supported; the collection/discovery roots themselves
|
|
110
|
+
// must be the installer-owned locations, not links to arbitrary copies.
|
|
111
|
+
if ((await realpath(root)) !== root || (await realpath(discovery)) !== discovery)
|
|
112
|
+
return verified;
|
|
113
|
+
const manifestBytes = await ordinaryBytes(join(root, 'manifest.json'), 2 * 1024 * 1024);
|
|
114
|
+
const receipt = receiptSchema.parse(json(await ordinaryBytes(join(root, 'receipt.json'), 2 * 1024 * 1024)));
|
|
115
|
+
const manifest = manifestSchema.parse(json(manifestBytes));
|
|
116
|
+
if (receipt.managedRoot !== root ||
|
|
117
|
+
receipt.discoveryRoot !== discovery ||
|
|
118
|
+
receipt.manifestSha256 !== sha256(manifestBytes) ||
|
|
119
|
+
receipt.version !== manifest.version ||
|
|
120
|
+
JSON.stringify(receipt.skills) !== JSON.stringify(manifest.skills) ||
|
|
121
|
+
receipt.packageFiles[0].path !== 'LICENSE')
|
|
122
|
+
return verified;
|
|
123
|
+
const expected = [];
|
|
124
|
+
const entries = new Set();
|
|
125
|
+
const names = manifest.skills.map((skill) => skill.name);
|
|
126
|
+
if (names.join('\n') !== [...new Set(names)].sort().join('\n'))
|
|
127
|
+
return verified;
|
|
128
|
+
for (const skill of manifest.skills) {
|
|
129
|
+
if (skill.entry !== `skills/${skill.name}/SKILL.md`)
|
|
130
|
+
return verified;
|
|
131
|
+
const entry = bundledPath(root, skill.entry);
|
|
132
|
+
entries.add(entry);
|
|
133
|
+
const skillRoot = join(root, 'skills', skill.name);
|
|
134
|
+
const filePaths = skill.files.map((file) => file.path);
|
|
135
|
+
if (!filePaths.includes(skill.entry) ||
|
|
136
|
+
filePaths.join('\n') !== [...new Set(filePaths)].sort().join('\n'))
|
|
137
|
+
return verified;
|
|
138
|
+
for (const file of skill.files) {
|
|
139
|
+
const path = bundledPath(root, file.path);
|
|
140
|
+
if (!inside(skillRoot, path) || (await realpath(path)) !== path)
|
|
141
|
+
return verified;
|
|
142
|
+
if (sha256(await ordinaryBytes(path, 16 * 1024 * 1024)) !== file.sha256)
|
|
143
|
+
return verified;
|
|
144
|
+
expected.push(path);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (JSON.stringify(await inventory(join(root, 'skills'))) !== JSON.stringify(expected.sort()))
|
|
148
|
+
return verified;
|
|
149
|
+
const license = receipt.packageFiles[0];
|
|
150
|
+
if (sha256(await ordinaryBytes(join(root, license.path), 16 * 1024 * 1024)) !== license.sha256)
|
|
151
|
+
return verified;
|
|
152
|
+
// Resolve aliases only after validating the trusted installation. The
|
|
153
|
+
// returned map retains each provider's existing path identity.
|
|
154
|
+
for (const path of paths) {
|
|
155
|
+
try {
|
|
156
|
+
if (isAbsolute(path) && entries.has(await realpath(path)))
|
|
157
|
+
verified.set(path, {
|
|
158
|
+
kind: 'gestalt-verified',
|
|
159
|
+
repository,
|
|
160
|
+
revision: receipt.revision,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
/* Removed/unreadable skills remain ordinary discovery metadata. */
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
/* Optional receipts must never make ordinary skill discovery unusable. */
|
|
170
|
+
}
|
|
171
|
+
return verified;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2026 Dyne.org foundation
|
|
3
|
+
* Designed by Denis Roio <jaromil@dyne.org>
|
|
4
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
5
|
+
*/
|
|
6
|
+
/** Discard supplied metadata before projecting current server-owned verification. */
|
|
7
|
+
export async function verifySkillProvenance(result, verifier) {
|
|
8
|
+
const verified = await verifier.verify(result.skills.map((skill) => skill.path));
|
|
9
|
+
return {
|
|
10
|
+
...result,
|
|
11
|
+
skills: result.skills.map((skill) => {
|
|
12
|
+
const ordinary = { ...skill };
|
|
13
|
+
delete ordinary.provenance;
|
|
14
|
+
const provenance = verified.get(skill.path);
|
|
15
|
+
return { ...ordinary, ...(provenance ? { provenance } : {}) };
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Provider-neutral decoration after each provider has parsed its wire response. */
|
|
20
|
+
export class VerifiedSkillCatalog {
|
|
21
|
+
catalog;
|
|
22
|
+
verifier;
|
|
23
|
+
constructor(catalog, verifier) {
|
|
24
|
+
this.catalog = catalog;
|
|
25
|
+
this.verifier = verifier;
|
|
26
|
+
}
|
|
27
|
+
async list(workspace) {
|
|
28
|
+
return verifySkillProvenance(await this.catalog.list(workspace), this.verifier);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
/** Safe, shared UI copy for the bounded checkpoint transport recovery path. */
|
|
7
7
|
export const checkpointHandoffRecoveryMessage = 'Checkpoint handoff failed. Autopilot is reconnecting this session automatically. If it cannot recover, restore or reopen the session.';
|
|
8
8
|
/** Reconciliation can fail while the coordinator remains enabled for recovery. */
|
|
9
|
-
export const reconciliationRecoveryMessage = 'Autopilot
|
|
9
|
+
export const reconciliationRecoveryMessage = 'Autopilot is recovering after a continuation or agent status check failed. It will retry automatically. If recovery persists, retry Autopilot or restore the session.';
|
|
10
10
|
export function isReconciliationRecovery(snapshot) {
|
|
11
|
-
return Boolean(snapshot?.enabled &&
|
|
11
|
+
return Boolean(snapshot?.enabled &&
|
|
12
|
+
snapshot.state === 'monitoring' &&
|
|
13
|
+
snapshot.reason === 'reconcileFailed' &&
|
|
14
|
+
snapshot.health?.healthy !== true);
|
|
12
15
|
}
|