Repository navigation
release(0.6.0): a8n-attached session lane + attach-only 境界 + Windows 実機経路修正 #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0410ecf
feat(session): a8n-attached read-only session for running AE (#366)
rebuildup b658717
feat(session): op-scoped mutation grants for a8n-attached (#366)
rebuildup 19a8392
Merge pull request #367 from ido-bata/366
rebuildup dba9b86
fix(session): import a8n openers via file URL for Windows (#368)
rebuildup cc34402
Merge pull request #369 from ido-bata/368
rebuildup 9386890
feat(session): attach pre-flight census + open-project pin (#366)
rebuildup 9e9f5d4
fix(session): read open project via awaited Project handle (#366)
rebuildup 214e8e7
docs(evidence): #366 attach pre-flight + comp/layer loop on real AE 2027
rebuildup 8a20e75
test(mcp): real-run passthrough for attached pins + mutation scope; r…
rebuildup f6663d7
release: prepare 0.6.0 version and package spec (#371)
rebuildup cc578ba
feat(a8n-attached): plumb call/deadline timeout flags; relocate cli r…
rebuildup 77dcdcd
fix(a8n-attached): refuse UNVERIFIED/foreign-only census instead of c…
rebuildup a496e9c
docs(evidence): record Windows attach pre-flight findings (#366)
rebuildup 3da50ac
fix(release): sync release-scope to 0.6.0 (#371)
rebuildup 3f960bd
Merge pull request #370 from ido-bata/366
rebuildup d6db1c7
Merge pull request #372 from ido-bata/371
rebuildup ad32a1d
feat(a8n-attached): attach-only opener boundary + target re-validatio…
rebuildup 7ebda7b
docs(evidence): attached re-validation + comp/layer recovery loop on …
rebuildup 2660089
feat(a8n-attached): forward census pid as attach target pin; verify A…
rebuildup d3d69e4
test: record real-host evidence for a8n attach API and jsx dev-loop s…
rebuildup adf0df4
test: record attach-API real run, jsx slice evidence, VSCode attempt …
rebuildup 7e508a8
test: verify attached lane against packed ae-a8n 0.5.0 tarball (#366)
rebuildup a4af498
Merge pull request #373 from ido-bata/366
rebuildup bdcf998
feat(a8n-attached): remove transitional launch fallback — attach-only…
rebuildup fdb7fde
Merge pull request #375 from ido-bata/374
rebuildup a4af44b
feat(dev-loop): expose version-aware host/api metadata in sessionStat…
rebuildup 3a94fb7
Merge pull request #376 from ido-bata/20
rebuildup 17db226
fix(real-run-kit): make aeProcessSnapshot work on Windows
rebuildup 3afc182
docs(evidence): record Windows real-run attempts and owned-slice anom…
rebuildup 8952266
Merge pull request #378 from ido-bata/377
rebuildup 987a032
test(catalog): real-host conformance evidence refresh for v0.6.0 RC (…
rebuildup 4496ab1
Merge pull request #381 from ido-bata/380
rebuildup 14cf3c7
fix(a8n-attached): harden target re-validation guard + path identity …
rebuildup 1a30b5b
fix(cli,mcp): refuse valueless target-pin flags + consistent dispatch…
rebuildup 4f9321e
test(conformance): exactly-one-send timeout probe + MCP shutdown exit…
rebuildup 3e79a84
Merge pull request #386 from ido-bata/382
rebuildup c2b53bc
Merge pull request #387 from ido-bata/383
rebuildup 4fc672a
Merge pull request #388 from ido-bata/384
rebuildup 5127ecc
feat(a8n-attached): host-side project identity guard inside consent-b…
rebuildup 2aef8cb
Merge pull request #389 from ido-bata/385
rebuildup 2036ea1
fix(a8n-attached): bigint file-identity stats + project attestation a…
rebuildup cfe2664
fix(mcp-server): propagate session close failure into shutdown exit s…
rebuildup 125c9df
Merge pull request #392 from ido-bata/390
rebuildup 417c77f
Merge pull request #393 from ido-bata/391
rebuildup 74f1802
test(catalog): real-host conformance evidence refresh for v0.6.0 RC (…
rebuildup 6076e5b
Merge pull request #394 from ido-bata/380
rebuildup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
packages/ae-devtools-cli/a8n-transport/attach-target.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| /** | ||
| * attach-target.mjs — the attach-only session opener boundary (Issue | ||
| * #366, hardened under #374). | ||
| * | ||
| * `a8n-attached` must NEVER be able to spawn a new After Effects process: | ||
| * the whole point of the mode is operating on the instance the USER | ||
| * already has open. ae-a8n's `AfterEffects.launch` does not honour that — | ||
| * when its attach attempt fails (busy/modal host, census race) it falls | ||
| * back to cold-starting a second AE, which is exactly the failure mode | ||
| * observed on Windows (ae-a8n #99, ae-devtools #366 Windows pre-flight | ||
| * findings). | ||
| * | ||
| * This module is the single seam where the attached lane obtains a | ||
| * session, and it is attach-ONLY: | ||
| * | ||
| * `AfterEffects.attach(options)` — the attach-only API ae-a8n ships | ||
| * for this contract (ae-a8n #269 / PR #270, released in the 0.5.0 | ||
| * train — never launches; refuses when no attachable instance | ||
| * exists). The option/return shape mirrors `launch`: | ||
| * `{ installDir?, hostScript, sessionRoot, authorization, | ||
| * target?: { pid } }` in, an AfterEffects session out. When the | ||
| * pre-flight census identified exactly one process, its pid is | ||
| * forwarded as `target.pid` so ae-a8n binds the SAME process — | ||
| * a pid that no longer names an in-scope AE is refused upstream. | ||
| * | ||
| * There is NO fallback: an ae-a8n build without `attach` cannot serve | ||
| * the attached lane at all, so this boundary refuses with | ||
| * ATTACHED_TARGET_UNSUPPORTED instead of calling `launch`. The pinned | ||
| * dependency must therefore carry ae-a8n >= 0.5.0 before the attached | ||
| * lane is usable from the registry package (dep flip tracked at | ||
| * release time — see Issue #374). | ||
| * | ||
| * Detection is deliberately explicit — no option-name guessing. If | ||
| * ae-a8n ships the capability under a different export, this module is | ||
| * the one place that changes. | ||
| */ | ||
|
|
||
| /** True when the resolved ae-a8n module exposes the attach-only API. */ | ||
| export function hasAttachApi(AfterEffects) { | ||
| return ( | ||
| AfterEffects !== null && | ||
| typeof AfterEffects === "function" && | ||
| typeof AfterEffects.attach === "function" | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Open a session against an already-running After Effects. | ||
| * | ||
| * @param {object} deps | ||
| * AfterEffects — ae-a8n AfterEffects class (or fixture) | ||
| * installDir — optional install pin forwarded to ae-a8n | ||
| * hostScriptPath — built extension host script | ||
| * sessionRoot — ae-a8n session root dir | ||
| * authorization — ae-a8n launch authorization grant | ||
| * targetPid — optional pid pin forwarded as `target.pid` (the | ||
| * census-identified process) | ||
| * @returns {Promise<object>} the ae-a8n session (AfterEffects instance) | ||
| * @throws {Error} code ATTACHED_TARGET_UNSUPPORTED when the resolved | ||
| * ae-a8n does not export `AfterEffects.attach` — the attached | ||
| * lane has no spawn-capable fallback by contract (Issue #374). | ||
| * Whatever ae-a8n's attach throws propagates unchanged. | ||
| * | ||
| * Platform boundary: ae-a8n's attach on Windows refuses the default | ||
| * script transport (every script delivery there spawns `AfterFX.exe | ||
| * -r`); attach requires the `in-ae-dispatcher` transport or another | ||
| * attach-capable selection, which this opener does not supply. On | ||
| * win32 `AfterEffects.attach` therefore surfaces ae-a8n's typed | ||
| * refusal — fail-closed, nothing is launched (Issue #382). Windows | ||
| * attach remains UNVERIFIED on this path (#224). | ||
| */ | ||
| export async function openAttachTarget({ AfterEffects, installDir, hostScriptPath, sessionRoot, authorization, targetPid }) { | ||
| if (!hasAttachApi(AfterEffects)) { | ||
| const e = new Error( | ||
| "ae-a8n does not export AfterEffects.attach — the a8n-attached lane " + | ||
| "is attach-only and has no launch fallback (Issue #374). Pin " + | ||
| "@ido-bata/ae-a8n >= 0.5.0 or point aeA8nRoot at an ae-a8n build " + | ||
| "that carries the attach API (ae-a8n #269).", | ||
| ); | ||
| e.code = "ATTACHED_TARGET_UNSUPPORTED"; | ||
| throw e; | ||
| } | ||
| const options = { | ||
| ...(typeof installDir === "string" && installDir.length > 0 ? { installDir } : {}), | ||
| hostScript: hostScriptPath, | ||
| sessionRoot, | ||
| authorization, | ||
| }; | ||
| // Attach-only: ae-a8n refuses rather than spawn when no running, | ||
| // attachable instance exists. There is no fallback from here. | ||
| if (Number.isInteger(targetPid) && targetPid > 0) { | ||
| options.target = { pid: targetPid }; | ||
| } | ||
| const ae = await AfterEffects.attach(options); | ||
| // Provenance marker for evidence: which opener actually ran. | ||
| try { ae.attachApi = "AfterEffects.attach"; } catch { /* frozen session */ } | ||
| return ae; | ||
| } | ||
|
|
||
| export const ATTACH_TARGET_DOC = | ||
| "attach-only boundary: AfterEffects.attach only; no launch fallback (Issues #366, #374)"; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.