@agent-native/core 0.49.18 → 0.49.20
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/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +1 -1
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts +5 -8
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +34 -16
- package/dist/cli/recap.js.map +1 -1
- package/dist/client/blocks/library/annotation-rail.js +5 -5
- package/dist/client/blocks/library/annotation-rail.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +16 -3
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/local-artifacts/index.d.ts +37 -0
- package/dist/local-artifacts/index.d.ts.map +1 -1
- package/dist/local-artifacts/index.js +380 -0
- package/dist/local-artifacts/index.js.map +1 -1
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +20 -6
- package/dist/resources/handlers.js.map +1 -1
- package/dist/resources/metadata.d.ts.map +1 -1
- package/dist/resources/metadata.js +5 -1
- package/dist/resources/metadata.js.map +1 -1
- package/dist/resources/store.d.ts +4 -0
- package/dist/resources/store.d.ts.map +1 -1
- package/dist/resources/store.js +143 -6
- package/dist/resources/store.js.map +1 -1
- package/dist/scripts/resources/delete.d.ts.map +1 -1
- package/dist/scripts/resources/delete.js +9 -3
- package/dist/scripts/resources/delete.js.map +1 -1
- package/dist/scripts/resources/write.d.ts.map +1 -1
- package/dist/scripts/resources/write.js +9 -3
- package/dist/scripts/resources/write.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +6 -5
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/recap.js
CHANGED
|
@@ -1572,6 +1572,7 @@ export function buildRecapPrompt(input) {
|
|
|
1572
1572
|
: ""}${prSourceUrl
|
|
1573
1573
|
? `, and also passing \`sourceUrl: "${prSourceUrl}"\` so the hosted recap page can link back to the PR`
|
|
1574
1574
|
: ""}.`);
|
|
1575
|
+
lines.push("If `create-visual-recap` returns validation feedback about empty or invalid wireframes, make one immediate correction pass in this same process: revise the named WireframeBlock/Artboard MDX so each frame has real visible product text/controls, then call `create-visual-recap` again. Do not write `recap-url.txt` until the tool succeeds.");
|
|
1575
1576
|
lines.push(`2. Write the plan URL to a file named \`recap-url.txt\` at the repo root, containing exactly one line: \`${appUrl}/recaps/<the returned plan id>\`. This file is the workflow's only hand-off — do not print anything else as the deliverable.`);
|
|
1576
1577
|
lines.push(`3. (Fallback only — skip if step 1 succeeded) If \`create-visual-recap\` does not accept a \`visibility\` parameter (older server), call the **set-resource-visibility** tool with \`{ resourceType: "plan", resourceId: <the returned plan id>, visibility: "org" }\` after publishing.`);
|
|
1577
1578
|
}
|
|
@@ -2256,21 +2257,30 @@ function recoverRecapFailureEnv(env = process.env) {
|
|
|
2256
2257
|
return recovered;
|
|
2257
2258
|
}
|
|
2258
2259
|
/**
|
|
2259
|
-
* Files that, if a PR touches them, would let that PR rewrite
|
|
2260
|
-
*
|
|
2261
|
-
* recap CLI from trusted base-branch source (or an installed package), so
|
|
2262
|
-
* package code such as `packages/core/**`
|
|
2263
|
-
* PR-modified CLI code.
|
|
2260
|
+
* Files that, if a PR touches them, would let that PR rewrite repo-pinned skill
|
|
2261
|
+
* instructions or agent config the trusted recap job loads. The workflow runs
|
|
2262
|
+
* the recap CLI from trusted base-branch source (or an installed package), so
|
|
2263
|
+
* normal package code such as `packages/core/**` and recap workflow YAML can be
|
|
2264
|
+
* recapped without executing PR-modified CLI code.
|
|
2264
2265
|
*/
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2266
|
+
function normalizeRecapSkillSourceMode(value) {
|
|
2267
|
+
return (value || "auto").toLowerCase();
|
|
2268
|
+
}
|
|
2269
|
+
function isRepoPinnedRecapSkillSource(value) {
|
|
2270
|
+
return normalizeRecapSkillSourceMode(value) === "repo";
|
|
2271
|
+
}
|
|
2272
|
+
export function isRecapSensitivePath(p, options = {}) {
|
|
2273
|
+
const skillSource = options.skillSource;
|
|
2274
|
+
if (/(^|\/)\.claude\//.test(p) ||
|
|
2269
2275
|
/(^|\/)CLAUDE\.md$/.test(p) ||
|
|
2270
2276
|
/(^|\/)AGENTS\.md$/.test(p) ||
|
|
2271
2277
|
/(^|\/)\.mcp\.json$/.test(p)) {
|
|
2272
2278
|
return true;
|
|
2273
2279
|
}
|
|
2280
|
+
if (isRepoPinnedRecapSkillSource(skillSource) &&
|
|
2281
|
+
/(^|\/)skills\/visual-(recap|plan|plans)\//.test(p)) {
|
|
2282
|
+
return true;
|
|
2283
|
+
}
|
|
2274
2284
|
return false;
|
|
2275
2285
|
}
|
|
2276
2286
|
/**
|
|
@@ -2330,12 +2340,19 @@ export function evaluateRecapGate(input) {
|
|
|
2330
2340
|
if (model && !/^[a-zA-Z0-9._-]{1,80}$/.test(model)) {
|
|
2331
2341
|
reasons.push("invalid VISUAL_RECAP_MODEL value (must match [a-zA-Z0-9._-]{1,80})");
|
|
2332
2342
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
//
|
|
2338
|
-
|
|
2343
|
+
const skillSource = normalizeRecapSkillSourceMode(input.skillSource);
|
|
2344
|
+
if (skillSource && !["auto", "latest", "repo"].includes(skillSource)) {
|
|
2345
|
+
reasons.push('invalid VISUAL_RECAP_SKILL_SOURCE value (expected "auto", "latest", or "repo")');
|
|
2346
|
+
}
|
|
2347
|
+
// Self-modifying guard: if this PR changes the visual-recap/visual-plan skill
|
|
2348
|
+
// when CI is explicitly pinned to repo-local skill instructions, or any agent
|
|
2349
|
+
// config the runner would load (.claude/**, CLAUDE.md, AGENTS.md, .mcp.json),
|
|
2350
|
+
// skip the ENTIRE job — not just the agent — so a PR can never rewrite what
|
|
2351
|
+
// the agent loads (skill, hooks, settings) and exfiltrate the publish/API
|
|
2352
|
+
// secrets. In the default auto/latest modes the recap prompt comes from the
|
|
2353
|
+
// trusted bundled skill, so visual skill and recap workflow files are ordinary
|
|
2354
|
+
// reviewed content and may be recapped.
|
|
2355
|
+
const hits = input.changedFiles.filter((p) => isRecapSensitivePath(p, { skillSource }));
|
|
2339
2356
|
if (hits.length) {
|
|
2340
2357
|
reasons.push(`PR modifies recap-control files (${hits.slice(0, 3).join(", ")}${hits.length > 3 ? ", …" : ""}) — skipping so untrusted PR code never runs with secrets`);
|
|
2341
2358
|
}
|
|
@@ -2428,6 +2445,7 @@ async function runGate() {
|
|
|
2428
2445
|
hasOpenai: process.env.HAS_OPENAI === "true",
|
|
2429
2446
|
agentRaw: process.env.AGENT,
|
|
2430
2447
|
model: process.env.VISUAL_RECAP_MODEL,
|
|
2448
|
+
skillSource: process.env.VISUAL_RECAP_SKILL_SOURCE,
|
|
2431
2449
|
changedFiles,
|
|
2432
2450
|
});
|
|
2433
2451
|
// If listing PR files failed, append the same fail-closed reason the inline
|
|
@@ -3022,7 +3040,7 @@ Usage:
|
|
|
3022
3040
|
VISUAL_RECAP_MODEL), the repo from $GITHUB_REPOSITORY, and the PR's changed
|
|
3023
3041
|
files from the GitHub REST API (paged, with GH_TOKEN/GITHUB_TOKEN). Skips
|
|
3024
3042
|
drafts, forks, bot authors, the missing-secret case, an invalid agent/model,
|
|
3025
|
-
and any PR that touches recap-control files (
|
|
3043
|
+
and any PR that touches recap-control files (repo-pinned skill instructions,
|
|
3026
3044
|
.claude/**, CLAUDE.md, AGENTS.md, .mcp.json) — failing CLOSED on any
|
|
3027
3045
|
file-list error. Writes run=<true|false> and agent=<claude|codex> to
|
|
3028
3046
|
$GITHUB_OUTPUT.
|