@kosuke-ai/cli 1.0.1-next.5 → 1.0.1-next.6

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 (82) hide show
  1. package/README.md +104 -0
  2. package/dist/commands/mcp.js +85 -0
  3. package/dist/generated/tools/deploy/cancel.js +20 -0
  4. package/dist/generated/tools/deploy/messages.js +20 -0
  5. package/dist/generated/tools/deploy/run.js +52 -0
  6. package/dist/generated/tools/index.js +138 -0
  7. package/dist/generated/tools/preview/get.js +24 -0
  8. package/dist/generated/tools/preview/health.js +24 -0
  9. package/dist/generated/tools/preview/reset.js +23 -0
  10. package/dist/generated/tools/preview/share-create.js +24 -0
  11. package/dist/generated/tools/preview/share-delete.js +24 -0
  12. package/dist/generated/tools/preview/share-get.js +24 -0
  13. package/dist/generated/tools/preview/shared-artifact.js +25 -0
  14. package/dist/generated/tools/preview/shared.js +20 -0
  15. package/dist/generated/tools/projects/create.js +26 -0
  16. package/dist/generated/tools/projects/delete.js +20 -0
  17. package/dist/generated/tools/projects/env-vars-add.js +50 -0
  18. package/dist/generated/tools/projects/env-vars-remove.js +31 -0
  19. package/dist/generated/tools/projects/get.js +20 -0
  20. package/dist/generated/tools/projects/list.js +12 -0
  21. package/dist/generated/tools/projects/services-add.js +111 -0
  22. package/dist/generated/tools/projects/services-list.js +20 -0
  23. package/dist/generated/tools/projects/services-remove.js +25 -0
  24. package/dist/generated/tools/projects/services-update.js +104 -0
  25. package/dist/generated/tools/projects/settings-get.js +20 -0
  26. package/dist/generated/tools/projects/settings-import.js +208 -0
  27. package/dist/generated/tools/projects/settings-update.js +72 -0
  28. package/dist/generated/tools/projects/skills.js +32 -0
  29. package/dist/generated/tools/projects/update.js +24 -0
  30. package/dist/generated/tools/sessions/activate.js +25 -0
  31. package/dist/generated/tools/sessions/artifacts-get.js +30 -0
  32. package/dist/generated/tools/sessions/artifacts-list.js +25 -0
  33. package/dist/generated/tools/sessions/checklist-generate.js +25 -0
  34. package/dist/generated/tools/sessions/checklist-get.js +25 -0
  35. package/dist/generated/tools/sessions/comments-add.js +53 -0
  36. package/dist/generated/tools/sessions/comments-delete.js +30 -0
  37. package/dist/generated/tools/sessions/comments-list.js +25 -0
  38. package/dist/generated/tools/sessions/comments-update.js +62 -0
  39. package/dist/generated/tools/sessions/create.js +69 -0
  40. package/dist/generated/tools/sessions/delete.js +25 -0
  41. package/dist/generated/tools/sessions/diff-files.js +25 -0
  42. package/dist/generated/tools/sessions/diff-patch.js +64 -0
  43. package/dist/generated/tools/sessions/edit-prompt.js +69 -0
  44. package/dist/generated/tools/sessions/files-get.js +30 -0
  45. package/dist/generated/tools/sessions/files-list.js +25 -0
  46. package/dist/generated/tools/sessions/files-write.js +37 -0
  47. package/dist/generated/tools/sessions/get.js +25 -0
  48. package/dist/generated/tools/sessions/git-commit-message.js +25 -0
  49. package/dist/generated/tools/sessions/git-commit.js +29 -0
  50. package/dist/generated/tools/sessions/git-push.js +25 -0
  51. package/dist/generated/tools/sessions/git-state.js +25 -0
  52. package/dist/generated/tools/sessions/jobs-cancel.js +30 -0
  53. package/dist/generated/tools/sessions/jobs-get.js +30 -0
  54. package/dist/generated/tools/sessions/list.js +56 -0
  55. package/dist/generated/tools/sessions/messages.js +25 -0
  56. package/dist/generated/tools/sessions/search.js +17 -0
  57. package/dist/generated/tools/sessions/send.js +137 -0
  58. package/dist/generated/tools/sessions/update.js +63 -0
  59. package/dist/generated/tools/workspaces/access-status.js +28 -0
  60. package/dist/generated/tools/workspaces/ai-provider-get.js +20 -0
  61. package/dist/generated/tools/workspaces/ai-provider-remove.js +39 -0
  62. package/dist/generated/tools/workspaces/ai-provider-set.js +106 -0
  63. package/dist/generated/tools/workspaces/credits.js +20 -0
  64. package/dist/generated/tools/workspaces/get.js +20 -0
  65. package/dist/generated/tools/workspaces/getting-started-get.js +20 -0
  66. package/dist/generated/tools/workspaces/getting-started-update.js +27 -0
  67. package/dist/generated/tools/workspaces/list.js +12 -0
  68. package/dist/generated/tools/workspaces/members.js +24 -0
  69. package/dist/generated/tools/workspaces/sandbox-limit.js +20 -0
  70. package/dist/generated/tools/workspaces/stop-sandboxes.js +31 -0
  71. package/dist/generated/tools/workspaces/usage.js +28 -0
  72. package/dist/program.js +4 -2
  73. package/dist/runtime/mcp-attachments.js +110 -0
  74. package/dist/runtime/mcp-composite-support.js +49 -0
  75. package/dist/runtime/mcp-composite.js +309 -0
  76. package/dist/runtime/mcp-guard.js +74 -0
  77. package/dist/runtime/mcp-invoke.js +123 -0
  78. package/dist/runtime/mcp-open-pr.js +83 -0
  79. package/dist/runtime/mcp-redact.js +31 -0
  80. package/dist/runtime/mcp-server.js +219 -0
  81. package/dist/runtime/mcp-tool.js +6 -0
  82. package/package.json +2 -1
@@ -0,0 +1,50 @@
1
+ import { operation } from '../../commands/projects/env-vars-add.js';
2
+ export const tool = {
3
+ "name": "projects_env_vars_add",
4
+ "toolset": "projects",
5
+ "description": "Add environment variables. The body is a JSON array of { key, value, isSecret? }.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "body": {
14
+ "description": "The whole request body.",
15
+ "minItems": 1,
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "value": {
21
+ "type": "string",
22
+ "description": "The environment variable value. Supports {{placeholder}} syntax resolved at sandbox startup. Available placeholders: {{<service_name>.url}} — public HTTPS URL of a service (only for public services). {{<service_name>.url_int}} — internal localhost URL of a service (e.g. http://localhost:3000). "
23
+ },
24
+ "isSecret": {
25
+ "default": false,
26
+ "description": "Whether this variable contains sensitive data. Secret values are masked in the UI and encrypted at rest.",
27
+ "type": "boolean"
28
+ },
29
+ "key": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 255,
33
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
34
+ }
35
+ },
36
+ "required": [
37
+ "value",
38
+ "key"
39
+ ]
40
+ }
41
+ }
42
+ },
43
+ "required": [
44
+ "projectId",
45
+ "body"
46
+ ],
47
+ "additionalProperties": false
48
+ },
49
+ operation,
50
+ };
@@ -0,0 +1,31 @@
1
+ import { operation } from '../../commands/projects/env-vars-remove.js';
2
+ export const tool = {
3
+ "name": "projects_env_vars_remove",
4
+ "toolset": "projects",
5
+ "description": "Remove environment variables. The body is a JSON array of variable ids.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "body": {
14
+ "description": "The whole request body.",
15
+ "minItems": 1,
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string",
19
+ "format": "uuid",
20
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
21
+ }
22
+ }
23
+ },
24
+ "required": [
25
+ "projectId",
26
+ "body"
27
+ ],
28
+ "additionalProperties": false
29
+ },
30
+ operation,
31
+ };
@@ -0,0 +1,20 @@
1
+ import { operation } from '../../commands/projects/get.js';
2
+ export const tool = {
3
+ "name": "projects_get",
4
+ "toolset": "projects",
5
+ "description": "Read one project.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ }
13
+ },
14
+ "required": [
15
+ "projectId"
16
+ ],
17
+ "additionalProperties": false
18
+ },
19
+ operation,
20
+ };
@@ -0,0 +1,12 @@
1
+ import { operation } from '../../commands/projects/list.js';
2
+ export const tool = {
3
+ "name": "projects_list",
4
+ "toolset": "projects",
5
+ "description": "List the projects you can reach. With an auth token this spans every workspace you belong to; a browser session sees only its active workspace.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {},
9
+ "additionalProperties": false
10
+ },
11
+ operation,
12
+ };
@@ -0,0 +1,111 @@
1
+ import { operation } from '../../commands/projects/services-add.js';
2
+ export const tool = {
3
+ "name": "projects_services_add",
4
+ "toolset": "projects",
5
+ "description": "Add a service. A port already used by another service is rejected by the handler.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "directory": {
14
+ "type": "string",
15
+ "description": "Relative path to the service directory within the repository (e.g. \"api\", \"apps/web\"). Defaults to repository root."
16
+ },
17
+ "kind": {
18
+ "type": "string",
19
+ "description": "Run mode. \"process\": a plain command supervised directly (apps, workers, Postgres, Redis). \"docker-stack\": a multi-container docker-compose stack (e.g. Supabase) with up/down commands.",
20
+ "enum": [
21
+ "process",
22
+ "docker-stack"
23
+ ]
24
+ },
25
+ "endpoints": {
26
+ "description": "Exposed endpoints. A service has 0..N (0 = background, no port); port/type/frontend/health are per endpoint. List the primary user-facing endpoint FIRST: it answers {{service.url}} and drives the readiness probe.",
27
+ "default": [],
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "name": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 63,
36
+ "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
37
+ "description": "Endpoint name, unique within the service (e.g. \"api\", \"studio\"). Lowercase alphanumeric with inner hyphens — non-primary endpoint names become part of the preview host."
38
+ },
39
+ "port": {
40
+ "type": "integer",
41
+ "minimum": 1,
42
+ "maximum": 65535,
43
+ "description": "Port this endpoint listens on."
44
+ },
45
+ "exposure": {
46
+ "default": "internal",
47
+ "description": "\"internal\": sandbox-only (no URL). \"public\": browser-reachable URL, not rendered. \"preview\": public URL AND shown in the preview panel.",
48
+ "type": "string",
49
+ "enum": [
50
+ "internal",
51
+ "public",
52
+ "preview"
53
+ ]
54
+ },
55
+ "healthRoute": {
56
+ "description": "HTTP readiness path (e.g. \"/api/health\"), probed with an HTTP GET. Set ONLY on HTTP services. Omit for for non-http services (e.g. datastores like Postgres/Redis/MySQL/Mongo/…). An HTTP probe against their binary wire protocol never succeeds and hangs the unit's boot.",
57
+ "type": "string",
58
+ "maxLength": 255,
59
+ "pattern": "^\\/.*"
60
+ }
61
+ },
62
+ "required": [
63
+ "name",
64
+ "port"
65
+ ]
66
+ }
67
+ },
68
+ "startCommand": {
69
+ "type": "string",
70
+ "description": "Shell command to start the service (e.g. \"npm run dev\"). The service MUST bind the first endpoint's port: pass it explicitly via a framework flag (e.g. \"next dev -p 3000\") or inline env for apps that only read process.env.PORT (e.g. \"PORT=3000 npm run dev\"). Steps that need a live dependency (migrations, seeds) belong at the front of this command; they re-run on every restart, so keep them idempotent. This command may span multiple lines — prefer that over a long single-line `&&` chain when there are several steps. For \"docker-stack\" services this is the up command (e.g. \"supabase start\")."
71
+ },
72
+ "stopCommand": {
73
+ "type": "string",
74
+ "description": "Optional command to stop the service (e.g. \"docker compose down\")."
75
+ },
76
+ "after": {
77
+ "description": "Other service names this service must start after. Ordering is readiness-gated — the service waits until its dependencies are accepting connections.",
78
+ "default": [],
79
+ "type": "array",
80
+ "items": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 100
84
+ }
85
+ },
86
+ "envFiles": {
87
+ "description": "docker-stack only: paths (relative to `directory`) to write the resolved env into as a `.env` file. Empty defaults to a single `.env`. Example: Supabase needs [\".env\", \"supabase/functions/.env\"] — the root `.env` feeds config.toml's env() interpolation, while supabase/functions/.env is read by the Edge Functions",
88
+ "default": [],
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "maxLength": 255
94
+ }
95
+ },
96
+ "name": {
97
+ "type": "string"
98
+ },
99
+ "sortOrder": {
100
+ "type": "integer"
101
+ }
102
+ },
103
+ "required": [
104
+ "projectId",
105
+ "startCommand",
106
+ "name"
107
+ ],
108
+ "additionalProperties": false
109
+ },
110
+ operation,
111
+ };
@@ -0,0 +1,20 @@
1
+ import { operation } from '../../commands/projects/services-list.js';
2
+ export const tool = {
3
+ "name": "projects_services_list",
4
+ "toolset": "projects",
5
+ "description": "List the project services, in the order they start. Carries no environment variables.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ }
13
+ },
14
+ "required": [
15
+ "projectId"
16
+ ],
17
+ "additionalProperties": false
18
+ },
19
+ operation,
20
+ };
@@ -0,0 +1,25 @@
1
+ import { operation } from '../../commands/projects/services-remove.js';
2
+ export const tool = {
3
+ "name": "projects_services_remove",
4
+ "toolset": "projects",
5
+ "description": "Remove one service.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "serviceId": {
14
+ "type": "string",
15
+ "description": "Service id."
16
+ }
17
+ },
18
+ "required": [
19
+ "projectId",
20
+ "serviceId"
21
+ ],
22
+ "additionalProperties": false
23
+ },
24
+ operation,
25
+ };
@@ -0,0 +1,104 @@
1
+ import { operation } from '../../commands/projects/services-update.js';
2
+ export const tool = {
3
+ "name": "projects_services_update",
4
+ "toolset": "projects",
5
+ "description": "Change one service. Every field is optional; only the ones sent change.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "serviceId": {
14
+ "type": "string",
15
+ "description": "Service id."
16
+ },
17
+ "name": {
18
+ "type": "string"
19
+ },
20
+ "directory": {
21
+ "type": "string"
22
+ },
23
+ "kind": {
24
+ "type": "string",
25
+ "enum": [
26
+ "process",
27
+ "docker-stack"
28
+ ]
29
+ },
30
+ "endpoints": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "properties": {
35
+ "name": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 63,
39
+ "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
40
+ "description": "Endpoint name, unique within the service (e.g. \"api\", \"studio\"). Lowercase alphanumeric with inner hyphens — non-primary endpoint names become part of the preview host."
41
+ },
42
+ "port": {
43
+ "type": "integer",
44
+ "minimum": 1,
45
+ "maximum": 65535,
46
+ "description": "Port this endpoint listens on."
47
+ },
48
+ "exposure": {
49
+ "default": "internal",
50
+ "description": "\"internal\": sandbox-only (no URL). \"public\": browser-reachable URL, not rendered. \"preview\": public URL AND shown in the preview panel.",
51
+ "type": "string",
52
+ "enum": [
53
+ "internal",
54
+ "public",
55
+ "preview"
56
+ ]
57
+ },
58
+ "healthRoute": {
59
+ "description": "HTTP readiness path (e.g. \"/api/health\"), probed with an HTTP GET. Set ONLY on HTTP services. Omit for for non-http services (e.g. datastores like Postgres/Redis/MySQL/Mongo/…). An HTTP probe against their binary wire protocol never succeeds and hangs the unit's boot.",
60
+ "type": "string",
61
+ "maxLength": 255,
62
+ "pattern": "^\\/.*"
63
+ }
64
+ },
65
+ "required": [
66
+ "name",
67
+ "port"
68
+ ]
69
+ }
70
+ },
71
+ "startCommand": {
72
+ "type": "string"
73
+ },
74
+ "stopCommand": {
75
+ "type": "string"
76
+ },
77
+ "after": {
78
+ "type": "array",
79
+ "items": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 100
83
+ }
84
+ },
85
+ "envFiles": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "maxLength": 255
91
+ }
92
+ },
93
+ "sortOrder": {
94
+ "type": "integer"
95
+ }
96
+ },
97
+ "required": [
98
+ "projectId",
99
+ "serviceId"
100
+ ],
101
+ "additionalProperties": false
102
+ },
103
+ operation,
104
+ };
@@ -0,0 +1,20 @@
1
+ import { operation } from '../../commands/projects/settings-get.js';
2
+ export const tool = {
3
+ "name": "projects_settings_get",
4
+ "toolset": "projects",
5
+ "description": "Read the project settings: setup commands, services, environment and sandbox size.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ }
13
+ },
14
+ "required": [
15
+ "projectId"
16
+ ],
17
+ "additionalProperties": false
18
+ },
19
+ operation,
20
+ };
@@ -0,0 +1,208 @@
1
+ import { operation } from '../../commands/projects/settings-import.js';
2
+ export const tool = {
3
+ "name": "projects_settings_import",
4
+ "toolset": "projects",
5
+ "description": "Replace the services and environment from a kosuke.config.json document. Cross-service rules (unique ports, after references, one preview endpoint) are checked by the handler, not by the schema.",
6
+ "inputSchema": {
7
+ "type": "object",
8
+ "properties": {
9
+ "projectId": {
10
+ "type": "string",
11
+ "description": "Project id."
12
+ },
13
+ "hostSetupCommand": {
14
+ "type": [
15
+ "string",
16
+ "null"
17
+ ],
18
+ "description": "Shell command that runs once on first deploy (or when its content changes) to provision the host: install runtimes and system packages. Re-runs only when edited."
19
+ },
20
+ "setupCommand": {
21
+ "type": [
22
+ "string",
23
+ "null"
24
+ ],
25
+ "description": "Shell command that runs at repository root on every deploy, strictly BEFORE any service starts. Services from this config (databases included) are not reachable from it. Use it for installing dependencies; run migrations and seeds at the front of the dependent service's startCommand instead."
26
+ },
27
+ "warmupCommand": {
28
+ "type": [
29
+ "string",
30
+ "null"
31
+ ],
32
+ "description": "Shell command that runs inside the sandbox once services are healthy. Typically authenticates and curls heavy routes to warm up compilation cache."
33
+ },
34
+ "agentWorkDir": {
35
+ "type": [
36
+ "string",
37
+ "null"
38
+ ],
39
+ "description": "Relative path from the repository root where the AI agent operates. Useful for monorepos where the agent should work only in a subdirectory (e.g. \"packages/frontend\"). Defaults to repository root."
40
+ },
41
+ "sessionBaseBranch": {
42
+ "type": [
43
+ "string",
44
+ "null"
45
+ ],
46
+ "description": "Git branch new coding sessions branch from (e.g. \"main\"). Null/omitted uses the repository default branch."
47
+ },
48
+ "prTargetBranch": {
49
+ "type": [
50
+ "string",
51
+ "null"
52
+ ],
53
+ "description": "Git branch that submitted PRs target (e.g. \"main\"). Null/omitted uses the repository default branch."
54
+ },
55
+ "sandboxTier": {
56
+ "type": "string",
57
+ "description": "Sandbox resource tier provisioned for the preview: SMALL, MEDIUM, LARGE, or XLARGE. Omitted leaves the current tier. A first deploy boots on XLARGE (unknown footprint) — measure actual peak usage and set the right-sized tier here so later sandboxes use it.",
58
+ "enum": [
59
+ "SMALL",
60
+ "MEDIUM",
61
+ "LARGE",
62
+ "XLARGE"
63
+ ]
64
+ },
65
+ "services": {
66
+ "description": "Map of service name → configuration. Everything is a service — apps, workers, databases (Postgres/Redis as \"process\"), and container stacks (Supabase as \"docker-stack\"). Names must be lowercase alphanumeric with inner hyphens (they become DNS labels and systemd unit names).",
67
+ "default": {},
68
+ "type": "object",
69
+ "propertyNames": {
70
+ "type": "string",
71
+ "minLength": 1,
72
+ "maxLength": 63,
73
+ "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"
74
+ },
75
+ "additionalProperties": {
76
+ "type": "object",
77
+ "properties": {
78
+ "directory": {
79
+ "default": ".",
80
+ "description": "Relative path to the service directory within the repository (e.g. \"api\", \"apps/web\"). Defaults to repository root.",
81
+ "type": "string",
82
+ "maxLength": 255
83
+ },
84
+ "kind": {
85
+ "default": "process",
86
+ "description": "Run mode. \"process\": a plain command supervised directly (apps, workers, Postgres, Redis). \"docker-stack\": a multi-container docker-compose stack (e.g. Supabase) with up/down commands.",
87
+ "type": "string",
88
+ "enum": [
89
+ "process",
90
+ "docker-stack"
91
+ ]
92
+ },
93
+ "endpoints": {
94
+ "default": [],
95
+ "description": "Exposed endpoints. A service has 0..N (0 = background, no port); port/type/frontend/health are per endpoint. List the primary user-facing endpoint FIRST: it answers {{service.url}} and drives the readiness probe.",
96
+ "type": "array",
97
+ "items": {
98
+ "type": "object",
99
+ "properties": {
100
+ "name": {
101
+ "type": "string",
102
+ "minLength": 1,
103
+ "maxLength": 63,
104
+ "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
105
+ "description": "Endpoint name, unique within the service (e.g. \"api\", \"studio\"). Lowercase alphanumeric with inner hyphens — non-primary endpoint names become part of the preview host."
106
+ },
107
+ "port": {
108
+ "type": "integer",
109
+ "minimum": 1,
110
+ "maximum": 65535,
111
+ "description": "Port this endpoint listens on."
112
+ },
113
+ "exposure": {
114
+ "default": "internal",
115
+ "description": "\"internal\": sandbox-only (no URL). \"public\": browser-reachable URL, not rendered. \"preview\": public URL AND shown in the preview panel.",
116
+ "type": "string",
117
+ "enum": [
118
+ "internal",
119
+ "public",
120
+ "preview"
121
+ ]
122
+ },
123
+ "healthRoute": {
124
+ "description": "HTTP readiness path (e.g. \"/api/health\"), probed with an HTTP GET. Set ONLY on HTTP services. Omit for for non-http services (e.g. datastores like Postgres/Redis/MySQL/Mongo/…). An HTTP probe against their binary wire protocol never succeeds and hangs the unit's boot.",
125
+ "type": "string",
126
+ "maxLength": 255,
127
+ "pattern": "^\\/.*"
128
+ }
129
+ },
130
+ "required": [
131
+ "name",
132
+ "port"
133
+ ]
134
+ }
135
+ },
136
+ "startCommand": {
137
+ "type": "string",
138
+ "minLength": 1,
139
+ "maxLength": 500,
140
+ "description": "Shell command to start the service (e.g. \"npm run dev\"). The service MUST bind the first endpoint's port: pass it explicitly via a framework flag (e.g. \"next dev -p 3000\") or inline env for apps that only read process.env.PORT (e.g. \"PORT=3000 npm run dev\"). Steps that need a live dependency (migrations, seeds) belong at the front of this command; they re-run on every restart, so keep them idempotent. This command may span multiple lines — prefer that over a long single-line `&&` chain when there are several steps. For \"docker-stack\" services this is the up command (e.g. \"supabase start\")."
141
+ },
142
+ "stopCommand": {
143
+ "description": "Optional command to stop the service (e.g. \"docker compose down\").",
144
+ "type": "string",
145
+ "maxLength": 500
146
+ },
147
+ "after": {
148
+ "default": [],
149
+ "description": "Other service names this service must start after. Ordering is readiness-gated — the service waits until its dependencies are accepting connections.",
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string",
153
+ "minLength": 1,
154
+ "maxLength": 100
155
+ }
156
+ },
157
+ "envFiles": {
158
+ "default": [],
159
+ "description": "docker-stack only: paths (relative to `directory`) to write the resolved env into as a `.env` file. Empty defaults to a single `.env`. Example: Supabase needs [\".env\", \"supabase/functions/.env\"] — the root `.env` feeds config.toml's env() interpolation, while supabase/functions/.env is read by the Edge Functions",
160
+ "type": "array",
161
+ "items": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "maxLength": 255
165
+ }
166
+ }
167
+ },
168
+ "required": [
169
+ "startCommand"
170
+ ]
171
+ }
172
+ },
173
+ "environment": {
174
+ "description": "Map of environment variable name → value. Injected into all services at startup. Values support service-URL placeholders like {{serviceName.url}} / {{serviceName.url_int}} resolved at sandbox boot.",
175
+ "default": {},
176
+ "type": "object",
177
+ "propertyNames": {
178
+ "type": "string",
179
+ "minLength": 1,
180
+ "maxLength": 255,
181
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
182
+ },
183
+ "additionalProperties": {
184
+ "type": "object",
185
+ "properties": {
186
+ "value": {
187
+ "type": "string",
188
+ "description": "The environment variable value. Supports {{placeholder}} syntax resolved at sandbox startup. Available placeholders: {{<service_name>.url}} — public HTTPS URL of a service (only for public services). {{<service_name>.url_int}} — internal localhost URL of a service (e.g. http://localhost:3000). "
189
+ },
190
+ "isSecret": {
191
+ "default": false,
192
+ "description": "Whether this variable contains sensitive data. Secret values are masked in the UI and encrypted at rest.",
193
+ "type": "boolean"
194
+ }
195
+ },
196
+ "required": [
197
+ "value"
198
+ ]
199
+ }
200
+ }
201
+ },
202
+ "required": [
203
+ "projectId"
204
+ ],
205
+ "additionalProperties": false
206
+ },
207
+ operation,
208
+ };