opencode-agent-skill 15.1.1 → 15.1.2
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 +5 -5
- package/lib/affected-tests.mjs +7 -3
- package/lib/code-intelligence/index.mjs +47 -9
- package/lib/code-intelligence/lsp-pool.mjs +191 -54
- package/lib/code-intelligence/lsp-provider.mjs +44 -7
- package/lib/context-manifest.mjs +55 -20
- package/lib/execution-contract.mjs +2 -2
- package/lib/memory-engine.mjs +14 -9
- package/lib/pi-rpc-pool.mjs +55 -24
- package/lib/repo-graph.mjs +2 -2
- package/lib/repo-inspect.mjs +3 -2
- package/lib/semantic-index.mjs +2 -1
- package/lib/task-engine.mjs +28 -9
- package/lib/workspace-fingerprint.mjs +17 -9
- package/lib/workspace-hygiene.mjs +2 -2
- package/lib/worktree-sandbox.mjs +14 -8
- package/package.json +1 -1
- package/pi/extensions/ues-child-runtime.ts +38 -2
- package/pi/extensions/ues.ts +95 -10
- package/scripts/check-source-integrity.mjs +60 -7
package/pi/extensions/ues.ts
CHANGED
|
@@ -156,6 +156,12 @@ const MODEL_VISIBLE_OUTPUT_LIMIT = configuredDuration(
|
|
|
156
156
|
16 * 1024,
|
|
157
157
|
256 * 1024,
|
|
158
158
|
);
|
|
159
|
+
const PARENT_CODE_VISIBLE_OUTPUT_LIMIT = configuredDuration(
|
|
160
|
+
"UES_PARENT_CODE_VISIBLE_OUTPUT_LIMIT",
|
|
161
|
+
16 * 1024,
|
|
162
|
+
8 * 1024,
|
|
163
|
+
64 * 1024,
|
|
164
|
+
);
|
|
159
165
|
|
|
160
166
|
function configuredCount(name: string, fallback: number, min: number, max: number) {
|
|
161
167
|
const parsed = Number(process.env[name] || "");
|
|
@@ -3546,10 +3552,17 @@ export default function (pi: ExtensionAPI) {
|
|
|
3546
3552
|
language: Type.Optional(Type.String()),
|
|
3547
3553
|
startLine: Type.Optional(Type.Number({ minimum: 1 })),
|
|
3548
3554
|
endLine: Type.Optional(Type.Number({ minimum: 1 })),
|
|
3549
|
-
line: Type.Optional(Type.Number({
|
|
3550
|
-
|
|
3555
|
+
line: Type.Optional(Type.Number({
|
|
3556
|
+
minimum: 1,
|
|
3557
|
+
description: "1-based source line. UES converts it to the LSP protocol's 0-based line internally.",
|
|
3558
|
+
})),
|
|
3559
|
+
character: Type.Optional(Type.Number({
|
|
3560
|
+
minimum: 1,
|
|
3561
|
+
description: "1-based source character/column. UES converts it to the LSP protocol's 0-based character internally.",
|
|
3562
|
+
})),
|
|
3551
3563
|
newName: Type.Optional(Type.String({ minLength: 1, maxLength: 512 })),
|
|
3552
3564
|
includeDeclaration: Type.Optional(Type.Boolean()),
|
|
3565
|
+
includeSessions: Type.Optional(Type.Boolean()),
|
|
3553
3566
|
ref: Type.Optional(Type.String()),
|
|
3554
3567
|
maxBytes: Type.Optional(Type.Number({ minimum: 1, maximum: 128000 })),
|
|
3555
3568
|
}),
|
|
@@ -3566,7 +3579,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
3566
3579
|
lsp: {
|
|
3567
3580
|
...result.lsp,
|
|
3568
3581
|
persistentPool: {
|
|
3569
|
-
...lspPoolStatus({ includeSessions:
|
|
3582
|
+
...lspPoolStatus({ includeSessions: params.includeSessions === true, persistent: true }),
|
|
3570
3583
|
policy: { enabled: true, source: "parent-lite" },
|
|
3571
3584
|
},
|
|
3572
3585
|
},
|
|
@@ -3585,12 +3598,33 @@ export default function (pi: ExtensionAPI) {
|
|
|
3585
3598
|
const startLine = Math.max(1, Math.trunc(Number(params.startLine || 1)));
|
|
3586
3599
|
const endLine = Math.max(startLine, Math.min(startLine + 399, Math.trunc(Number(params.endLine || startLine + 199))));
|
|
3587
3600
|
const read = await readAnchoredCode(ctx.cwd, params.file, { startLine, endLine });
|
|
3601
|
+
const rawRead = [
|
|
3602
|
+
`file: ${read.file}; lines: ${read.startLine}-${read.endLine}/${read.lineCount}; sourceHash: ${read.sourceHash}`,
|
|
3603
|
+
"",
|
|
3604
|
+
read.text,
|
|
3605
|
+
].join("\n");
|
|
3606
|
+
const originalChars = rawRead.length;
|
|
3607
|
+
const bounded = originalChars > PARENT_CODE_VISIBLE_OUTPUT_LIMIT;
|
|
3608
|
+
const exactRead = [
|
|
3609
|
+
`file: ${read.file}; lines: ${read.startLine}-${read.endLine}/${read.lineCount}; sourceHash: ${read.sourceHash}; originalChars: ${originalChars}; bounded: ${bounded}`,
|
|
3610
|
+
"",
|
|
3611
|
+
read.text,
|
|
3612
|
+
].join("\n");
|
|
3613
|
+
let contextRef: string | null = null;
|
|
3614
|
+
let visibleRead = exactRead;
|
|
3615
|
+
if (bounded) {
|
|
3616
|
+
const preserved = await compactContext(ctx.cwd, exactRead, {
|
|
3617
|
+
kind: "ues-code-read",
|
|
3618
|
+
source: `ues_code:read:${read.file}`,
|
|
3619
|
+
summary: `Exact anchored parent-lite read for ${read.file}`,
|
|
3620
|
+
}).catch(() => null);
|
|
3621
|
+
contextRef = preserved?.ref || null;
|
|
3622
|
+
const previewChars = Math.max(2_000, PARENT_CODE_VISIBLE_OUTPUT_LIMIT - 1_200);
|
|
3623
|
+
visibleRead = exactRead.slice(0, previewChars) +
|
|
3624
|
+
`\n...[anchored read bounded; exact content preserved${contextRef ? `; contextRef=${contextRef}` : ""}]`;
|
|
3625
|
+
}
|
|
3588
3626
|
return {
|
|
3589
|
-
content: [{ type: "text", text:
|
|
3590
|
-
`file: ${read.file}; lines: ${read.startLine}-${read.endLine}/${read.lineCount}; sourceHash: ${read.sourceHash}`,
|
|
3591
|
-
"",
|
|
3592
|
-
read.text,
|
|
3593
|
-
].join("\n") }],
|
|
3627
|
+
content: [{ type: "text", text: visibleRead }],
|
|
3594
3628
|
details: {
|
|
3595
3629
|
action: params.action,
|
|
3596
3630
|
mode: "parent-lite",
|
|
@@ -3600,6 +3634,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
3600
3634
|
sourceHash: read.sourceHash,
|
|
3601
3635
|
startLine: read.startLine,
|
|
3602
3636
|
endLine: read.endLine,
|
|
3637
|
+
bounded,
|
|
3638
|
+
originalChars,
|
|
3639
|
+
contextRef,
|
|
3603
3640
|
},
|
|
3604
3641
|
};
|
|
3605
3642
|
} else if (params.action === "diagnostics") {
|
|
@@ -3673,14 +3710,62 @@ export default function (pi: ExtensionAPI) {
|
|
|
3673
3710
|
childSpawned: false,
|
|
3674
3711
|
};
|
|
3675
3712
|
const encoded = JSON.stringify(payload, null, 2);
|
|
3713
|
+
const bounded = encoded.length > PARENT_CODE_VISIBLE_OUTPUT_LIMIT;
|
|
3714
|
+
let contextRef: string | null = null;
|
|
3715
|
+
let visible = encoded;
|
|
3716
|
+
if (bounded) {
|
|
3717
|
+
const preserved = await compactContext(ctx.cwd, encoded, {
|
|
3718
|
+
kind: "ues-code-result",
|
|
3719
|
+
source: `ues_code:${params.action}`,
|
|
3720
|
+
summary: `Full parent-lite result for ${params.action}; preserve exact JSON before model-visible bounding`,
|
|
3721
|
+
}).catch(() => null);
|
|
3722
|
+
contextRef = preserved?.ref || null;
|
|
3723
|
+
const pool = payload?.pool || payload?.lsp?.persistentPool || null;
|
|
3724
|
+
const poolSummary = pool && typeof pool === "object"
|
|
3725
|
+
? {
|
|
3726
|
+
enabled: pool.enabled ?? null,
|
|
3727
|
+
active: pool.active ?? null,
|
|
3728
|
+
busy: pool.busy ?? null,
|
|
3729
|
+
limits: pool.limits || null,
|
|
3730
|
+
metrics: pool.metrics || null,
|
|
3731
|
+
sessionCount: Array.isArray(pool.sessions) ? pool.sessions.length : null,
|
|
3732
|
+
}
|
|
3733
|
+
: null;
|
|
3734
|
+
const previewChars = Math.max(2_000, PARENT_CODE_VISIBLE_OUTPUT_LIMIT - 6_000);
|
|
3735
|
+
const metadataFirst = {
|
|
3736
|
+
schemaVersion: payload?.schemaVersion || 1,
|
|
3737
|
+
action: params.action,
|
|
3738
|
+
file: payload?.file || null,
|
|
3739
|
+
available: payload?.available ?? null,
|
|
3740
|
+
provider: payload?.provider || null,
|
|
3741
|
+
operation: payload?.operation || null,
|
|
3742
|
+
reason: payload?.reason || null,
|
|
3743
|
+
persistent: payload?.persistent ?? null,
|
|
3744
|
+
pool: poolSummary,
|
|
3745
|
+
mode: "parent-lite",
|
|
3746
|
+
controllerStarted: false,
|
|
3747
|
+
childSpawned: false,
|
|
3748
|
+
bounded: true,
|
|
3749
|
+
originalChars: encoded.length,
|
|
3750
|
+
contextRef,
|
|
3751
|
+
preview: encoded.slice(0, previewChars),
|
|
3752
|
+
};
|
|
3753
|
+
visible = JSON.stringify(metadataFirst, null, 2) +
|
|
3754
|
+
"\n...[full result preserved; use ues_code context-expand with contextRef when more evidence is needed]";
|
|
3755
|
+
}
|
|
3676
3756
|
return {
|
|
3677
|
-
content: [{ type: "text", text:
|
|
3757
|
+
content: [{ type: "text", text: visible }],
|
|
3678
3758
|
details: {
|
|
3679
3759
|
action: params.action,
|
|
3680
3760
|
mode: "parent-lite",
|
|
3681
3761
|
controllerStarted: false,
|
|
3682
3762
|
childSpawned: false,
|
|
3683
|
-
bounded
|
|
3763
|
+
bounded,
|
|
3764
|
+
originalChars: encoded.length,
|
|
3765
|
+
contextRef,
|
|
3766
|
+
provider: payload?.provider || null,
|
|
3767
|
+
persistent: payload?.persistent ?? null,
|
|
3768
|
+
pool: payload?.pool || payload?.lsp?.persistentPool || null,
|
|
3684
3769
|
},
|
|
3685
3770
|
};
|
|
3686
3771
|
} catch (error) {
|
|
@@ -14,6 +14,17 @@ const CONTRACTS = [
|
|
|
14
14
|
"ues_code",
|
|
15
15
|
"UES Code Intelligence Lite",
|
|
16
16
|
"parent-lite",
|
|
17
|
+
"ues-code-result",
|
|
18
|
+
"ues-code-read",
|
|
19
|
+
"PARENT_CODE_VISIBLE_OUTPUT_LIMIT",
|
|
20
|
+
"originalChars: ${originalChars}",
|
|
21
|
+
"bounded: ${bounded}",
|
|
22
|
+
"UES_PARENT_CODE_VISIBLE_OUTPUT_LIMIT",
|
|
23
|
+
"anchored read bounded; exact content preserved",
|
|
24
|
+
"full result preserved; use ues_code context-expand with contextRef",
|
|
25
|
+
"includeSessions",
|
|
26
|
+
"1-based source line",
|
|
27
|
+
"1-based source character/column",
|
|
17
28
|
"controllerStarted",
|
|
18
29
|
"childSpawned",
|
|
19
30
|
"shutdownLspPool",
|
|
@@ -126,7 +137,7 @@ const CONTRACTS = [
|
|
|
126
137
|
file: "pi/extensions/ues-child-runtime.ts",
|
|
127
138
|
minBytes: 6_000,
|
|
128
139
|
startsWith: 'import type { ExtensionAPI }',
|
|
129
|
-
required: [
|
|
140
|
+
required: ["full result preserved; use ues_code context-expand with contextRef", "ues-code-result",
|
|
130
141
|
'pi.on("tool_call"',
|
|
131
142
|
'pi.on("tool_result"',
|
|
132
143
|
'name: "ues_evidence_get"',
|
|
@@ -179,7 +190,7 @@ const CONTRACTS = [
|
|
|
179
190
|
file: "lib/task-engine.mjs",
|
|
180
191
|
minBytes: 45_000,
|
|
181
192
|
startsWith: "import ",
|
|
182
|
-
required: ["workspaceFingerprint", "initWork", "finalizeWork"],
|
|
193
|
+
required: ["workspaceFingerprint", "initWork", "finalizeWork", "UES_RUNTIME_DIRS", "sourceGitPathspecs", "Fast common path: resolve worktree identity and HEAD in one Git process"],
|
|
183
194
|
},
|
|
184
195
|
{
|
|
185
196
|
file: "lib/model-performance.mjs",
|
|
@@ -312,6 +323,9 @@ const CONTRACTS = [
|
|
|
312
323
|
startsWith: "import ",
|
|
313
324
|
required: [
|
|
314
325
|
"class RpcWorker",
|
|
326
|
+
"reservations",
|
|
327
|
+
"this.reserve(key)",
|
|
328
|
+
"reservedWorkers",
|
|
315
329
|
"steerActive",
|
|
316
330
|
"abortActive",
|
|
317
331
|
"abortTransport",
|
|
@@ -355,12 +369,14 @@ const CONTRACTS = [
|
|
|
355
369
|
startsWith: "import ",
|
|
356
370
|
required: [
|
|
357
371
|
"runtimeWorkspaceFingerprint",
|
|
372
|
+
"Fast common path",
|
|
373
|
+
'["rev-parse", "--is-inside-work-tree", "HEAD"]',
|
|
358
374
|
"runtimeWorkspaceSnapshot",
|
|
359
375
|
"changedFiles",
|
|
360
376
|
"cacheable",
|
|
361
377
|
"untrackedContentDigest",
|
|
362
378
|
"untracked-total-too-large",
|
|
363
|
-
"
|
|
379
|
+
"sourceGitPathspecs",
|
|
364
380
|
"runtime-artifacts.mjs",
|
|
365
381
|
],
|
|
366
382
|
},
|
|
@@ -415,20 +431,23 @@ const CONTRACTS = [
|
|
|
415
431
|
file: "lib/code-intelligence/index.mjs",
|
|
416
432
|
minBytes: 4_000,
|
|
417
433
|
startsWith: "import ",
|
|
418
|
-
required: ["readAnchoredCode", "applyAnchoredFileEdits", "searchCodeIntelligence", "diagnoseCode"],
|
|
434
|
+
required: ["runtimeCacheHit", "runtimeWorkspaceSnapshot", "buildSemanticIndexCached", "readAnchoredCode", "applyAnchoredFileEdits", "searchCodeIntelligence", "diagnoseCode", "runSupervisedProcess", "resolveWindowsCommand", "hardTimeoutMs: 20_000", "idleTimeoutMs: 10_000"],
|
|
435
|
+
forbidden: ["spawnSync"],
|
|
419
436
|
},
|
|
420
437
|
{
|
|
421
438
|
file: "lib/code-intelligence/lsp-provider.mjs",
|
|
422
439
|
minBytes: 5_000,
|
|
423
440
|
startsWith: "import ",
|
|
424
|
-
required: ["diagnoseCode", "lspProviderStatus", "lspPersistencePolicy", "short-lived-default", "pi-child-runtime", "publishDiagnostics", "withManagedLspSession", "fallbackFrom", "shutdownLspPool", "resolveTypeScriptTsserverFallback", "UES_TYPESCRIPT_TSSERVER_PATH", "initializationOptions", "fallbackPath", "resolveWindowsCommand"],
|
|
441
|
+
required: ["diagnoseCode", "lspProviderStatus", "lspPersistencePolicy", "short-lived-default", "pi-child-runtime", "publishDiagnostics", "withManagedLspSession", "fallbackFrom", "shutdownLspPool", "resolveTypeScriptTsserverFallback", "clearTypeScriptTsserverFallbackCache", "UES_LSP_PROVIDER_PROBE_TTL_MS", "UES_TYPESCRIPT_TSSERVER_PATH", "initializationOptions", "fallbackPath", "resolveWindowsCommand"],
|
|
425
442
|
},
|
|
426
443
|
{
|
|
427
444
|
file: "lib/code-intelligence/lsp-pool.mjs",
|
|
428
445
|
minBytes: 12_000,
|
|
429
446
|
startsWith: "import ",
|
|
430
|
-
required: [
|
|
447
|
+
required: ["averageTotalLatencyMs", "averageAcquisitionLatencyMs", "totalDurationMs", "acquisitionDurationMs",
|
|
431
448
|
"withManagedLspSession",
|
|
449
|
+
'this.request("shutdown"',
|
|
450
|
+
"closedNaturally",
|
|
432
451
|
"shutdownLspPool",
|
|
433
452
|
"lspPoolStatus",
|
|
434
453
|
"pool-capacity-busy",
|
|
@@ -439,8 +458,17 @@ const CONTRACTS = [
|
|
|
439
458
|
"UES_LSP_IDLE_TTL_MS",
|
|
440
459
|
"resolveWindowsCommand",
|
|
441
460
|
"managed-lsp-request-rejected",
|
|
461
|
+
"STARTUPS",
|
|
462
|
+
"startupJoins",
|
|
463
|
+
"withPoolMutation",
|
|
464
|
+
"capacitySessionsForWorkspace",
|
|
442
465
|
"initializationOptions",
|
|
443
466
|
"JSON.stringify(provider?.initializationOptions || null)",
|
|
467
|
+
"Promise.all(candidates.map",
|
|
468
|
+
"Promise.all(found.map",
|
|
469
|
+
"sessionCount",
|
|
470
|
+
"sessionsIncluded",
|
|
471
|
+
"Config discovery is on every managed-LSP acquisition",
|
|
444
472
|
],
|
|
445
473
|
forbidden: ["\\nimport { resolveWindowsCommand }"],
|
|
446
474
|
},
|
|
@@ -724,11 +752,36 @@ const CONTRACTS = [
|
|
|
724
752
|
"UES_EVAL_DIRECT_TELEMETRY",
|
|
725
753
|
],
|
|
726
754
|
},
|
|
755
|
+
{
|
|
756
|
+
file: "lib/semantic-index.mjs",
|
|
757
|
+
minBytes: 10_000,
|
|
758
|
+
startsWith: "import ",
|
|
759
|
+
required: [
|
|
760
|
+
"UES_RUNTIME_DIRS",
|
|
761
|
+
"runtime-artifacts.mjs",
|
|
762
|
+
"...UES_RUNTIME_DIRS",
|
|
763
|
+
"buildSemanticIndexCached",
|
|
764
|
+
"RUNTIME_SEMANTIC_INFLIGHT",
|
|
765
|
+
],
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
file: "lib/context-manifest.mjs",
|
|
769
|
+
minBytes: 12_000,
|
|
770
|
+
startsWith: "import ",
|
|
771
|
+
required: [
|
|
772
|
+
"contextQuality",
|
|
773
|
+
"degradedComponents",
|
|
774
|
+
"semantic-snapshot",
|
|
775
|
+
"semantic-query",
|
|
776
|
+
"repo-graph",
|
|
777
|
+
"boundedFailure",
|
|
778
|
+
],
|
|
779
|
+
},
|
|
727
780
|
{
|
|
728
781
|
file: "lib/affected-tests.mjs",
|
|
729
782
|
minBytes: 7_500,
|
|
730
783
|
startsWith: "import ",
|
|
731
|
-
required: ["resolveAffectedTests", "clearAffectedTestCache", "AFFECTED_TEST_CACHE.set", "return result"],
|
|
784
|
+
required: ["UES_RUNTIME_DIRS", "isUesRuntimeArtifactPath", "runtime-artifacts.mjs", "resolveAffectedTests", "clearAffectedTestCache", "AFFECTED_TEST_CACHE.set", "return result"],
|
|
732
785
|
},
|
|
733
786
|
]
|
|
734
787
|
|