@pellux/goodvibes-agent 0.1.55 → 0.1.57
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/.goodvibes/GOODVIBES.md +1 -1
- package/CHANGELOG.md +19 -8
- package/README.md +10 -3
- package/docs/README.md +1 -1
- package/docs/getting-started.md +10 -3
- package/docs/release-and-publishing.md +12 -3
- package/package.json +1 -3
- package/scripts/check-bun.sh +5 -1
- package/src/agent/routine-schedule-args.ts +219 -0
- package/src/agent/routine-schedule-format.ts +173 -0
- package/src/agent/routine-schedule-promotion.ts +3 -811
- package/src/agent/routine-schedule-receipts.ts +502 -0
- package/src/cli/agent-knowledge-command.ts +6 -6
- package/src/cli/help.ts +3 -25
- package/src/cli/package-verification.ts +23 -16
- package/src/cli/redaction.ts +4 -1
- package/src/cli/routines-command.ts +10 -6
- package/src/cli/service-posture.ts +47 -280
- package/src/cli/status.ts +0 -1
- package/src/config/secret-config.ts +0 -2
- package/src/input/agent-workspace-categories.ts +219 -0
- package/src/input/agent-workspace-editors.ts +143 -0
- package/src/input/agent-workspace-snapshot.ts +265 -0
- package/src/input/agent-workspace-types.ts +142 -0
- package/src/input/agent-workspace.ts +22 -766
- package/src/input/commands/agent-runtime-profile-runtime.ts +1 -1
- package/src/input/commands/delegation-runtime.ts +1 -1
- package/src/input/commands/experience-runtime.ts +3 -4
- package/src/input/commands/guidance-runtime.ts +1 -2
- package/src/input/commands/health-runtime.ts +3 -65
- package/src/input/commands/knowledge.ts +7 -7
- package/src/input/commands/local-setup-review.ts +0 -61
- package/src/input/commands/local-setup-transfer.ts +0 -3
- package/src/input/commands/local-setup.ts +2 -15
- package/src/input/commands/planning-runtime.ts +4 -1
- package/src/input/commands/platform-access-runtime.ts +1 -10
- package/src/input/commands/platform-services-runtime.ts +0 -1
- package/src/input/commands/recall-query.ts +1 -1
- package/src/input/commands/routines-runtime.ts +10 -6
- package/src/input/commands/schedule-runtime.ts +10 -6
- package/src/input/commands/session-workflow.ts +1 -1
- package/src/input/commands/tasks-runtime.ts +1 -14
- package/src/input/commands.ts +0 -4
- package/src/input/handler-onboarding.ts +10 -120
- package/src/input/onboarding/onboarding-wizard-apply.ts +5 -196
- package/src/input/onboarding/onboarding-wizard-constants.ts +8 -119
- package/src/input/onboarding/onboarding-wizard-helpers.ts +2 -53
- package/src/input/onboarding/onboarding-wizard-rules.ts +2 -236
- package/src/input/onboarding/onboarding-wizard-state.ts +1 -69
- package/src/input/onboarding/onboarding-wizard-steps.ts +584 -737
- package/src/input/onboarding/onboarding-wizard-types.ts +8 -26
- package/src/input/onboarding/onboarding-wizard.ts +4 -109
- package/src/input/settings-modal-agent-policy.ts +10 -0
- package/src/input/settings-modal-types.ts +2 -4
- package/src/input/settings-modal.ts +3 -1
- package/src/input/submission-router.ts +0 -1
- package/src/panels/approval-panel.ts +1 -2
- package/src/panels/builtin/operations.ts +1 -2
- package/src/panels/knowledge-panel.ts +2 -2
- package/src/panels/project-planning-panel.ts +4 -1
- package/src/panels/provider-health-domains.ts +0 -22
- package/src/panels/provider-health-panel.ts +1 -5
- package/src/panels/session-browser-panel.ts +0 -5
- package/src/panels/tasks-panel.ts +2 -64
- package/src/renderer/agent-workspace.ts +1 -1
- package/src/renderer/help-overlay.ts +1 -2
- package/src/renderer/semantic-diff.ts +1 -1
- package/src/renderer/settings-modal-helpers.ts +0 -16
- package/src/renderer/settings-modal.ts +3 -5
- package/src/runtime/bootstrap-hook-bridge.ts +0 -3
- package/src/runtime/bootstrap-shell.ts +2 -1
- package/src/runtime/bootstrap.ts +1 -1
- package/src/runtime/index.ts +0 -1
- package/src/runtime/onboarding/derivation.ts +1 -28
- package/src/runtime/onboarding/snapshot.ts +0 -1
- package/src/runtime/onboarding/types.ts +1 -4
- package/src/runtime/services.ts +4 -23
- package/src/runtime/ui-read-models.ts +4 -3
- package/src/shell/service-settings-sync.ts +15 -244
- package/src/tools/agent-context-policy.ts +1 -1
- package/src/tools/wrfc-agent-guard.ts +3 -3
- package/src/verification/live-verifier.ts +11 -5
- package/src/verification/verification-ledger.ts +3 -6
- package/src/version.ts +1 -1
- package/src/input/commands/agent-externalized-tui.ts +0 -73
- package/src/input/commands/cloudflare-runtime.ts +0 -385
- package/src/input/handler-onboarding-cloudflare.ts +0 -322
- package/src/input/onboarding/onboarding-runtime-status.ts +0 -87
- package/src/input/onboarding/onboarding-wizard-cloudflare-step.ts +0 -494
- package/src/input/onboarding/onboarding-wizard-cloudflare.ts +0 -199
- package/src/input/onboarding/onboarding-wizard-external-surface-extra-specs.ts +0 -130
- package/src/input/onboarding/onboarding-wizard-external-surfaces.ts +0 -762
- package/src/runtime/cloudflare-control-plane.ts +0 -350
- package/src/runtime/sandbox-public-gaps.ts +0 -358
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
import { CLOUDFLARE_COMPONENT_IDS, DEFAULT_CLOUDFLARE_COMPONENT_SELECTION } from '../../runtime/cloudflare-control-plane.ts';
|
|
2
|
-
import { normalizeText } from './onboarding-wizard-helpers.ts';
|
|
3
|
-
import type { OnboardingWizardController } from './onboarding-wizard.ts';
|
|
4
|
-
import type { OnboardingWizardFieldDefinition, OnboardingWizardStepDefinition } from './onboarding-wizard-types.ts';
|
|
5
|
-
import {
|
|
6
|
-
CLOUDFLARE_BATCH_MODE_OPTIONS,
|
|
7
|
-
CLOUDFLARE_PROVISION_OPTIONS,
|
|
8
|
-
CLOUDFLARE_SETUP_SOURCE_OPTIONS,
|
|
9
|
-
CLOUDFLARE_YES_NO_OPTIONS,
|
|
10
|
-
cloudflareComponentFieldId,
|
|
11
|
-
cloudflareComponentLabel,
|
|
12
|
-
getCloudflareBatchMode,
|
|
13
|
-
getCloudflareComponentSelection,
|
|
14
|
-
getCloudflareSetupSource,
|
|
15
|
-
} from './onboarding-wizard-cloudflare.ts';
|
|
16
|
-
|
|
17
|
-
export function buildCloudflareStep(controller: OnboardingWizardController): OnboardingWizardStepDefinition {
|
|
18
|
-
const config = controller.runtimeSnapshot?.config.cloudflare;
|
|
19
|
-
const batch = controller.runtimeSnapshot?.config.batch;
|
|
20
|
-
const enabledDefault = controller.isCapabilitySelected('cloudflare-batch') || config?.enabled === true;
|
|
21
|
-
const enabled = controller.getBooleanFieldValue('cloudflare.enabled', enabledDefault);
|
|
22
|
-
const components = getCloudflareComponentSelection(controller);
|
|
23
|
-
const componentCount = Object.values(components).filter(Boolean).length;
|
|
24
|
-
const setupSource = getCloudflareSetupSource(controller);
|
|
25
|
-
const batchMode = getCloudflareBatchMode(controller);
|
|
26
|
-
const bind = controller.runtimeSnapshot?.bindSettings.controlPlane;
|
|
27
|
-
const defaultDaemonBaseUrl = normalizeText(config?.daemonBaseUrl)
|
|
28
|
-
|| `http://${bind?.host && bind.host !== '0.0.0.0' && bind.host !== '::' ? bind.host : '127.0.0.1'}:${bind?.port ?? 3421}`;
|
|
29
|
-
const resultMessage = controller.textState.get('cloudflare.action-status') ?? 'No Cloudflare action has run in this wizard session.';
|
|
30
|
-
const fields: OnboardingWizardFieldDefinition[] = [
|
|
31
|
-
{
|
|
32
|
-
kind: 'checklist',
|
|
33
|
-
id: 'cloudflare.enabled',
|
|
34
|
-
label: 'Enable Cloudflare integration',
|
|
35
|
-
hint: 'Turns on GoodVibes Cloudflare config. Batch execution remains opt-in through the batch mode below.',
|
|
36
|
-
defaultValue: enabledDefault,
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
if (enabled) {
|
|
41
|
-
fields.push(
|
|
42
|
-
{
|
|
43
|
-
kind: 'radio',
|
|
44
|
-
id: 'cloudflare.batch-mode',
|
|
45
|
-
label: 'Batch mode',
|
|
46
|
-
hint: 'Controls when daemon work uses the batch path. Off keeps normal immediate behavior.',
|
|
47
|
-
options: CLOUDFLARE_BATCH_MODE_OPTIONS,
|
|
48
|
-
defaultValue: batch?.mode ?? 'off',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
kind: 'radio',
|
|
52
|
-
id: 'cloudflare.free-tier-mode',
|
|
53
|
-
label: 'Free-tier guardrails',
|
|
54
|
-
hint: 'Keep conservative queue-operation limits visible for free-tier Cloudflare accounts.',
|
|
55
|
-
options: CLOUDFLARE_YES_NO_OPTIONS,
|
|
56
|
-
defaultValue: config?.freeTierMode === false ? 'no' : 'yes',
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
for (const component of CLOUDFLARE_COMPONENT_IDS) {
|
|
61
|
-
const advanced = component !== 'workers' && component !== 'queues';
|
|
62
|
-
fields.push({
|
|
63
|
-
kind: 'checklist',
|
|
64
|
-
id: cloudflareComponentFieldId(component),
|
|
65
|
-
label: `${cloudflareComponentLabel(component)}${advanced ? ' (advanced)' : ''}`,
|
|
66
|
-
hint: cloudflareComponentHint(component),
|
|
67
|
-
defaultValue: config?.enabled === true
|
|
68
|
-
? component === 'workers' || component === 'queues'
|
|
69
|
-
: DEFAULT_CLOUDFLARE_COMPONENT_SELECTION[component],
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
fields.push(
|
|
74
|
-
{
|
|
75
|
-
kind: 'radio',
|
|
76
|
-
id: 'cloudflare.setup-source',
|
|
77
|
-
label: 'Cloudflare token setup path',
|
|
78
|
-
hint: 'Choose whether the daemon SDK route creates/stores an operational token, uses an existing token, or only saves settings.',
|
|
79
|
-
options: CLOUDFLARE_SETUP_SOURCE_OPTIONS,
|
|
80
|
-
defaultValue: getCloudflareSetupSource(controller),
|
|
81
|
-
},
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
if (setupSource === 'bootstrap-token') {
|
|
85
|
-
fields.push({
|
|
86
|
-
kind: 'masked',
|
|
87
|
-
id: 'cloudflare.bootstrap-token',
|
|
88
|
-
label: 'Temporary bootstrap token',
|
|
89
|
-
hint: 'Used once by the SDK route to create a narrower GoodVibes operational token. It is never persisted.',
|
|
90
|
-
placeholder: 'temporary Cloudflare token',
|
|
91
|
-
defaultValue: '',
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
if (setupSource === 'bootstrap-env') {
|
|
95
|
-
fields.push({
|
|
96
|
-
kind: 'text',
|
|
97
|
-
id: 'cloudflare.bootstrap-env-name',
|
|
98
|
-
label: 'Bootstrap token environment variable',
|
|
99
|
-
hint: 'Agent reads this environment variable once and passes the value to the SDK token-create route. It is not persisted.',
|
|
100
|
-
placeholder: 'GOODVIBES_CLOUDFLARE_BOOTSTRAP_TOKEN',
|
|
101
|
-
defaultValue: 'GOODVIBES_CLOUDFLARE_BOOTSTRAP_TOKEN',
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (setupSource === 'operational-token') {
|
|
105
|
-
fields.push({
|
|
106
|
-
kind: 'masked',
|
|
107
|
-
id: 'cloudflare.operational-token',
|
|
108
|
-
label: 'Final Cloudflare API token',
|
|
109
|
-
hint: 'A fully-created operational token. Provisioning can store it as goodvibes://secrets/goodvibes/CLOUDFLARE_API_TOKEN.',
|
|
110
|
-
placeholder: 'Cloudflare API token',
|
|
111
|
-
defaultValue: '',
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (setupSource === 'operational-env') {
|
|
115
|
-
fields.push({
|
|
116
|
-
kind: 'text',
|
|
117
|
-
id: 'cloudflare.operational-env-name',
|
|
118
|
-
label: 'Operational token environment variable',
|
|
119
|
-
hint: 'Defaults to CLOUDFLARE_API_TOKEN. The SDK can also resolve goodvibes://secrets/env/<name>.',
|
|
120
|
-
placeholder: 'CLOUDFLARE_API_TOKEN',
|
|
121
|
-
defaultValue: config?.apiTokenRef?.startsWith('goodvibes://secrets/env/')
|
|
122
|
-
? decodeURIComponent(config.apiTokenRef.slice('goodvibes://secrets/env/'.length))
|
|
123
|
-
: 'CLOUDFLARE_API_TOKEN',
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
fields.push(
|
|
128
|
-
{
|
|
129
|
-
kind: 'text',
|
|
130
|
-
id: 'cloudflare.account-id',
|
|
131
|
-
label: 'Cloudflare account id',
|
|
132
|
-
hint: 'Required for validation, token creation, discovery, and provisioning. Discovery can list accounts when the token permits it.',
|
|
133
|
-
placeholder: 'account id',
|
|
134
|
-
defaultValue: config?.accountId ?? '',
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
kind: 'text',
|
|
138
|
-
id: 'cloudflare.zone-id',
|
|
139
|
-
label: 'Zone id',
|
|
140
|
-
hint: 'Optional unless DNS or Access hostname automation is selected. Use the zone that owns the chosen hostname.',
|
|
141
|
-
placeholder: 'optional zone id',
|
|
142
|
-
defaultValue: config?.zoneId ?? '',
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
kind: 'text',
|
|
146
|
-
id: 'cloudflare.zone-name',
|
|
147
|
-
label: 'Zone name',
|
|
148
|
-
hint: 'Optional unless DNS or Access hostname automation is selected. Example: example.com for goodvibes.example.com.',
|
|
149
|
-
placeholder: 'example.com',
|
|
150
|
-
defaultValue: config?.zoneName ?? '',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
kind: 'text',
|
|
154
|
-
id: 'cloudflare.daemon-base-url',
|
|
155
|
-
label: 'Daemon base URL for Worker calls',
|
|
156
|
-
hint: 'The URL Cloudflare Worker/Tunnel uses to reach the GoodVibes daemon. 127.0.0.1 only works for local verification, not remote Cloudflare calls.',
|
|
157
|
-
placeholder: 'https://daemon.example.com or http://127.0.0.1:3421',
|
|
158
|
-
defaultValue: defaultDaemonBaseUrl,
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
kind: 'text',
|
|
162
|
-
id: 'cloudflare.daemon-hostname',
|
|
163
|
-
label: 'Daemon hostname',
|
|
164
|
-
hint: 'Optional hostname used by Tunnel, Access, and DNS automation. Leave blank to infer it from daemon base URL when possible.',
|
|
165
|
-
placeholder: 'daemon.example.com',
|
|
166
|
-
defaultValue: config?.daemonHostname ?? '',
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
kind: 'text',
|
|
170
|
-
id: 'cloudflare.worker-name',
|
|
171
|
-
label: 'Worker name',
|
|
172
|
-
hint: 'Cloudflare Worker script name to create or update.',
|
|
173
|
-
placeholder: 'goodvibes-batch-worker',
|
|
174
|
-
defaultValue: config?.workerName || 'goodvibes-batch-worker',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
kind: 'text',
|
|
178
|
-
id: 'cloudflare.worker-subdomain',
|
|
179
|
-
label: 'workers.dev subdomain',
|
|
180
|
-
hint: 'Optional workers.dev subdomain. If unavailable or blank, a custom route can still be used later.',
|
|
181
|
-
placeholder: 'account-subdomain',
|
|
182
|
-
defaultValue: config?.workerSubdomain ?? '',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
kind: 'text',
|
|
186
|
-
id: 'cloudflare.worker-hostname',
|
|
187
|
-
label: 'Worker custom hostname',
|
|
188
|
-
hint: 'Optional custom hostname for Worker DNS/route automation.',
|
|
189
|
-
placeholder: 'goodvibes.example.com',
|
|
190
|
-
defaultValue: config?.workerHostname ?? '',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
kind: 'text',
|
|
194
|
-
id: 'cloudflare.worker-base-url',
|
|
195
|
-
label: 'Worker base URL',
|
|
196
|
-
hint: 'Optional existing Worker URL. Provisioning fills this when it can infer the workers.dev URL.',
|
|
197
|
-
placeholder: 'https://goodvibes-batch-worker.account.workers.dev',
|
|
198
|
-
defaultValue: config?.workerBaseUrl ?? '',
|
|
199
|
-
},
|
|
200
|
-
);
|
|
201
|
-
|
|
202
|
-
if (components.queues) {
|
|
203
|
-
fields.push(
|
|
204
|
-
{
|
|
205
|
-
kind: 'text',
|
|
206
|
-
id: 'cloudflare.queue-name',
|
|
207
|
-
label: 'Queue name',
|
|
208
|
-
hint: 'Cloudflare Queue used for GoodVibes batch job signals.',
|
|
209
|
-
placeholder: 'goodvibes-batch',
|
|
210
|
-
defaultValue: config?.queueName || 'goodvibes-batch',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
kind: 'text',
|
|
214
|
-
id: 'cloudflare.dead-letter-queue-name',
|
|
215
|
-
label: 'Dead-letter queue name',
|
|
216
|
-
hint: 'Cloudflare dead-letter queue for failed batch signals.',
|
|
217
|
-
placeholder: 'goodvibes-batch-dlq',
|
|
218
|
-
defaultValue: config?.deadLetterQueueName || 'goodvibes-batch-dlq',
|
|
219
|
-
},
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (components.zeroTrustTunnel) {
|
|
224
|
-
fields.push(
|
|
225
|
-
{
|
|
226
|
-
kind: 'text',
|
|
227
|
-
id: 'cloudflare.tunnel-name',
|
|
228
|
-
label: 'Tunnel name',
|
|
229
|
-
hint: 'Cloudflare Tunnel name to create or reuse.',
|
|
230
|
-
placeholder: 'goodvibes-agent-daemon',
|
|
231
|
-
defaultValue: config?.tunnelName || 'goodvibes-agent-daemon',
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
kind: 'text',
|
|
235
|
-
id: 'cloudflare.tunnel-id',
|
|
236
|
-
label: 'Existing tunnel id',
|
|
237
|
-
hint: 'Optional existing Tunnel id. Leave blank to let provisioning create or discover one by name.',
|
|
238
|
-
placeholder: 'optional tunnel id',
|
|
239
|
-
defaultValue: config?.tunnelId ?? '',
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
kind: 'text',
|
|
243
|
-
id: 'cloudflare.tunnel-service-url',
|
|
244
|
-
label: 'Tunnel service URL',
|
|
245
|
-
hint: 'Optional origin service URL for Tunnel ingress. Leave blank to use the daemon base URL.',
|
|
246
|
-
placeholder: 'http://127.0.0.1:3421',
|
|
247
|
-
defaultValue: '',
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
kind: 'text',
|
|
251
|
-
id: 'cloudflare.tunnel-token-ref',
|
|
252
|
-
label: 'Tunnel token secret ref',
|
|
253
|
-
hint: 'Optional existing goodvibes:// secret ref for a Cloudflare Tunnel token.',
|
|
254
|
-
placeholder: 'goodvibes://secrets/goodvibes/CLOUDFLARE_TUNNEL_TOKEN',
|
|
255
|
-
defaultValue: config?.tunnelTokenRef ?? '',
|
|
256
|
-
},
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (components.zeroTrustAccess) {
|
|
261
|
-
fields.push(
|
|
262
|
-
{
|
|
263
|
-
kind: 'text',
|
|
264
|
-
id: 'cloudflare.access-app-id',
|
|
265
|
-
label: 'Access app id',
|
|
266
|
-
hint: 'Optional existing Cloudflare Access application id. Leave blank to let provisioning create or discover one.',
|
|
267
|
-
placeholder: 'optional Access app id',
|
|
268
|
-
defaultValue: config?.accessAppId ?? '',
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
kind: 'text',
|
|
272
|
-
id: 'cloudflare.access-service-token-id',
|
|
273
|
-
label: 'Access service token id',
|
|
274
|
-
hint: 'Optional existing Access service token id.',
|
|
275
|
-
placeholder: 'optional service token id',
|
|
276
|
-
defaultValue: config?.accessServiceTokenId ?? '',
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
kind: 'text',
|
|
280
|
-
id: 'cloudflare.access-service-token-ref',
|
|
281
|
-
label: 'Access service token secret ref',
|
|
282
|
-
hint: 'Optional existing goodvibes:// secret ref for Access service token material.',
|
|
283
|
-
placeholder: 'goodvibes://secrets/goodvibes/CLOUDFLARE_ACCESS_SERVICE_TOKEN',
|
|
284
|
-
defaultValue: config?.accessServiceTokenRef ?? '',
|
|
285
|
-
},
|
|
286
|
-
);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
if (components.kv) {
|
|
290
|
-
fields.push(
|
|
291
|
-
{
|
|
292
|
-
kind: 'text',
|
|
293
|
-
id: 'cloudflare.kv-namespace-name',
|
|
294
|
-
label: 'KV namespace name',
|
|
295
|
-
hint: 'Cloudflare KV namespace for optional batch/runtime state.',
|
|
296
|
-
placeholder: 'goodvibes-runtime',
|
|
297
|
-
defaultValue: config?.kvNamespaceName || 'goodvibes-runtime',
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
kind: 'text',
|
|
301
|
-
id: 'cloudflare.kv-namespace-id',
|
|
302
|
-
label: 'Existing KV namespace id',
|
|
303
|
-
hint: 'Optional existing KV namespace id.',
|
|
304
|
-
placeholder: 'optional KV id',
|
|
305
|
-
defaultValue: config?.kvNamespaceId ?? '',
|
|
306
|
-
},
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (components.durableObjects) {
|
|
311
|
-
fields.push(
|
|
312
|
-
{
|
|
313
|
-
kind: 'text',
|
|
314
|
-
id: 'cloudflare.do-namespace-name',
|
|
315
|
-
label: 'Durable Object namespace name',
|
|
316
|
-
hint: 'Durable Object namespace expected by the Worker when this advanced component is selected.',
|
|
317
|
-
placeholder: 'GoodVibesCoordinator',
|
|
318
|
-
defaultValue: config?.durableObjectNamespaceName || 'GoodVibesCoordinator',
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
kind: 'text',
|
|
322
|
-
id: 'cloudflare.do-namespace-id',
|
|
323
|
-
label: 'Durable Object namespace id',
|
|
324
|
-
hint: 'Optional existing Durable Object namespace id.',
|
|
325
|
-
placeholder: 'optional Durable Object id',
|
|
326
|
-
defaultValue: config?.durableObjectNamespaceId ?? '',
|
|
327
|
-
},
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (components.r2) {
|
|
332
|
-
fields.push({
|
|
333
|
-
kind: 'text',
|
|
334
|
-
id: 'cloudflare.r2-bucket-name',
|
|
335
|
-
label: 'R2 bucket name',
|
|
336
|
-
hint: 'R2 Standard bucket for optional batch artifacts.',
|
|
337
|
-
placeholder: 'goodvibes-artifacts',
|
|
338
|
-
defaultValue: config?.r2BucketName || 'goodvibes-artifacts',
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (components.secretsStore) {
|
|
343
|
-
fields.push(
|
|
344
|
-
{
|
|
345
|
-
kind: 'text',
|
|
346
|
-
id: 'cloudflare.secrets-store-name',
|
|
347
|
-
label: 'Secrets Store name',
|
|
348
|
-
hint: 'Cloudflare Secrets Store name for optional account-level secrets.',
|
|
349
|
-
placeholder: 'goodvibes',
|
|
350
|
-
defaultValue: config?.secretsStoreName || 'goodvibes',
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
kind: 'text',
|
|
354
|
-
id: 'cloudflare.secrets-store-id',
|
|
355
|
-
label: 'Secrets Store id',
|
|
356
|
-
hint: 'Optional existing Cloudflare Secrets Store id.',
|
|
357
|
-
placeholder: 'optional Secrets Store id',
|
|
358
|
-
defaultValue: config?.secretsStoreId ?? '',
|
|
359
|
-
},
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
fields.push(
|
|
364
|
-
{
|
|
365
|
-
kind: 'text',
|
|
366
|
-
id: 'cloudflare.worker-cron',
|
|
367
|
-
label: 'Worker cron',
|
|
368
|
-
hint: 'Cron trigger installed on the Worker for batch scheduler ticks. Leave blank to skip cron automation.',
|
|
369
|
-
placeholder: '*/5 * * * *',
|
|
370
|
-
defaultValue: config?.workerCron || '*/5 * * * *',
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
kind: 'text',
|
|
374
|
-
id: 'cloudflare.max-queue-ops-per-day',
|
|
375
|
-
label: 'Max queue ops per day',
|
|
376
|
-
hint: 'Free-tier queue-operation budget used for local warnings.',
|
|
377
|
-
placeholder: '10000',
|
|
378
|
-
defaultValue: String(config?.maxQueueOpsPerDay ?? 10000),
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
kind: 'radio',
|
|
382
|
-
id: 'cloudflare.provision-on-apply',
|
|
383
|
-
label: 'Final apply Cloudflare provisioning',
|
|
384
|
-
hint: 'Agent onboarding saves config only. Run /cloudflare provision [flags] --yes explicitly for resource changes.',
|
|
385
|
-
options: CLOUDFLARE_PROVISION_OPTIONS,
|
|
386
|
-
defaultValue: 'no',
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
kind: 'status',
|
|
390
|
-
id: 'cloudflare.action-status',
|
|
391
|
-
label: 'Last Cloudflare daemon action',
|
|
392
|
-
hint: resultMessage,
|
|
393
|
-
defaultValue: resultMessage,
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
kind: 'action',
|
|
397
|
-
id: 'cloudflare.requirements',
|
|
398
|
-
action: 'cloudflare-token-requirements',
|
|
399
|
-
label: 'Show token requirements',
|
|
400
|
-
hint: 'Calls the daemon SDK route and displays the required token permissions for the selected components.',
|
|
401
|
-
defaultValue: 'Action',
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
kind: 'action',
|
|
405
|
-
id: 'cloudflare.create-token',
|
|
406
|
-
action: 'cloudflare-create-operational-token',
|
|
407
|
-
label: 'Show create-token command',
|
|
408
|
-
hint: 'Token creation is side-effecting. The wizard shows the explicit /cloudflare create-token ... --yes path instead of running it.',
|
|
409
|
-
defaultValue: 'Action',
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
kind: 'action',
|
|
413
|
-
id: 'cloudflare.discover',
|
|
414
|
-
action: 'cloudflare-discover',
|
|
415
|
-
label: 'Discover accounts, zones, and resources',
|
|
416
|
-
hint: 'Calls the daemon SDK route using the configured or supplied token and summarizes discoverable Cloudflare resources.',
|
|
417
|
-
defaultValue: 'Action',
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
kind: 'action',
|
|
421
|
-
id: 'cloudflare.validate',
|
|
422
|
-
action: 'cloudflare-validate',
|
|
423
|
-
label: 'Validate Cloudflare token',
|
|
424
|
-
hint: 'Calls the daemon SDK route to validate account access with the configured or supplied token.',
|
|
425
|
-
defaultValue: 'Action',
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
kind: 'action',
|
|
429
|
-
id: 'cloudflare.provision',
|
|
430
|
-
action: 'cloudflare-provision',
|
|
431
|
-
label: 'Show provision command',
|
|
432
|
-
hint: 'Provisioning is side-effecting. The wizard shows the explicit /cloudflare provision ... --yes path instead of running it.',
|
|
433
|
-
defaultValue: 'Action',
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
kind: 'action',
|
|
437
|
-
id: 'cloudflare.verify',
|
|
438
|
-
action: 'cloudflare-verify',
|
|
439
|
-
label: 'Verify Worker now',
|
|
440
|
-
hint: 'Calls the daemon SDK route to verify Worker health and daemon batch proxy readiness.',
|
|
441
|
-
defaultValue: 'Action',
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
kind: 'action',
|
|
445
|
-
id: 'cloudflare.disable',
|
|
446
|
-
action: 'cloudflare-disable',
|
|
447
|
-
label: 'Show disable command',
|
|
448
|
-
hint: 'Disabling persists config changes. The wizard shows the explicit /cloudflare disable ... --yes path instead of running it.',
|
|
449
|
-
defaultValue: 'Action',
|
|
450
|
-
},
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
return {
|
|
455
|
-
id: 'cloudflare',
|
|
456
|
-
title: 'Cloudflare batch setup',
|
|
457
|
-
shortLabel: 'Cloudflare',
|
|
458
|
-
description: 'Optional Cloudflare Workers and Queues setup. GoodVibes uses local immediate daemon behavior unless Cloudflare and a batch mode are enabled.',
|
|
459
|
-
summaryTitle: 'Cloudflare summary',
|
|
460
|
-
summaryLines: [
|
|
461
|
-
`Enabled: ${enabled ? 'yes' : 'no'}`,
|
|
462
|
-
`Batch mode: ${enabled ? batchMode : 'off'}`,
|
|
463
|
-
`Components: ${enabled ? componentCount : 0} selected`,
|
|
464
|
-
`Token setup: ${enabled ? setupSource : 'not used'}`,
|
|
465
|
-
`Provision on final apply: ${enabled ? controller.getStringFieldValue('cloudflare.provision-on-apply', 'no') : 'no'}`,
|
|
466
|
-
],
|
|
467
|
-
fields,
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
function cloudflareComponentHint(component: string): string {
|
|
472
|
-
switch (component) {
|
|
473
|
-
case 'workers':
|
|
474
|
-
return 'Deploy the GoodVibes Worker used for batch signals and optional public ingress.';
|
|
475
|
-
case 'queues':
|
|
476
|
-
return 'Create Cloudflare Queue and dead-letter queue resources for batch job signals.';
|
|
477
|
-
case 'zeroTrustTunnel':
|
|
478
|
-
return 'Create or reuse a Cloudflare Tunnel so Cloudflare can reach the daemon through a controlled path.';
|
|
479
|
-
case 'zeroTrustAccess':
|
|
480
|
-
return 'Configure Cloudflare Access application/service-token protection around the daemon hostname.';
|
|
481
|
-
case 'dns':
|
|
482
|
-
return 'Create DNS records for selected custom hostnames. Requires a Cloudflare-managed zone.';
|
|
483
|
-
case 'kv':
|
|
484
|
-
return 'Create or reuse KV for optional Worker-side state.';
|
|
485
|
-
case 'durableObjects':
|
|
486
|
-
return 'Use Durable Objects for advanced Worker coordination where supported.';
|
|
487
|
-
case 'secretsStore':
|
|
488
|
-
return 'Create or reuse a Cloudflare Secrets Store for optional account-level secrets.';
|
|
489
|
-
case 'r2':
|
|
490
|
-
return 'Create or reuse an R2 Standard bucket for optional batch artifacts.';
|
|
491
|
-
default:
|
|
492
|
-
return 'Optional Cloudflare component.';
|
|
493
|
-
}
|
|
494
|
-
}
|