@rudderhq/agent-runtime-opencode-local 0.7.2 → 0.7.3

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.
Files changed (35) hide show
  1. package/package.json +2 -2
  2. package/skills/app-builder/SKILL.md +39 -9
  3. package/skills/app-builder/assets/scaffold/app/globals.css +109 -16
  4. package/skills/app-builder/assets/scaffold/components/contacts-workspace.tsx +176 -152
  5. package/skills/app-builder/assets/scaffold/components/ui/alert.tsx +12 -0
  6. package/skills/app-builder/assets/scaffold/components/ui/badge.tsx +27 -0
  7. package/skills/app-builder/assets/scaffold/components/ui/button.tsx +9 -7
  8. package/skills/app-builder/assets/scaffold/components/ui/card.tsx +15 -3
  9. package/skills/app-builder/assets/scaffold/components/ui/empty.tsx +18 -0
  10. package/skills/app-builder/assets/scaffold/components/ui/field.tsx +23 -0
  11. package/skills/app-builder/assets/scaffold/components/ui/input.tsx +1 -1
  12. package/skills/app-builder/assets/scaffold/components/ui/label.tsx +1 -1
  13. package/skills/app-builder/assets/scaffold/components/ui/separator.tsx +6 -0
  14. package/skills/app-builder/assets/scaffold/components/ui/skeleton.tsx +6 -0
  15. package/skills/app-builder/assets/scaffold/components/ui/table.tsx +30 -0
  16. package/skills/app-builder/assets/scaffold/components.json +20 -0
  17. package/skills/app-builder/assets/scaffold/next-env.d.ts +1 -1
  18. package/skills/app-builder/assets/scaffold/next.config.ts +19 -0
  19. package/skills/app-builder/assets/scaffold/package.json +2 -1
  20. package/skills/app-builder/assets/scaffold/rudder.app.json +1 -1
  21. package/skills/app-builder/assets/scaffold/rudder.ui.json +13 -0
  22. package/skills/app-builder/assets/scaffold/scripts/validate-rudder-ui.mjs +50 -0
  23. package/skills/app-builder/assets/scaffold/tests/e2e/app.spec.ts +35 -1
  24. package/skills/app-builder/evals/evals.json +2 -1
  25. package/skills/app-builder/references/design-guidelines.md +19 -2
  26. package/skills/app-builder/references/rudder-ui-preset.md +73 -0
  27. package/skills/app-builder/references/scaffold-contract.md +12 -0
  28. package/skills/app-builder/references/verification.md +6 -0
  29. package/skills/app-builder/scripts/report-build-status.mjs +83 -0
  30. package/skills/rudder-docs/SKILL.md +2 -2
  31. package/skills/rudder-docs/evals/retrieval-authority-evals.json +40 -0
  32. package/skills/rudder-docs/evals/trigger-evals.json +2 -2
  33. package/skills/rudder-docs/references/api-reference.md +0 -2
  34. package/skills/rudder-docs/references/plugin-authoring.md +38 -114
  35. package/skills/rudder-docs/references/source-map.md +2 -0
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+
3
+ const STATUS = process.argv[2];
4
+ const APP_ID = process.argv[3];
5
+ const ALLOWED_STATUSES = new Set(["building", "verified_source_ready", "failed"]);
6
+ const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
7
+
8
+ if (!ALLOWED_STATUSES.has(STATUS) || !UUID_PATTERN.test(APP_ID ?? "")) {
9
+ console.error("Usage: report-build-status.mjs <building|verified_source_ready|failed> <app-id>");
10
+ process.exit(2);
11
+ }
12
+
13
+ const apiUrl = process.env.RUDDER_API_URL?.trim();
14
+ const apiKey = process.env.RUDDER_API_KEY?.trim();
15
+ const orgId = process.env.RUDDER_ORG_ID?.trim();
16
+ const runId = process.env.RUDDER_RUN_ID?.trim();
17
+ if (!apiUrl || !apiKey || !orgId || !runId) {
18
+ console.error("Rudder run context is unavailable; do not report a completed App handoff.");
19
+ process.exit(2);
20
+ }
21
+
22
+ const base = apiUrl.replace(/\/+$/u, "");
23
+ const apiBase = new URL(base).pathname.replace(/\/+$/u, "").endsWith("/api")
24
+ ? base
25
+ : `${base}/api`;
26
+ const endpoint = `${apiBase}/app-builder/${encodeURIComponent(APP_ID)}/build?orgId=${encodeURIComponent(orgId)}`;
27
+ const headers = {
28
+ authorization: `Bearer ${apiKey}`,
29
+ "content-type": "application/json",
30
+ };
31
+ const currentResponse = await fetch(
32
+ `${apiBase}/orgs/${encodeURIComponent(orgId)}/app-builder`,
33
+ { headers },
34
+ );
35
+ if (!currentResponse.ok) {
36
+ console.error(`Rudder could not read the App handoff state (${currentResponse.status}).`);
37
+ process.exit(1);
38
+ }
39
+ const current = (await currentResponse.json()).find((app) => app.id === APP_ID);
40
+ if (!current) {
41
+ console.error("Rudder App handoff identity was not found in this organization.");
42
+ process.exit(1);
43
+ }
44
+ const duplicateRunId = STATUS === "verified_source_ready"
45
+ ? current.latestVerificationRunId
46
+ : current.latestBuildRunId;
47
+ if (current.buildStatus === STATUS && duplicateRunId === runId) {
48
+ console.log(`App Builder status: ${current.buildStatus}`);
49
+ process.exit(0);
50
+ }
51
+ const allowedCurrentStatuses = STATUS === "building"
52
+ ? new Set(["preparing", "ready", "launch_failed", "failed"])
53
+ : STATUS === "verified_source_ready"
54
+ ? new Set(["building"])
55
+ : new Set(["preparing", "building"]);
56
+ if (!allowedCurrentStatuses.has(current.buildStatus)) {
57
+ console.error(
58
+ `Rudder rejected the stale App handoff transition ${current.buildStatus} -> ${STATUS}.`,
59
+ );
60
+ process.exit(1);
61
+ }
62
+ const response = await fetch(
63
+ endpoint,
64
+ {
65
+ method: "PATCH",
66
+ headers,
67
+ body: JSON.stringify({
68
+ status: STATUS,
69
+ expectedStatus: current.buildStatus,
70
+ runId,
71
+ runKind: STATUS === "verified_source_ready" ? "verification" : "build",
72
+ }),
73
+ },
74
+ );
75
+
76
+ if (!response.ok) {
77
+ const detail = await response.text();
78
+ console.error(`Rudder rejected the App handoff (${response.status}): ${detail.slice(0, 500)}`);
79
+ process.exit(1);
80
+ }
81
+
82
+ const app = await response.json();
83
+ console.log(`App Builder status: ${app.buildStatus}`);
@@ -134,8 +134,8 @@ Read only the reference needed for the request:
134
134
  installed CLI fallback catalog plus exact command semantics.
135
135
  3. [Agent creation](references/agent-creation.md) — permission-aware Agent
136
136
  configuration, governed hiring, approval, revision, and evidence workflow.
137
- 4. [Plugin authoring](references/plugin-authoring.md) — current scaffold,
138
- manifest, worker, UI, capability, route, and verification workflow.
137
+ 4. [Plugin authoring](references/plugin-authoring.md) — Codex-compatible
138
+ package layout, manifest, Skills, MCPs, Apps, and verification workflow.
139
139
  5. [Work practices](references/operating-practices.md) — exact
140
140
  conditional behavior for ownership, reviews, approvals, budgets,
141
141
  workspaces, Library handoff, authentication, and safe git use.
@@ -258,5 +258,45 @@
258
258
  "expected_public_path": "https://docs.rudderhq.dev/zh/reference/permissions-and-platforms",
259
259
  "expected_anchor": "boundaries",
260
260
  "illustrative_case_sufficient": false
261
+ },
262
+ {
263
+ "query": "How does Rudder build, review, approve, and sign Windows Desktop releases?",
264
+ "locale": "en",
265
+ "query_mode": "current",
266
+ "expected_source_class": "official_public_docs_primary",
267
+ "required_contract_ids": [],
268
+ "expected_public_path": "https://docs.rudderhq.dev/reference/code-signing-policy",
269
+ "expected_anchor": null,
270
+ "illustrative_case_sufficient": false
271
+ },
272
+ {
273
+ "query": "Rudder 如何构建、审查、批准并签名 Windows Desktop 发布产物?",
274
+ "locale": "zh",
275
+ "query_mode": "current",
276
+ "expected_source_class": "official_public_docs_primary",
277
+ "required_contract_ids": [],
278
+ "expected_public_path": "https://docs.rudderhq.dev/zh/reference/code-signing-policy",
279
+ "expected_anchor": null,
280
+ "illustrative_case_sufficient": false
281
+ },
282
+ {
283
+ "query": "Which Rudder data stays local and which optional services process data?",
284
+ "locale": "en",
285
+ "query_mode": "current",
286
+ "expected_source_class": "official_public_docs_primary",
287
+ "required_contract_ids": ["ANALYTICS.TELEMETRY.001"],
288
+ "expected_public_path": "https://docs.rudderhq.dev/reference/privacy",
289
+ "expected_anchor": null,
290
+ "illustrative_case_sufficient": false
291
+ },
292
+ {
293
+ "query": "哪些 Rudder 数据保留在本地,哪些可选服务会处理数据?",
294
+ "locale": "zh",
295
+ "query_mode": "current",
296
+ "expected_source_class": "official_public_docs_primary",
297
+ "required_contract_ids": ["ANALYTICS.TELEMETRY.001"],
298
+ "expected_public_path": "https://docs.rudderhq.dev/zh/reference/privacy",
299
+ "expected_anchor": null,
300
+ "illustrative_case_sufficient": false
261
301
  }
262
302
  ]
@@ -20,11 +20,11 @@
20
20
  "should_trigger": true
21
21
  },
22
22
  {
23
- "query": "Scaffold a new Rudder Plugin named @acme/quality-gate in a temporary external package directory. Verify the current create-rudder-plugin and SDK workflow first, then run its typecheck, tests, and build.",
23
+ "query": "Create a Codex-compatible Rudder Plugin named quality-gate in a temporary directory with one Skill. Verify plugin.json and the current import boundary, then test the package.",
24
24
  "should_trigger": true
25
25
  },
26
26
  {
27
- "query": "Rudder Plugin 的 worker capabilitysame-origin UIroutePath 和 ctx.assets 现在到底有哪些边界?请查当前 authoring guide、SDK 和源码后回答。",
27
+ "query": "Rudder Plugin 的 Codex packageSkillsMCP、App、导入检查和运行权限现在有哪些边界?请查当前 authoring guide 和源码后回答。",
28
28
  "should_trigger": true
29
29
  },
30
30
  {
@@ -246,8 +246,6 @@ or editing that URL by hand.
246
246
 
247
247
  - `GET /api/approvals/:approvalId`
248
248
  - `GET /api/approvals/:approvalId/issues`
249
- - `GET /api/approvals/:approvalId/comments`
250
- - `POST /api/approvals/:approvalId/comments`
251
249
  - `POST /api/approvals/:approvalId/request-revision`
252
250
  - `POST /api/approvals/:approvalId/resubmit`
253
251
  - `POST /api/approvals/:approvalId/approve`
@@ -1,116 +1,40 @@
1
1
  # Plugin Authoring
2
2
 
3
- Use this workflow for a Rudder Plugin source question or an explicit request to
4
- scaffold, develop, or verify a Plugin. Reading authoring guidance is read-only.
5
- Only an explicit user request to scaffold or modify a package authorizes writes,
6
- and those writes must stay inside the requested repository or target directory.
7
-
8
- The current fact sources are
9
- `doc/engineering/PLUGIN_AUTHORING_GUIDE.md` and
10
- `packages/plugins/sdk/README.md`. Use
11
- `doc/engineering/PLUGIN_RUNTIME_CONTRACT.md` only to understand the implemented
12
- runtime boundary, and label future ideas as non-current.
13
-
14
- ## Section Map
15
-
16
- - [Confirm scope and package layout](#confirm-scope-and-package-layout)
17
- - [Scaffold from the current package](#scaffold-from-the-current-package)
18
- - [Implement within current boundaries](#implement-within-current-boundaries)
19
- - [Wire a bundled example only when requested](#wire-a-bundled-example-only-when-requested)
20
- - [Verify the package and host](#verify-the-package-and-host)
21
-
22
- ## Confirm Scope And Package Layout
23
-
24
- Before writing, determine whether the Plugin is:
25
-
26
- - a repository-local example under `packages/plugins/examples/`;
27
- - another Rudder monorepo package under `packages/plugins/`; or
28
- - an external npm package in an absolute target directory.
29
-
30
- Repository-local examples are a development workflow. For deployable Plugins,
31
- prefer an npm package installed from a public or private npm-compatible
32
- registry. GitHub installs are not a first-class path today.
33
-
34
- Treat both Plugin workers and Plugin UI as trusted code. Plugin UI runs as
35
- same-origin JavaScript and is not sandboxed by manifest capabilities.
36
- Worker-side host APIs are capability-gated. Keep these boundaries visible when
37
- reviewing third-party code or selecting capabilities.
38
-
39
- ## Scaffold From The Current Package
40
-
41
- Use `create-rudder-plugin` instead of hand-writing boilerplate. In a Rudder
42
- checkout, first build the scaffold package, then run its generated CLI for the
43
- requested npm package name and output root. `--output` names the parent
44
- directory; the CLI appends the package basename, and that destination must not
45
- already exist. Verify the exact commands in
46
- the current authoring guide before execution.
47
-
48
- For a repository-local package, the scaffold uses `workspace:*` for
49
- `@rudderhq/plugin-sdk`. For an external package, pass `--sdk-path` pointing to
50
- the checkout's `packages/plugins/sdk`; the scaffold snapshots the SDK/shared
51
- packages into `.rudder-sdk/` so the Plugin can build and test before an npm
52
- publication exists.
53
-
54
- The generated package should include:
55
-
56
- - `src/manifest.ts`;
57
- - `src/worker.ts`;
58
- - `src/ui/index.tsx` when UI is used;
59
- - `tests/plugin.spec.ts`;
60
- - `package.json` and current build configuration.
61
-
62
- Scaffold only under the explicit output root and confirm the derived package
63
- directory before execution. Do not install the generated Plugin into a running
64
- Rudder instance unless the user also requested that host mutation.
65
-
66
- ## Implement Within Current Boundaries
67
-
68
- Review the manifest, worker, UI, and tests together:
69
-
70
- - Declare only capabilities used by the worker-side host APIs.
71
- - Keep tool names Plugin-namespaced; they must not shadow core or other Plugin
72
- tools.
73
- - Keep UI self-contained. Rudder does not provide a shared Plugin React
74
- component kit yet.
75
- - Do not use `ctx.assets`; it is not supported in the current runtime.
76
- - Use `routePath` only for a `page` slot. It must be one lowercase slug and may
77
- not collide with a reserved host route or another installed Plugin page.
78
- - Use the SDK's declared worker, UI, testing, bundler, and dev-server surfaces
79
- rather than undocumented application internals.
80
- - Treat jobs and webhooks as namespaced external execution surfaces and keep
81
- their capabilities, ownership, logs, and failure evidence explicit.
82
-
83
- Local development installs must use an absolute filesystem path. The server
84
- can watch a local-path Plugin and restart its worker after rebuilds, but that
85
- does not make a repo-local checkout a production deployment artifact.
86
-
87
- ## Wire A Bundled Example Only When Requested
88
-
89
- Only if the user explicitly asks for bundled example or discoverable host
90
- wiring, update the host's bundled-example list and the documentation that
91
- enumerates in-repo examples. A request to scaffold or develop a Plugin alone
92
- does not authorize changing `server/src/routes/plugins.ts` or other host
93
- registration surfaces.
94
-
95
- If host runtime, SDK, capability validation, static UI serving, or lifecycle
96
- code changes, follow the repository's Plugin engineering and Product Logic
97
- rules in addition to the package workflow.
98
-
99
- ## Verify The Package And Host
100
-
101
- At minimum, run the generated or existing Plugin package's:
102
-
103
- - `typecheck`;
104
- - `test`; and
105
- - `build`.
106
-
107
- Use the package scripts or the monorepo's `pnpm --filter <plugin-package>`
108
- forms. For a new scaffold, execute them in a temporary or explicitly requested
109
- target and confirm that its worker, manifest, UI bundle, and
110
- `tests/plugin.spec.ts` compile against the selected SDK layout.
111
-
112
- When host or SDK code changed, also run the relevant host integration tests,
113
- repository typecheck, test suite, and build. If the user asked to install the
114
- Plugin, verify the real host from its absolute local path and surface worker
115
- health, logs, route behavior, and capability failures. Package creation alone
116
- is not evidence that a Plugin is installed or active in Rudder.
3
+ Use this reference for explicit requests to create, inspect, import, or verify a
4
+ Rudder Plugin. Rudder V1 consumes the Codex Plugin package format and does not
5
+ provide a Plugin worker SDK or extension runtime.
6
+
7
+ ## Before Writing
8
+
9
+ - Confirm the requested target directory and whether the package needs Skills,
10
+ MCP definitions, App aliases, or a combination.
11
+ - Read `doc/engineering/PLUGIN_AUTHORING_GUIDE.md` and the current upstream
12
+ Codex Plugin manifest specification.
13
+ - Keep the required manifest at `.codex-plugin/plugin.json` with a lower-case
14
+ hyphenated name and strict semantic version.
15
+ - Do not recreate legacy Rudder workers, jobs, webhooks, UI slots, generic
16
+ state, host tools, or SDK dependencies.
17
+
18
+ ## Component Rules
19
+
20
+ - Put Skills at the default `skills/<slug>/SKILL.md` location or declare the
21
+ custom root in the manifest. Keep each Skill's scripts and references inside
22
+ its root.
23
+ - Declare MCP servers inline or through `.mcp.json`. Use environment references
24
+ for credentials; never embed tokens, passwords, authorization headers, or API
25
+ keys in the package.
26
+ - Treat `.app.json` as OpenAI registered App aliases only. It is not a Rudder
27
+ Local App definition or an MCP endpoint.
28
+ - Hooks, assets, and unknown fields may be preserved but are not executable in
29
+ Rudder V1.
30
+
31
+ ## Rudder Verification
32
+
33
+ Import only when the user requested that Organization mutation. Use Plugins >
34
+ Import and review the compatibility report. Verify inspection executes nothing.
35
+ After installation, verify the public workflow relevant to the
36
+ package: Agent Skill assignment, Managed MCP setup, Local App launch,
37
+ disable/re-enable, and non-destructive uninstall.
38
+
39
+ Package creation is not evidence of installation. Installation is not evidence
40
+ that MCP credentials or Agent access are active. Keep those states explicit.
@@ -48,6 +48,8 @@ Other lookup pages are similarly narrow:
48
48
  | Workspace and file placement | `https://docs.rudderhq.dev/reference/workspace-boundaries` | `https://docs.rudderhq.dev/zh/reference/workspace-boundaries` |
49
49
  | Automation result destinations | `https://docs.rudderhq.dev/reference/automation-output-routing` | `https://docs.rudderhq.dev/zh/reference/automation-output-routing` |
50
50
  | Deployment trust, credentials, Browser, and platform behavior | `https://docs.rudderhq.dev/reference/permissions-and-platforms` | `https://docs.rudderhq.dev/zh/reference/permissions-and-platforms` |
51
+ | Windows Desktop release signing policy | `https://docs.rudderhq.dev/reference/code-signing-policy` | `https://docs.rudderhq.dev/zh/reference/code-signing-policy` |
52
+ | Local data and optional service privacy | `https://docs.rudderhq.dev/reference/privacy` | `https://docs.rudderhq.dev/zh/reference/privacy` |
51
53
 
52
54
  ## Product Logic Registry
53
55