@zabaca/zbc 0.25.0 → 0.27.0
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/CHANGELOG.md +114 -0
- package/package.json +1 -1
- package/src/commands/init.ts +105 -10
- package/src/commands/secret.ts +1 -66
- package/src/commands/update.ts +77 -7
- package/src/engine/actions.ts +35 -3
- package/src/engine/on-demand.ts +9 -1
- package/src/engine/secret-outputs.ts +15 -0
- package/src/engine/secrets.ts +81 -1
- package/src/utils/copy-refresh.ts +124 -19
- package/src/utils/detect-mode.ts +1 -1
- package/src/utils/host-workspaces.ts +57 -0
- package/src/utils/subtree.ts +54 -15
- package/src/utils/template-history.ts +66 -0
- package/src/utils/vendor-audit.ts +12 -8
- package/src/utils/vendor-stamp.ts +10 -0
- package/src/utils/vendored-app.ts +3 -0
- package/templates/apps/walgit/CONTEXT.md +45 -4
- package/templates/apps/walgit/README.md +394 -11
- package/templates/apps/walgit/shared/browse.ts +61 -0
- package/templates/apps/walgit/shared/capabilities.ts +26 -0
- package/templates/apps/walgit/shared/container-env.ts +12 -0
- package/templates/apps/walgit/shared/container-lifecycle.ts +1 -1
- package/templates/apps/walgit/shared/credentials.ts +4 -0
- package/templates/apps/walgit/shared/events.ts +35 -1
- package/templates/apps/walgit/shared/instructions.ts +4 -1
- package/templates/apps/walgit/shared/landing.ts +2 -1
- package/templates/apps/walgit/shared/llms.ts +73 -5
- package/templates/apps/walgit/shared/mcp.ts +19 -3
- package/templates/apps/walgit/shared/protocol.ts +40 -3
- package/templates/apps/walgit/shared/repo-list.ts +46 -6
- package/templates/apps/walgit/shared/scoped-token.ts +500 -0
- package/templates/apps/walgit/shared/token-revocation.ts +134 -0
- package/templates/apps/walgit/shared/wal-index.ts +19 -0
- package/templates/apps/walgit/shared/webhook.ts +281 -0
- package/templates/apps/walgit/src/admin.ts +510 -0
- package/templates/apps/walgit/src/announce-main.ts +17 -9
- package/templates/apps/walgit/src/announce.ts +86 -0
- package/templates/apps/walgit/src/browse.ts +255 -2
- package/templates/apps/walgit/src/cli.ts +140 -0
- package/templates/apps/walgit/src/expire.ts +5 -0
- package/templates/apps/walgit/src/git.ts +103 -0
- package/templates/apps/walgit/src/hook-main.ts +6 -3
- package/templates/apps/walgit/src/http.ts +563 -3
- package/templates/apps/walgit/src/limits.ts +3 -0
- package/templates/apps/walgit/src/merge.ts +525 -0
- package/templates/apps/walgit/src/rate-limit.ts +51 -14
- package/templates/apps/walgit/src/server.ts +65 -1
- package/templates/apps/walgit/worker/events-do.ts +218 -3
- package/templates/apps/walgit/worker/index.ts +134 -9
- package/templates/apps/walgit/worker/mcp.ts +17 -2
- package/templates/history.json +1 -0
- package/templates/infra/modules/cloudflare/index.ts +140 -1
- package/templates/infra/modules/cloudflare-access/index.ts +176 -65
- package/templates/infra/modules/cloudflare-access/registry.json +1 -1
- package/templates/infra/modules/cloudflare-api/index.ts +56 -0
- package/templates/infra/modules/cloudflare-email/index.ts +44 -17
- package/templates/infra/modules/cloudflare-email/registry.json +1 -1
- package/templates/infra/modules/cloudflare-stored-token/index.ts +343 -0
- package/templates/infra/modules/cloudflare-stored-token/registry.json +12 -0
- package/templates/infra/modules/cloudflare-token/index.ts +46 -17
- package/templates/infra/modules/cloudflare-token/registry.json +1 -1
- package/templates/infra/modules/cloudflare-tunnel/index.ts +63 -8
- package/templates/infra/modules/cloudflare-tunnel/registry.json +1 -1
- package/templates/infra/modules/d1/index.ts +37 -35
- package/templates/infra/modules/d1/registry.json +1 -1
- package/templates/infra/modules/docker-compose-stack/index.ts +3 -1
- package/templates/infra/modules/queue/index.ts +28 -18
- package/templates/infra/modules/queue/registry.json +1 -1
- package/templates/infra/modules/r2/index.ts +20 -11
- package/templates/infra/modules/r2/registry.json +1 -1
- package/templates/infra/src/context.ts +41 -0
- package/templates/infra/src/testing.ts +19 -1
- package/templates/infra/src/types.ts +23 -0
|
@@ -99,6 +99,12 @@ export interface ApplyContextInput {
|
|
|
99
99
|
secrets: Record<string, string>
|
|
100
100
|
imports: Record<string, unknown>
|
|
101
101
|
projectRoot: string
|
|
102
|
+
/**
|
|
103
|
+
* How `ctx.storeSecret` writes, when this context may write at all. The
|
|
104
|
+
* engine supplies it to an action's body and to nothing else; see
|
|
105
|
+
* `ApplyContext.storeSecret`.
|
|
106
|
+
*/
|
|
107
|
+
storeSecret?: (key: string, value: string) => Promise<void>
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
/** A `{ from, output }` reference into an imported instance's outputs. */
|
|
@@ -162,6 +168,23 @@ export interface ApplyContext extends ApplyContextInput {
|
|
|
162
168
|
* it.
|
|
163
169
|
*/
|
|
164
170
|
outputValue(ref: OutputRef, field: string): unknown
|
|
171
|
+
/**
|
|
172
|
+
* Put a value into this environment's secrets.yaml under `key`, encrypted as
|
|
173
|
+
* the rest of the file is. For the credential a provider shows once, at
|
|
174
|
+
* creation, and that something outside any apply will need later: an Access
|
|
175
|
+
* service token's client secret, a tunnel's run token, a key pair for a
|
|
176
|
+
* reader that is not this project.
|
|
177
|
+
*
|
|
178
|
+
* ONLY IN AN ACTION ([ADR-0023](../../../../../docs/adr/0023-a-credential-shown-once-is-stored-by-an-action.md)).
|
|
179
|
+
* Called from `apply`, `destroy` or a readiness probe it throws. An apply
|
|
180
|
+
* runs in CI, where a changed secrets.yaml is thrown away with the runner,
|
|
181
|
+
* and an apply that rewrites a committed file is no longer something that
|
|
182
|
+
* can be run twice to the same effect. An action is run by an operator, at a
|
|
183
|
+
* checkout, on purpose, and leaves a diff to commit.
|
|
184
|
+
*
|
|
185
|
+
* After it resolves, `ctx.secret(key)` in the same run returns the new value.
|
|
186
|
+
*/
|
|
187
|
+
storeSecret(key: string, value: string): Promise<void>
|
|
165
188
|
}
|
|
166
189
|
|
|
167
190
|
/**
|