Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-agent-session

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Inspect live scenes and frames with devtools; read runtime diagnostics. Use for scoped session writes, pixel probes or duplicate requestId INVALID_ARGUMENT errors.

  • 9 files
  • 34.7 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-agent-session

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescontext.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Working context

Use package imports and shipped docs for an application; use source paths and repository commands only in a confirmed AIR checkout. A copied host skill is not a runtime installation.

Read the shared environment rules when locating these roots. If sibling resources are unavailable, use the installed canonical chapter and disclose the limitation. Tool declarations identify workflow capabilities; they do not authorize installation, writes, publication or any action outside the user and host scope.

Related skills

  • cocosair - routing and shared Code First constraints; reuse it if already loaded.
  • cocosair-application - createAirApp/AirApp and the app lifecycle a session binds to.
  • cocosair-scene-graph - the Scene/Node/Component tree that inspectScene and inspectNode snapshot.
  • cocosair-rendering - cameras, renderers and the drawn frame captureFrame samples on AFTER_DRAW.
  • cocosair-verification - the browser probes and evidence conventions the pixel regions align with.
  • cocosair-performance - the step clock and frame pacing the session's capture waits ride on.

Original entry guidance

The original entry wording below is an on-demand archive, not a second routing source.

Use the environment rules to locate the checkout or installed package; sibling skills are optional direct dependencies, not a recursive load list.

Drive and observe a running Cocos AIR app through two distinct faces: the runtime face (the window.__airApp binding the app sets itself plus the bounded AirDiagnostics channel on the main entry) and the devtools face (the tools/debug/** session protocol, scene/node snapshots, frame capture, error ring buffer, and pixel probes). The devtools face is NOT part of the default runtime bundle and is not importable from cocosair; keep it out of shipped app code.

Read references/quick-start.md when constructing the minimal example. It preserves the complete setup and teardown sequence; select the source-checkout or npm-consumer environment first.

Read references/context.md to select the owner of this step and only its directly needed dependencies. Reuse already loaded skills; this is not a recursive load list.

Original mistake navigation

Before implementing the relevant path, read its wrong/right examples in references/common-mistakes.md:

  • [HIGH] Blindly retrying a write with the same requestId
  • [HIGH] Treating the devtools session as a default-runtime API in app code
  • [MEDIUM] Confusing the runtime diagnostics channel with the devtools error ring buffer
  • [MEDIUM] Reading raw canvas pixels with a screenshot-style origin

Original metadata

Description and description_en

The two original fields contained exactly the same value, retained once here.

Drives and inspects a running Cocos AIR app from an agent or devtool session. Covers the window.__airApp page binding, the devtools agent-session request protocol in tools/debug/agent-session.ts (requestId/action/targetId/params returning requestId ok result or error, the INVALID_ARGUMENT duplicate-requestId rejection, inspectScene and inspectNode snapshots, captureFrame on AFTER_DRAW, getRuntimeErrors ring buffer), the visual probe pixel-region conventions, and the runtime AirDiagnostics bounded channel. Use when an agent needs to observe a live scene, apply a controlled write, capture a frame, read runtime errors, or wire the dev-only session, remembering the session and probe surface are devtools not default-runtime APIs.

Keywords

Cocos AIR, cocosair.js, agent, session

References

  • agent-session.md - the devtools request protocol, error codes, duplicate-requestId rejection, retention window and FIFO cap, and the createAgentSession/writableScenes attach contract.
  • runtime-control.md - the window.__airApp binding, scene/node snapshot shapes, ID stability, STALE_TARGET semantics and the runtime AirDiagnostics bounded channel versus the devtools error ring buffer.
  • visual-probes.md - captureFrame on AFTER_DRAW, the frame-diff discipline and the pixel-region origin/lit conventions in tools/debug/pixel-regions.mjs.

Canonical docs

  • docs/guides/agent-development.md - the agent-facing session model, read-only default, and explicit writable scope.
  • docs/guides/runtime-inspection.md - scene/node inspection snapshots and the devtools-only nature of the session surface.
  • docs/guides/visual-probe-contracts.md - capture timing and pixel-region contracts.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "inspect the running scene or node",
  "apply a scoped change through an agent session",
  "capture a frame after drawing",
  "read runtime errors and diagnostics",
  "duplicate requestId is rejected"
]
owns
[
  "agent-session",
  "scene-inspection",
  "scoped-writes",
  "frame-capture",
  "pixel-probes",
  "runtime-diagnostics"
]
not_for
[
  "app startup or shutdown -> cocosair-application",
  "verification gates and release evidence -> cocosair-verification",
  "scene-tree implementation -> cocosair-scene-graph"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "使用开发工具观察运行时、按明确范围写入、捕获画面和读取诊断。用于实时应用检查或受控自动化,工具不属于默认运行时包。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-agent-session