@open-everywhere/create 0.1.4 → 0.2.1

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 (32) hide show
  1. package/NOTICE +34 -4
  2. package/package.json +4 -4
  3. package/src/app-naming.ts +47 -0
  4. package/src/cli.ts +10 -6
  5. package/src/engine.ts +5 -1
  6. package/src/steps/roster.ts +3 -0
  7. package/src/steps/slack.ts +16 -3
  8. package/template/AGENTS.md +4 -1
  9. package/template/README.md +21 -2
  10. package/template/agent/access/bundles.ts +9 -0
  11. package/template/agent/access/credential-bindings.generated.ts +6 -5
  12. package/template/agent/access/grants.generated.ts +6 -5
  13. package/template/agent/access/network-access.ts +1 -1
  14. package/template/agent/access/pre-approval-rules.ts +81 -0
  15. package/template/agent/blob/hosting.ts +1 -1
  16. package/template/agent/identity/groups.generated.ts +6 -5
  17. package/template/agent/instructions.md +7 -5
  18. package/template/agent/instrumentation/otel.ts +13 -0
  19. package/template/agent/instrumentation/otlp.ts +4 -0
  20. package/template/agent/lib/register-adapters.ts +21 -282
  21. package/template/agent/lib/register-config.ts +5 -0
  22. package/template/agent/lib/register-docs.ts +17 -0
  23. package/template/agent/memory/config/agents.generated.ts +6 -5
  24. package/template/agent/sandbox/backend-select.ts +2 -2
  25. package/template/agent/sandbox/sandbox.ts +127 -73
  26. package/template/agent/spend/checkpoints.ts +5 -3
  27. package/template/agent/webhooks/hooks.generated.ts +6 -5
  28. package/template/claude/skills/upgrade-open-everywhere/SKILL.md +52 -4
  29. package/template/package.json +1 -1
  30. package/template/roster.lock.json +7 -1
  31. package/template/scripts/ops-mcp.ts +16 -0
  32. package/template/agent/instrumentation.ts +0 -6
@@ -8,12 +8,14 @@
8
8
  // scope is over its monthly total. A checkpoint is softer and per-session — when a single
9
9
  // conversation gets expensive it PAUSES only CONSEQUENTIAL actions (PRs, memory writes, skill/
10
10
  // routine creation, …) and posts a "keep going?" card. Reads and replies are never blocked, and a
11
- // member's approval lets the agent resume for the rest of that session. It's a runaway-session
12
- // circuit-breaker, not a spend ceiling.
11
+ // member's approval lets the agent resume. On a live session the approval lasts until the window
12
+ // rotates or `approvals.checkpointTtlHours` (default 24 h) lapses, whichever comes first. On a
13
+ // durable job's session it does not lapse: the agent asks again once it has spent that much again.
14
+ // It's a runaway-session circuit-breaker, not a spend ceiling.
13
15
  //
14
16
  // EMPTY BY DEFAULT — with nothing declared here, nothing is checkpointed (Open Everywhere never
15
17
  // invents a threshold). This file is the seam a DB/dashboard would swap behind, same as
16
- // budgets.ts / memory/config/domains.ts. After adding a checkpoint: `npm run typecheck:all`
18
+ // budgets.ts / memory/config/domains.ts. After adding a checkpoint: `npm run typecheck`
17
19
  // (assertSpendCheckpointsValid runs at import time and throws on a malformed entry — bad scope
18
20
  // keys, unknown/typo'd fields, non-positive amounts).
19
21
  //
@@ -1,14 +1,15 @@
1
1
  // GENERATED + MACHINE-OWNED — DO NOT HAND-EDIT.
2
2
  //
3
3
  // The webhook-hooks overlay: DATA ONLY. Written exclusively by the deterministic codemod
4
- // (packages/core/agent/webhooks/hooks-codemod.ts) on a bot-PR branch; the PR merge is the approval gate.
4
+ // (@open-everywhere/core/agent/webhooks/hooks-codemod.js) on a bot-PR branch; the PR merge is the approval gate.
5
5
  //
6
6
  // The codemod re-emits this file from its own parsed content and refuses to rewrite it when the
7
- // bytes differ, so a hand-edit stops the next machine PR. Before a merge, nothing checks that the
8
- // file is still data only unless the repository runs its own check: the person who merges the PR
9
- // is the gate. Read a PR to this file as code, because it is code.
7
+ // data or the import differ, so a hand-edit there stops the next machine PR. Before a merge,
8
+ // nothing checks that the file is still data only unless the repository runs
9
+ // `npx oe build --check` or `npx oe overlays check`: the person who merges the PR is the gate.
10
+ // Read a PR to this file as code, because it is code.
10
11
  //
11
- // To change it by hand, edit only the data below and keep the layout exactly as emitted.
12
+ // To change it by hand, edit only the data below, then run `npx oe overlays normalize`.
12
13
 
13
14
  import type { HooksFile } from "@open-everywhere/core/agent/webhooks/hooks-codemod.js";
14
15
 
@@ -64,6 +64,30 @@ step 3, after the install puts the target's own copy on disk. The same text is i
64
64
  **Stop and ask the user** when the window holds a breaking change, an env change or a manual step.
65
65
  Those are decisions, not steps.
66
66
 
67
+ `--plan` also prints a **template drift** report. It compares every file the scaffold copied into
68
+ this app with the TARGET release's `@open-everywhere/create` template, and lists each one that
69
+ differs, with a one-line size of its diff. An upgrade changes only `package.json`, so a scaffolded
70
+ file stays as the old template wrote it. A stale copy can typecheck and build and still break the
71
+ deployment: the 0.1.2 `agent/lib/register-adapters.ts` registers no Postgres client on a bare
72
+ `DATABASE_URL`, so a Vercel+Neon deployment of 0.1.4 fails at its first write.
73
+
74
+ `agent/lib/register-adapters.ts` is the exception once it is current. The current template's copy
75
+ is ONE call, `registerDefaultAdapters()` from `@open-everywhere/adapters`, plus a `customAdapters`
76
+ hook. The adapter wiring, the store selection rules and the floors live in that package, so the
77
+ package upgrade carries them, and the file needs no hand-merge. Sync it ONCE, from a copy that wires
78
+ the adapters by hand to the one-call copy: move any adapter the user registered by hand into the
79
+ `customAdapters` hook. After that, a SYNC line for this file is a comment or hook difference only.
80
+
81
+ | Line | What to do |
82
+ | --- | --- |
83
+ | SYNC | a template-owned file — wiring, a script, `AGENTS.md`, `README.md`, `.env.example`, a skill. Plan to copy the target's file over this one, after you read the diff. |
84
+ | config | the app's own config-as-code. A difference is normal once the app is configured. Merge the template's change by hand only if the user wants it. |
85
+
86
+ The report never writes a file. If it says the drift check did not run, compare the files with the
87
+ target's template by hand. An installed core without the report prints none: `oe upgrade` runs the
88
+ INSTALLED core's code. So when `--plan` prints no "Template drift" heading, run
89
+ `npx oe upgrade --to <target> --plan` once more after step 3. The target's own code prints the report then.
90
+
67
91
  ## 3. Run the upgrade
68
92
 
69
93
  ```
@@ -95,10 +119,18 @@ survives `rm -rf node_modules && npm ci`.
95
119
  Never delete the marker to make `oe upgrade` say there is nothing to do. It is the only record
96
120
  that a run began taking the target and never proved the tree.
97
121
 
98
- **If it refuses with "the release notes name codemods this CLI does not hold":** the codemod ships
99
- in a newer core than the one you are running. Upgrade in ONE step to a version that holds it, or
100
- apply those migrations by hand. Do not work around the refusal — it exists because a half-applied
101
- migration that reports success is worse than a stop.
122
+ **If it refuses with "the release notes name codemods this CLI does not hold":** the running core
123
+ is 0.1.4, and it runs codemods from its own registry. When it stops after the install, the
124
+ target's own `oe` is installed now. Run `oe upgrade` again: the resume marker keeps the window, and
125
+ the target's registry applies the codemod. Apply the migration by hand only if that run refuses
126
+ too. Do not work around the refusal — it exists because a half-applied migration that reports
127
+ success is worse than a stop. A later core only WARNS with that text before the install, because
128
+ the target's own registry decides.
129
+
130
+ **If it refuses with "the installed core's registry does not hold":** the target release names a
131
+ codemod that it does not ship, and no codemod ran. Run `oe upgrade --to <a later release that holds
132
+ it>`. The resume marker keeps the refused release in that run's window, so that run applies the
133
+ codemod. Do not delete the marker to get past this refusal.
102
134
 
103
135
  ## 4. Review the diff
104
136
 
@@ -115,6 +147,21 @@ is the review surface, and it is the only one.
115
147
  Then run the app's own checks once more if anything above was fixed by hand:
116
148
  `npm run typecheck && npm run build`.
117
149
 
150
+ Then act on the template drift report. A core that carries it prints it again after the install;
151
+ if this run printed no "Template drift" heading, run `npx oe upgrade --to <target> --plan` now to get it. For
152
+ each SYNC line, read the diff against the installed template, for example
153
+ `diff node_modules/@open-everywhere/create/template/agent/lib/register-adapters.ts agent/lib/register-adapters.ts`.
154
+ Keep any edit the user made on purpose, and copy the template's file otherwise. For
155
+ `agent/lib/register-adapters.ts`, the user's edits belong in the `customAdapters` hook of the
156
+ template's one-call copy, never in a hand-wired copy: a hand-wired copy does not get the product's
157
+ wiring changes on the next upgrade. A file under the
158
+ template's `claude/` directory lands in the app's `.claude/`, and the template's `gitignore` is the
159
+ app's `.gitignore`. Name every synced file in the pull request.
160
+
161
+ Run `npx oe build --check`. It also proves the machine-owned `*.generated.ts` overlays hold only
162
+ data. If it says an overlay has older header text, that is not a failure: run
163
+ `npx oe overlays normalize` and commit the header change with the upgrade.
164
+
118
165
  ## 5. Open a pull request
119
166
 
120
167
  Commit on a branch, never on the default branch. The body carries:
@@ -124,6 +171,7 @@ Commit on a branch, never on the default branch. The body carries:
124
171
  - what changed in `roster.lock.json`, in your own words;
125
172
  - **the env names the deployment needs before this merges**, names only;
126
173
  - the manual steps, and who does each one.
174
+ - the template files you synced, and each SYNC line you left as it is, with the reason.
127
175
 
128
176
  Then stop. The admin reviews the lock diff and merges. The merge deploys.
129
177
 
@@ -31,7 +31,7 @@
31
31
  "@open-everywhere/provider-notion": "{{OE_VERSION}}",
32
32
  "@open-everywhere/provider-slack": "{{OE_VERSION}}",
33
33
  "@open-everywhere/provider-teams": "{{OE_VERSION}}",
34
- "eve": "0.54.3",
34
+ "eve": "0.71.0",
35
35
  "just-bash": "^3.1.0"
36
36
  },
37
37
  "devDependencies": {
@@ -39,6 +39,7 @@
39
39
  "hook/eve-patch-gate": "mounted",
40
40
  "hook/fire-carriage": "mounted",
41
41
  "hook/fire-toolset": "mounted",
42
+ "hook/held-question": "mounted",
42
43
  "hook/job-posture": "mounted",
43
44
  "hook/lean-seat": "mounted",
44
45
  "hook/learn": "mounted",
@@ -69,10 +70,13 @@
69
70
  "tool/add_label": "mounted",
70
71
  "tool/add_routine_rule": "mounted",
71
72
  "tool/agent_version": "mounted",
73
+ "tool/ask_question": "mounted",
74
+ "tool/ask_room": "mounted",
72
75
  "tool/assign": "mounted",
73
76
  "tool/aws": "mounted",
74
77
  "tool/browser_tools": "mounted",
75
78
  "tool/cancel_routine": "mounted",
79
+ "tool/cancel_work": "mounted",
76
80
  "tool/capture_events": "mounted",
77
81
  "tool/check_pr_status": "mounted",
78
82
  "tool/checkout_repo": "mounted",
@@ -118,6 +122,7 @@
118
122
  "tool/read_channel": "mounted",
119
123
  "tool/read_docs": "mounted",
120
124
  "tool/read_file_upload": "mounted",
125
+ "tool/read_github_issue": "mounted",
121
126
  "tool/read_routine_transcript": "mounted",
122
127
  "tool/read_thread": "mounted",
123
128
  "tool/read_thread_seat": "mounted",
@@ -151,7 +156,8 @@
151
156
  "tool/unlink_identity": "mounted",
152
157
  "tool/update_status": "mounted",
153
158
  "tool/usage_report": "mounted",
154
- "tool/walk_pr": "mounted"
159
+ "tool/walk_pr": "mounted",
160
+ "tool/work": "mounted"
155
161
  }
156
162
  },
157
163
  "@open-everywhere/provider-github": {
@@ -13,6 +13,7 @@ import { registerSlackOps } from "@open-everywhere/provider-slack/agent/ops.js";
13
13
  import { registerGithubOps } from "@open-everywhere/provider-github/agent/ops.js";
14
14
  import { registerSurfaceTrustPreflight } from "@open-everywhere/core/agent/identity/trust-preflight.js";
15
15
  import { importAppModule, resolveAppRoot } from "@open-everywhere/core/agent/scaffold/app-root.js";
16
+ import { registerSettings, type AgentSettingsOverrides } from "@open-everywhere/core/agent/settings/settings.js";
16
17
 
17
18
  // The app root: `OE_APP_ROOT`, else the nearest directory above the working directory that holds
18
19
  // package.json and agent/agent.ts.
@@ -20,6 +21,21 @@ const APP_ROOT = resolveAppRoot();
20
21
  // Populate the trust register BEFORE the trust preflight registers: an empty register would report
21
22
  // every surface with traffic as undeclared.
22
23
  await importAppModule("agent/identity/surfaces.ts", APP_ROOT);
24
+ // The app's SETTINGS (OPE-2334). `surface_manifest` renders each chat app's name, bot name and slash
25
+ // command from the `identity.*` settings, so the server registers the deployment's own declaration
26
+ // before it serves. Without this the manifest would carry the shipped defaults, not the app's name.
27
+ // FAIL-SOFT: `defineSettings` throws at load on an invalid value, and a settings file that throws
28
+ // must not take down the server whose preflight and status tools diagnose it. The manifests then
29
+ // render with the shipped defaults, and stderr says so.
30
+ try {
31
+ const { SETTINGS_OVERRIDES } = await importAppModule<{ SETTINGS_OVERRIDES: AgentSettingsOverrides }>("agent/settings/settings.ts", APP_ROOT);
32
+ registerSettings(SETTINGS_OVERRIDES);
33
+ } catch (err) {
34
+ process.stderr.write(
35
+ `open-everywhere-ops: agent/settings/settings.ts did not load (${err instanceof Error ? err.message : String(err)}) — ` +
36
+ "surface_manifest renders the shipped default names until it does\n",
37
+ );
38
+ }
23
39
 
24
40
  registerSlackOps();
25
41
  registerGithubOps();
@@ -1,6 +0,0 @@
1
- // Eve discovers this file by convention (agentRoot `instrumentation.ts`) and reads its
2
- // default export at server startup. The implementation — OTel span export via Vercel
3
- // Ship's `registerOTel`, no-op without a collector — lives in the adapters workspace
4
- // (`@vercel/otel` is a vendor SDK; core stays vendor-free). A self-host swaps this line
5
- // for its own instrumentation adapter without touching core.
6
- export { default } from "@open-everywhere/adapters/agent/instrumentation.js";