@flowdular/sdk 0.1.0 → 0.2.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/.ai/skills/test-hardening/SKILL.md +1 -1
- package/README.md +69 -12
- package/assets/flowdular-banner.png +0 -0
- package/modules/agents/package.json +1 -1
- package/modules/auth/package.json +1 -1
- package/modules/auth/src/client/AuthenticationCore.tsrx +3 -1
- package/modules/auth/src/server/endpoints.ts +3 -1
- package/modules/auth/src/server/runtime.ts +4 -0
- package/modules/automations/package.json +1 -1
- package/modules/automations-workflows-integration/package.json +1 -1
- package/modules/profile/package.json +1 -1
- package/modules/sandbox/package.json +1 -1
- package/modules/system/package.json +1 -1
- package/modules/users/package.json +1 -1
- package/modules/workflows/package.json +1 -1
- package/package.json +5 -13
- package/packages/ai-provider/package.json +1 -1
- package/packages/cli-protocol/package.json +1 -1
- package/packages/client/package.json +1 -1
- package/packages/client/src/routing.ts +39 -2
- package/packages/client/src/shell/BrandMark.tsrx +5 -1
- package/packages/client/src/shell/navigation.ts +3 -1
- package/packages/client/src/state.ts +6 -2
- package/packages/contracts/package.json +1 -1
- package/packages/contracts/schemas/project.schema.json +16 -42
- package/packages/database/package.json +1 -1
- package/packages/database-pglite/package.json +1 -1
- package/packages/database-testing/package.json +1 -1
- package/packages/dev-console/package.json +1 -1
- package/packages/harness/package.json +1 -1
- package/packages/kernel/package.json +1 -1
- package/packages/server/package.json +1 -1
- package/packages/server/src/application-routes.ts +80 -8
- package/packages/server/src/index.ts +4 -1
- package/packages/server/src/web-html.ts +9 -5
- package/packages/server/src/web.ts +59 -7
- package/packages/ui/package.json +1 -1
- package/packages/coding-agent/package.json +0 -44
- package/packages/coding-agent/src/drivers/byok.ts +0 -322
- package/packages/coding-agent/src/drivers/claude-code.ts +0 -290
- package/packages/coding-agent/src/drivers/codex.ts +0 -281
- package/packages/coding-agent/src/index.ts +0 -56
- package/packages/coding-agent/src/registry.ts +0 -119
- package/packages/coding-agent/src/roles/contract.ts +0 -60
- package/packages/coding-agent/src/roles/defaults.ts +0 -134
- package/packages/coding-agent/src/roles/handoff.ts +0 -41
- package/packages/coding-agent/src/roles/registry.ts +0 -156
- package/packages/coding-agent/src/roles/skills.ts +0 -72
- package/packages/coding-agent/src/roles/sync.ts +0 -88
- package/packages/coding-agent/src/types.ts +0 -102
- package/packages/coding-agent/src/workspace.ts +0 -275
- package/packages/sandbox/README.md +0 -691
- package/packages/sandbox/bin/flowdular-sandbox.mjs +0 -393
- package/packages/sandbox/dist/client/assets/App-ClMOrpyg.js +0 -11
- package/packages/sandbox/dist/client/assets/PreviewHost-BHiHrfbQ.js +0 -1
- package/packages/sandbox/dist/client/assets/auto-buGEq6de.js +0 -3
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- package/packages/sandbox/dist/client/assets/index-CvwhlQ87.js +0 -4
- package/packages/sandbox/dist/client/assets/styles-BPWaGf55.js +0 -3
- package/packages/sandbox/dist/client/assets/styles-Dx1_KOag.css +0 -1
- package/packages/sandbox/dist/client/favicon.svg +0 -1
- package/packages/sandbox/dist/server/assets/auto-CVGNYyb3.js +0 -12785
- package/packages/sandbox/dist/server/assets/chunk-DDJLRBDX-3OUNo51g.js +0 -4125
- package/packages/sandbox/dist/server/assets/nodefs-DVSI7kG0.js +0 -24
- package/packages/sandbox/dist/server/assets/opfs-ahp-D56iokt1.js +0 -388
- package/packages/sandbox/dist/server/assets/token-Bvaq7Anz.js +0 -55
- package/packages/sandbox/dist/server/assets/token-util-BqSvdIPQ.js +0 -3
- package/packages/sandbox/dist/server/assets/token-util-CktFFT4z.js +0 -494
- package/packages/sandbox/dist/server/entry.js +0 -91671
- package/packages/sandbox/dist/server/favicon.svg +0 -1
- package/packages/sandbox/dist/server/index.html +0 -161
- package/packages/sandbox/index.html +0 -159
- package/packages/sandbox/octane.config.ts +0 -36
- package/packages/sandbox/package.json +0 -83
- package/packages/sandbox/public/favicon.svg +0 -1
- package/packages/sandbox/public/og.png +0 -0
- package/packages/sandbox/src/App.tsrx +0 -924
- package/packages/sandbox/src/client/ApprovalHandoff.tsrx +0 -39
- package/packages/sandbox/src/client/ChatPane.tsrx +0 -694
- package/packages/sandbox/src/client/ConnectView.tsrx +0 -86
- package/packages/sandbox/src/client/DiffPane.tsrx +0 -150
- package/packages/sandbox/src/client/EjectModal.tsrx +0 -571
- package/packages/sandbox/src/client/GateResults.tsrx +0 -60
- package/packages/sandbox/src/client/GitHubSettingsModal.tsrx +0 -219
- package/packages/sandbox/src/client/NewSessionForm.tsrx +0 -214
- package/packages/sandbox/src/client/SessionBar.tsrx +0 -151
- package/packages/sandbox/src/client/SessionPicker.tsrx +0 -472
- package/packages/sandbox/src/client/SpecEditor.tsrx +0 -109
- package/packages/sandbox/src/client/SpecReviewCard.tsrx +0 -321
- package/packages/sandbox/src/client/WorkCard.tsrx +0 -128
- package/packages/sandbox/src/client/WorkbenchModal.tsrx +0 -161
- package/packages/sandbox/src/client/WorkspaceMenu.tsrx +0 -100
- package/packages/sandbox/src/client/api.ts +0 -797
- package/packages/sandbox/src/client/attachments.ts +0 -73
- package/packages/sandbox/src/client/dashboard.ts +0 -46
- package/packages/sandbox/src/client/github-settings.ts +0 -48
- package/packages/sandbox/src/client/highlight.ts +0 -105
- package/packages/sandbox/src/client/i18n.ts +0 -32
- package/packages/sandbox/src/client/locales/en.json +0 -466
- package/packages/sandbox/src/client/locales/pl.json +0 -466
- package/packages/sandbox/src/client/session-labels.ts +0 -77
- package/packages/sandbox/src/client/state.ts +0 -108
- package/packages/sandbox/src/index.ts +0 -10
- package/packages/sandbox/src/preview/PreviewHost.tsrx +0 -373
- package/packages/sandbox/src/preview/load-module.ts +0 -16
- package/packages/sandbox/src/server/attachments.ts +0 -308
- package/packages/sandbox/src/server/auto-review.ts +0 -181
- package/packages/sandbox/src/server/checkpoints.ts +0 -90
- package/packages/sandbox/src/server/config.ts +0 -460
- package/packages/sandbox/src/server/dashboard.ts +0 -245
- package/packages/sandbox/src/server/delivery/configuration.ts +0 -193
- package/packages/sandbox/src/server/delivery/git-pr.ts +0 -1473
- package/packages/sandbox/src/server/delivery/index.ts +0 -83
- package/packages/sandbox/src/server/delivery/local.ts +0 -151
- package/packages/sandbox/src/server/delivery/official-modules.ts +0 -516
- package/packages/sandbox/src/server/delivery/plan.ts +0 -218
- package/packages/sandbox/src/server/delivery/policies.ts +0 -239
- package/packages/sandbox/src/server/delivery/record.ts +0 -41
- package/packages/sandbox/src/server/delivery/steps.ts +0 -464
- package/packages/sandbox/src/server/delivery/types.ts +0 -158
- package/packages/sandbox/src/server/dependencies.ts +0 -88
- package/packages/sandbox/src/server/diff.ts +0 -230
- package/packages/sandbox/src/server/gates.ts +0 -388
- package/packages/sandbox/src/server/index.ts +0 -139
- package/packages/sandbox/src/server/path-guard.ts +0 -282
- package/packages/sandbox/src/server/planning.ts +0 -749
- package/packages/sandbox/src/server/platform-client.ts +0 -189
- package/packages/sandbox/src/server/preview-database-host.ts +0 -340
- package/packages/sandbox/src/server/preview-database-protocol.ts +0 -163
- package/packages/sandbox/src/server/preview-database-proxy.ts +0 -356
- package/packages/sandbox/src/server/preview-database.ts +0 -109
- package/packages/sandbox/src/server/preview-ipc.ts +0 -15
- package/packages/sandbox/src/server/preview-modules.ts +0 -83
- package/packages/sandbox/src/server/preview-revision.ts +0 -44
- package/packages/sandbox/src/server/preview-runtime.ts +0 -467
- package/packages/sandbox/src/server/preview-worker-manager.ts +0 -436
- package/packages/sandbox/src/server/preview-worker.ts +0 -168
- package/packages/sandbox/src/server/reference.ts +0 -251
- package/packages/sandbox/src/server/routes.ts +0 -2258
- package/packages/sandbox/src/server/runtime.ts +0 -188
- package/packages/sandbox/src/server/session-owner.ts +0 -23
- package/packages/sandbox/src/server/sessions.ts +0 -849
- package/packages/sandbox/src/server/spec.ts +0 -471
- package/packages/sandbox/src/server/turn-lifecycle.ts +0 -56
- package/packages/sandbox/src/server/turns.ts +0 -993
- package/packages/sandbox/src/server/workspace-install.ts +0 -266
- package/packages/sandbox/src/server/workspace-root.ts +0 -73
- package/packages/sandbox/src/styles.css +0 -1573
- package/packages/sandbox/vite.config.ts +0 -133
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { SandboxSetupError } from '../workspace-root.ts';
|
|
4
|
-
import type { DeliveryProvider, EjectTarget } from './types.ts';
|
|
5
|
-
|
|
6
|
-
export type GitPushMode = 'auto' | 'direct' | 'fork';
|
|
7
|
-
|
|
8
|
-
export interface GitDeliveryConfiguration {
|
|
9
|
-
readonly remote: string;
|
|
10
|
-
readonly repository: string | null;
|
|
11
|
-
readonly baseBranch: string;
|
|
12
|
-
readonly branchPrefix: string;
|
|
13
|
-
readonly provider: DeliveryProvider;
|
|
14
|
-
readonly mode: GitPushMode;
|
|
15
|
-
readonly forkOwner: string | null;
|
|
16
|
-
readonly reviewers: readonly string[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* The sandbox.delivery block of flowdular.json. Every field is optional there;
|
|
20
|
-
this is the resolved shape the sandbox works with. */
|
|
21
|
-
export interface DeliveryConfiguration {
|
|
22
|
-
readonly default: EjectTarget;
|
|
23
|
-
readonly targets: readonly EjectTarget[];
|
|
24
|
-
readonly git: GitDeliveryConfiguration;
|
|
25
|
-
/* Overrides the task budget from .ai/policies/task-budgets.yaml when set. */
|
|
26
|
-
readonly maxChangedFiles: number | null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const DEFAULT_DELIVERY_CONFIGURATION: DeliveryConfiguration = {
|
|
30
|
-
default: 'workspace',
|
|
31
|
-
targets: ['workspace', 'git-pr', 'official-modules'],
|
|
32
|
-
git: {
|
|
33
|
-
remote: 'origin',
|
|
34
|
-
repository: null,
|
|
35
|
-
baseBranch: 'main',
|
|
36
|
-
branchPrefix: 'sandbox',
|
|
37
|
-
provider: 'github',
|
|
38
|
-
mode: 'auto',
|
|
39
|
-
forkOwner: null,
|
|
40
|
-
reviewers: [],
|
|
41
|
-
},
|
|
42
|
-
maxChangedFiles: null,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const EJECT_TARGETS: readonly EjectTarget[] = [
|
|
46
|
-
'workspace',
|
|
47
|
-
'git-pr',
|
|
48
|
-
'official-modules',
|
|
49
|
-
];
|
|
50
|
-
/* Remote, branch, and prefix become git arguments; a value that starts with a
|
|
51
|
-
dash would be read as an option. */
|
|
52
|
-
const GIT_NAME = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;
|
|
53
|
-
const MAX_GIT_NAME_LENGTH = 120;
|
|
54
|
-
const MAX_GITHUB_REVIEWERS = 20;
|
|
55
|
-
const GITHUB_REPOSITORY =
|
|
56
|
-
/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
|
|
57
|
-
const GITHUB_ACCOUNT = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/;
|
|
58
|
-
|
|
59
|
-
function invalid(detail: string): SandboxSetupError {
|
|
60
|
-
return new SandboxSetupError(
|
|
61
|
-
'DELIVERY_CONFIG_INVALID',
|
|
62
|
-
`flowdular.json sandbox.delivery is not usable: ${detail}`,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
67
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function isEjectTarget(value: unknown): value is EjectTarget {
|
|
71
|
-
return typeof value === 'string' && EJECT_TARGETS.includes(value as never);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function gitName(value: unknown, fallback: string, field: string): string {
|
|
75
|
-
if (value === undefined) return fallback;
|
|
76
|
-
if (
|
|
77
|
-
typeof value !== 'string' ||
|
|
78
|
-
value.length > MAX_GIT_NAME_LENGTH ||
|
|
79
|
-
!GIT_NAME.test(value)
|
|
80
|
-
) {
|
|
81
|
-
throw invalid(`git.${field} must be a plain git name.`);
|
|
82
|
-
}
|
|
83
|
-
return value;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export function resolveDeliveryConfiguration(
|
|
87
|
-
block: unknown,
|
|
88
|
-
): DeliveryConfiguration {
|
|
89
|
-
if (block === undefined) return DEFAULT_DELIVERY_CONFIGURATION;
|
|
90
|
-
if (!isRecord(block)) throw invalid('it must be an object.');
|
|
91
|
-
const defaults = DEFAULT_DELIVERY_CONFIGURATION;
|
|
92
|
-
let targets = defaults.targets;
|
|
93
|
-
if (block.targets !== undefined) {
|
|
94
|
-
if (
|
|
95
|
-
!Array.isArray(block.targets) ||
|
|
96
|
-
block.targets.length === 0 ||
|
|
97
|
-
!block.targets.every(isEjectTarget)
|
|
98
|
-
) {
|
|
99
|
-
throw invalid('targets must list workspace, git-pr or official-modules.');
|
|
100
|
-
}
|
|
101
|
-
targets = [...new Set(block.targets)];
|
|
102
|
-
}
|
|
103
|
-
const fallback = block.default ?? defaults.default;
|
|
104
|
-
if (!isEjectTarget(fallback) || !targets.includes(fallback)) {
|
|
105
|
-
throw invalid('default must be one of the listed targets.');
|
|
106
|
-
}
|
|
107
|
-
const git = isRecord(block.git) ? block.git : {};
|
|
108
|
-
if (block.git !== undefined && !isRecord(block.git)) {
|
|
109
|
-
throw invalid('git must be an object.');
|
|
110
|
-
}
|
|
111
|
-
const provider = git.provider ?? defaults.git.provider;
|
|
112
|
-
if (provider !== 'github' && provider !== 'none') {
|
|
113
|
-
throw invalid('git.provider must be github or none.');
|
|
114
|
-
}
|
|
115
|
-
const mode = git.mode ?? defaults.git.mode;
|
|
116
|
-
if (mode !== 'auto' && mode !== 'direct' && mode !== 'fork') {
|
|
117
|
-
throw invalid('git.mode must be auto, direct, or fork.');
|
|
118
|
-
}
|
|
119
|
-
const repository = git.repository ?? defaults.git.repository;
|
|
120
|
-
if (
|
|
121
|
-
repository !== null &&
|
|
122
|
-
(typeof repository !== 'string' || !GITHUB_REPOSITORY.test(repository))
|
|
123
|
-
) {
|
|
124
|
-
throw invalid('git.repository must use the owner/name form.');
|
|
125
|
-
}
|
|
126
|
-
const forkOwner = git.forkOwner ?? defaults.git.forkOwner;
|
|
127
|
-
if (
|
|
128
|
-
forkOwner !== null &&
|
|
129
|
-
(typeof forkOwner !== 'string' || !GITHUB_ACCOUNT.test(forkOwner))
|
|
130
|
-
) {
|
|
131
|
-
throw invalid('git.forkOwner must be a GitHub account name.');
|
|
132
|
-
}
|
|
133
|
-
const reviewers = git.reviewers ?? defaults.git.reviewers;
|
|
134
|
-
if (
|
|
135
|
-
!Array.isArray(reviewers) ||
|
|
136
|
-
reviewers.length > MAX_GITHUB_REVIEWERS ||
|
|
137
|
-
!reviewers.every(
|
|
138
|
-
(reviewer) =>
|
|
139
|
-
typeof reviewer === 'string' && GITHUB_ACCOUNT.test(reviewer),
|
|
140
|
-
)
|
|
141
|
-
) {
|
|
142
|
-
throw invalid('git.reviewers must list account names.');
|
|
143
|
-
}
|
|
144
|
-
const maxChangedFiles = block.maxChangedFiles ?? null;
|
|
145
|
-
if (
|
|
146
|
-
maxChangedFiles !== null &&
|
|
147
|
-
(!Number.isInteger(maxChangedFiles) || (maxChangedFiles as number) < 1)
|
|
148
|
-
) {
|
|
149
|
-
throw invalid('maxChangedFiles must be a positive integer.');
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
default: fallback,
|
|
153
|
-
targets,
|
|
154
|
-
git: {
|
|
155
|
-
remote: gitName(git.remote, defaults.git.remote, 'remote'),
|
|
156
|
-
repository: repository as string | null,
|
|
157
|
-
baseBranch: gitName(
|
|
158
|
-
git.baseBranch,
|
|
159
|
-
defaults.git.baseBranch,
|
|
160
|
-
'baseBranch',
|
|
161
|
-
),
|
|
162
|
-
branchPrefix: gitName(
|
|
163
|
-
git.branchPrefix,
|
|
164
|
-
defaults.git.branchPrefix,
|
|
165
|
-
'branchPrefix',
|
|
166
|
-
),
|
|
167
|
-
provider,
|
|
168
|
-
mode,
|
|
169
|
-
forkOwner: forkOwner as string | null,
|
|
170
|
-
reviewers: reviewers as readonly string[],
|
|
171
|
-
},
|
|
172
|
-
maxChangedFiles: maxChangedFiles as number | null,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* Read at request time, so an operator who edits flowdular.json does not have
|
|
177
|
-
to restart the sandbox for the delivery settings to apply. */
|
|
178
|
-
export async function readDeliveryConfiguration(
|
|
179
|
-
workspaceRoot: string,
|
|
180
|
-
): Promise<DeliveryConfiguration> {
|
|
181
|
-
let project: unknown;
|
|
182
|
-
try {
|
|
183
|
-
project = JSON.parse(
|
|
184
|
-
await readFile(join(workspaceRoot, 'flowdular.json'), 'utf8'),
|
|
185
|
-
);
|
|
186
|
-
} catch {
|
|
187
|
-
return DEFAULT_DELIVERY_CONFIGURATION;
|
|
188
|
-
}
|
|
189
|
-
const sandbox = isRecord(project) ? project.sandbox : undefined;
|
|
190
|
-
return resolveDeliveryConfiguration(
|
|
191
|
-
isRecord(sandbox) ? sandbox.delivery : undefined,
|
|
192
|
-
);
|
|
193
|
-
}
|