@bakers-build/core 0.8.1-next.1 → 0.8.1-next.10
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/dist/src/cli/machine-connection.d.ts +2 -0
- package/dist/src/cli/machine-connection.js +47 -0
- package/dist/src/cli/machine-context.d.ts +1 -0
- package/dist/src/config-types.generated.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/package.json +2 -2
- package/schema/harness-options.schema.json +46 -14
- package/schema/machine.schema.json +4 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isIP } from 'node:net';
|
|
2
|
+
/** Public connection addresses only; preserve the original spelling for copy. */
|
|
3
|
+
export function isValidMachineConnectionUrl(value) {
|
|
4
|
+
if (typeof value !== 'string' ||
|
|
5
|
+
value.length > 2048 ||
|
|
6
|
+
// Printable ASCII only: the server applies the same rule, and link text cannot be spoofed.
|
|
7
|
+
/[^\x21-\x7e]|\\/.test(value))
|
|
8
|
+
return false;
|
|
9
|
+
const parts = /^(ssh|https):\/\/([^/?#]+)(.*)$/i.exec(value);
|
|
10
|
+
if (!parts)
|
|
11
|
+
return false;
|
|
12
|
+
try {
|
|
13
|
+
// U+180E: PCRE's \s on the server covers it, JavaScript's does not.
|
|
14
|
+
if (/[\s\p{Cc}\u180e]/u.test(decodeURIComponent(value)))
|
|
15
|
+
return false;
|
|
16
|
+
const [, scheme = '', authority = '', tail] = parts;
|
|
17
|
+
const ssh = scheme.toLowerCase() === 'ssh';
|
|
18
|
+
if (ssh && tail !== '' && tail !== '/')
|
|
19
|
+
return false;
|
|
20
|
+
const hostPart = authority.split('@');
|
|
21
|
+
if (hostPart.length > 2 || (!ssh && hostPart.length > 1))
|
|
22
|
+
return false;
|
|
23
|
+
if (hostPart.length === 2 &&
|
|
24
|
+
(!hostPart[0] || /[:/?#@]/.test(decodeURIComponent(hostPart[0]))))
|
|
25
|
+
return false;
|
|
26
|
+
const hostPort = hostPart.at(-1) ?? '';
|
|
27
|
+
const match = /^(\[[^\]]+\]|[^:]+)(?::([0-9]+))?$/.exec(hostPort);
|
|
28
|
+
if (!match)
|
|
29
|
+
return false;
|
|
30
|
+
const [, host = '', port] = match;
|
|
31
|
+
if (port !== undefined && (Number(port) < 1 || Number(port) > 65535))
|
|
32
|
+
return false;
|
|
33
|
+
// isIP accepts zone IDs (fe80::1%eth0); the server does not.
|
|
34
|
+
if (host.startsWith('['))
|
|
35
|
+
return !host.includes('%') && isIP(host.slice(1, -1)) === 6;
|
|
36
|
+
if (/^[0-9.]+$/.test(host))
|
|
37
|
+
return isIP(host) === 4;
|
|
38
|
+
return (host.length <= 253 &&
|
|
39
|
+
host
|
|
40
|
+
.replace(/\.$/, '')
|
|
41
|
+
.split('.')
|
|
42
|
+
.every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i.test(label)));
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -19,6 +19,7 @@ export interface MachineContext {
|
|
|
19
19
|
machine_id: string;
|
|
20
20
|
/** Display name for people; never a key. */
|
|
21
21
|
label: string;
|
|
22
|
+
connection_url?: string | null;
|
|
22
23
|
/** Optional selection policy for the agents the machine `addons[]` contribute. */
|
|
23
24
|
agents?: MachineAgentPolicy;
|
|
24
25
|
/**
|
|
@@ -99,6 +99,8 @@ export interface MachineConfig {
|
|
|
99
99
|
machine_id: string;
|
|
100
100
|
/** Display name for people. */
|
|
101
101
|
label: string;
|
|
102
|
+
/** Public SSH or HTTPS connection address; null clears it at the next conductor start. */
|
|
103
|
+
connection_url?: string | null;
|
|
102
104
|
/** Selection policy for the agents the addons contribute. */
|
|
103
105
|
agents?: {
|
|
104
106
|
/** Extra agent variants built from installed harnesses. */
|
package/dist/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { addonOptionProblems, assertValidConfig, type ConfigKind, checkConfigTex
|
|
|
10
10
|
export { HOME_IMPORT_EXPRESSION_PATTERN, importConfig, } from './cli/import-config.js';
|
|
11
11
|
export { type LayeredUiEntryLayer, machineUiConfigPath, projectConductorConfigPath, readUiEntryLayers, } from './cli/layered-ui-entries.js';
|
|
12
12
|
export { type BbConnectionConfig, BbConnectionConfigError, type BbConnectionGlobals, type BbConnectionLoadOptions, type BbConnectionSelection, type EffectiveConnectionField, loadBbConfig, loadBbConnectionBootstrap, reportLoadedBbConfigFields, resolveBbConnectionSelection, } from './cli/load-bakers-config.js';
|
|
13
|
+
export { isValidMachineConnectionUrl } from './cli/machine-connection.js';
|
|
13
14
|
export { type AgentRoutes, assertSchemaVersion, CONFIG_SCHEMA_VERSION, type MachineContext, machineContextPath, readMachineContext, resolveMachineContextPath, } from './cli/machine-context.js';
|
|
14
15
|
export { corePackageRoot } from './cli/paths.js';
|
|
15
16
|
export { resolveModuleEslintStyle } from './cli/resolve-module.js';
|
package/dist/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { addonOptionProblems, assertValidConfig, checkConfigText, configAjv, cor
|
|
|
12
12
|
export { HOME_IMPORT_EXPRESSION_PATTERN, importConfig, } from './cli/import-config.js';
|
|
13
13
|
export { machineUiConfigPath, projectConductorConfigPath, readUiEntryLayers, } from './cli/layered-ui-entries.js';
|
|
14
14
|
export { BbConnectionConfigError, loadBbConfig, loadBbConnectionBootstrap, reportLoadedBbConfigFields, resolveBbConnectionSelection, } from './cli/load-bakers-config.js';
|
|
15
|
+
export { isValidMachineConnectionUrl } from './cli/machine-connection.js';
|
|
15
16
|
export { assertSchemaVersion, CONFIG_SCHEMA_VERSION, machineContextPath, readMachineContext, resolveMachineContextPath, } from './cli/machine-context.js';
|
|
16
17
|
export { corePackageRoot } from './cli/paths.js';
|
|
17
18
|
export { resolveModuleEslintStyle } from './cli/resolve-module.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/core",
|
|
3
|
-
"version": "0.8.1-next.
|
|
3
|
+
"version": "0.8.1-next.10",
|
|
4
4
|
"description": "bakers.build surface-agnostic kernel: host contract, split-config helpers, addon preset/discovery machinery, shared primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"yaml": "^2.7.0"
|
|
41
41
|
},
|
|
42
42
|
"bakersBuild": {
|
|
43
|
-
"commit": "
|
|
43
|
+
"commit": "ceb44a12624feaa85cb2b0c9f84345399b38bf50",
|
|
44
44
|
"channel": "next"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -7,40 +7,72 @@
|
|
|
7
7
|
"properties": {
|
|
8
8
|
"args": {
|
|
9
9
|
"type": "array",
|
|
10
|
-
"items": {
|
|
11
|
-
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "string"
|
|
12
|
+
},
|
|
13
|
+
"description": "Extra command-line arguments appended to the agent launch, each shell-quoted.",
|
|
14
|
+
"default": []
|
|
15
|
+
},
|
|
16
|
+
"model": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Model the agent runs."
|
|
12
19
|
},
|
|
13
|
-
"model": { "type": "string", "description": "Model the agent runs." },
|
|
14
20
|
"effort": {
|
|
15
21
|
"type": "string",
|
|
16
22
|
"description": "Reasoning effort the agent runs at."
|
|
17
23
|
},
|
|
18
24
|
"permissions": {
|
|
19
|
-
"enum": [
|
|
20
|
-
|
|
25
|
+
"enum": [
|
|
26
|
+
"sandbox",
|
|
27
|
+
"system",
|
|
28
|
+
"yolo",
|
|
29
|
+
"custom"
|
|
30
|
+
],
|
|
31
|
+
"description": "Permission mode: how strictly a run starts; see the addon's Security section.",
|
|
32
|
+
"default": "system"
|
|
21
33
|
},
|
|
22
34
|
"sandbox": {
|
|
23
35
|
"type": "object",
|
|
24
|
-
"description": "Sandbox lists; only valid with permissions: 'sandbox'.",
|
|
36
|
+
"description": "Sandbox lists; only valid with `permissions: 'sandbox'`. Each key set replaces its default; lists are not merged.",
|
|
25
37
|
"properties": {
|
|
26
|
-
"trusted_commands": {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
38
|
+
"trusted_commands": {
|
|
39
|
+
"$ref": "#/$defs/string_list",
|
|
40
|
+
"description": "Commands that run outside the sandbox."
|
|
41
|
+
},
|
|
42
|
+
"deny_read": {
|
|
43
|
+
"$ref": "#/$defs/string_list",
|
|
44
|
+
"description": "Paths the agent may not read."
|
|
45
|
+
},
|
|
46
|
+
"allow_write": {
|
|
47
|
+
"$ref": "#/$defs/string_list",
|
|
48
|
+
"description": "Paths the agent may write besides the worktree and the temporary directory."
|
|
49
|
+
},
|
|
50
|
+
"network": {
|
|
51
|
+
"$ref": "#/$defs/string_list",
|
|
52
|
+
"description": "Hosts the agent may reach; `*` allows every host."
|
|
53
|
+
},
|
|
54
|
+
"mcp_servers": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"description": "MCP servers of a sandboxed run, in the agent's own shape; the `bakers` server is always added."
|
|
57
|
+
}
|
|
31
58
|
},
|
|
32
59
|
"additionalProperties": false
|
|
33
60
|
},
|
|
34
61
|
"config": {
|
|
35
62
|
"type": "object",
|
|
36
|
-
"description": "The agent's own permission configuration; only valid with permissions: 'custom'
|
|
63
|
+
"description": "The agent's own permission configuration; required with, and only valid with, `permissions: 'custom'`."
|
|
37
64
|
},
|
|
38
65
|
"env_deny": {
|
|
39
66
|
"$ref": "#/$defs/string_list",
|
|
40
|
-
"description": "
|
|
67
|
+
"description": "Ticket environment variable names (`*` globs) removed from the run environment; replaces the default list."
|
|
41
68
|
}
|
|
42
69
|
},
|
|
43
70
|
"$defs": {
|
|
44
|
-
"string_list": {
|
|
71
|
+
"string_list": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
45
77
|
}
|
|
46
78
|
}
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
"$ref": "project.schema.json#/$defs/nonempty",
|
|
18
18
|
"description": "Display name for people."
|
|
19
19
|
},
|
|
20
|
+
"connection_url": {
|
|
21
|
+
"anyOf": [{ "type": "string" }, { "type": "null" }],
|
|
22
|
+
"description": "Public SSH or HTTPS connection address; null clears it at the next conductor start."
|
|
23
|
+
},
|
|
20
24
|
"agents": {
|
|
21
25
|
"type": "object",
|
|
22
26
|
"description": "Selection policy for the agents the addons contribute.",
|