@joripspace/cli 0.7.0 → 0.8.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/LICENSE +21 -21
- package/README.md +274 -243
- package/THIRD_PARTY_NOTICES.md +136 -136
- package/bin/joripspace.js +34 -163
- package/lib/approval-login.js +88 -0
- package/lib/connection-persistence.js +1 -1
- package/lib/credential-store.js +2 -2
- package/lib/deployment-error.js +14 -14
- package/lib/help.js +17 -15
- package/lib/login-command.js +19 -0
- package/lib/project-create.js +1 -1
- package/lib/secret-commands.js +5 -5
- package/lib/start-command.js +5 -6
- package/lib/start.js +1 -1
- package/package.json +48 -48
- package/vendor/core/cli-onboarding.cjs +7 -6
- package/vendor/core/onboarding.cjs +14 -17
- package/vendor/core/secret-entry.cjs +38 -0
- package/vendor/core/template-publish-workflow.cjs +169 -169
- package/vendor/templates/index.js +104 -104
- package/vendor/templates/templates/basic-worker/files/worker.js +9 -9
- package/vendor/templates/templates/basic-worker/manifest.json +14 -14
- package/vendor/templates/templates/r2-file-api/files/worker.js +42 -42
- package/vendor/templates/templates/r2-file-api/manifest.json +7 -7
package/lib/deployment-error.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function formatDeploymentFailure(message, details) {
|
|
4
|
-
if (!details || typeof details !== 'object' || !details.deployment_id) return message;
|
|
5
|
-
const lines = [message, `Deployment: ${details.deployment_id}`];
|
|
6
|
-
if (details.error_stage) lines.push(`Stage: ${details.error_stage}`);
|
|
7
|
-
if (details.error_code) lines.push(`Error code: ${details.error_code}`);
|
|
8
|
-
if (details.error_details && details.error_details !== message) {
|
|
9
|
-
lines.push(`Details: ${details.error_details}`);
|
|
10
|
-
}
|
|
11
|
-
return lines.join('\n');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = { formatDeploymentFailure };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function formatDeploymentFailure(message, details) {
|
|
4
|
+
if (!details || typeof details !== 'object' || !details.deployment_id) return message;
|
|
5
|
+
const lines = [message, `Deployment: ${details.deployment_id}`];
|
|
6
|
+
if (details.error_stage) lines.push(`Stage: ${details.error_stage}`);
|
|
7
|
+
if (details.error_code) lines.push(`Error code: ${details.error_code}`);
|
|
8
|
+
if (details.error_details && details.error_details !== message) {
|
|
9
|
+
lines.push(`Details: ${details.error_details}`);
|
|
10
|
+
}
|
|
11
|
+
return lines.join('\n');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = { formatDeploymentFailure };
|
package/lib/help.js
CHANGED
|
@@ -6,8 +6,7 @@ function printHelp() {
|
|
|
6
6
|
|
|
7
7
|
Usage:
|
|
8
8
|
joripspace login
|
|
9
|
-
joripspace login --
|
|
10
|
-
joripspace login --connect-token "CONNECTION_TOKEN" --cwd PROJECT_FOLDER
|
|
9
|
+
joripspace login --no-open --cwd PROJECT_FOLDER --json
|
|
11
10
|
joripspace logout
|
|
12
11
|
joripspace me
|
|
13
12
|
joripspace projects
|
|
@@ -42,6 +41,7 @@ Usage:
|
|
|
42
41
|
joripspace template pull --project PROJECT --token TOKEN --dir . [--yes]
|
|
43
42
|
joripspace get --project PROJECT --token TOKEN
|
|
44
43
|
joripspace report --project PROJECT --category problem|bug|feedback --summary "REPORT_SUMMARY" [--details TEXT] [--expected TEXT] [--actual TEXT] [--error-code CODE]
|
|
44
|
+
joripspace feedback --project PROJECT --summary "FEEDBACK_SUMMARY" [--details TEXT] [--expected TEXT] [--actual TEXT] [--error-code CODE]
|
|
45
45
|
joripspace deployments --project PROJECT --token TOKEN [--include-failure-details] [--json]
|
|
46
46
|
joripspace deployment get --project PROJECT --deployment DEPLOYMENT_ID --json
|
|
47
47
|
joripspace deployment pull --project PROJECT --deployment DEPLOYMENT_ID --cwd PATH [--force]
|
|
@@ -55,6 +55,7 @@ Usage:
|
|
|
55
55
|
joripspace rollback --project PROJECT --token TOKEN --deployment DEPLOYMENT_ID
|
|
56
56
|
joripspace secrets --project PROJECT
|
|
57
57
|
joripspace secret list --project PROJECT
|
|
58
|
+
joripspace secret list --project PROJECT --name API_KEY --json
|
|
58
59
|
joripspace secret generate --project PROJECT --name SESSION_SECRET
|
|
59
60
|
joripspace secret set --project PROJECT --name API_KEY --value-stdin
|
|
60
61
|
joripspace secret update --project PROJECT --name API_KEY --value-stdin
|
|
@@ -81,12 +82,12 @@ Environment:
|
|
|
81
82
|
JORIPSPACE_CONNECT_TOKEN Used when no API token is provided
|
|
82
83
|
|
|
83
84
|
Login:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
Reuse existing valid logins; otherwise login creates a five-minute approval link.
|
|
86
|
+
Agents run login --no-open --json and show approval_url from stderr.
|
|
87
|
+
Keep the process running; stdout returns one final JSON result with next_action.
|
|
88
|
+
The user signs in and approves. No code entry is needed.
|
|
89
|
+
--no-open prevents launching a browser. Errors never trigger another authentication flow.
|
|
90
|
+
If authentication is missing, do not inspect cookies, browser storage or profile pages.
|
|
90
91
|
New logins store tokens in Windows Credential Manager, macOS Keychain, or Linux Secret Service.
|
|
91
92
|
Saved connections are reused in other project folders on the same OS user account.
|
|
92
93
|
New logins prefer the OS credential store. If unavailable before writing, the token is saved
|
|
@@ -119,7 +120,7 @@ Security:
|
|
|
119
120
|
Manage members, billing, token issuance, webhooks, and project deletion in the web UI.
|
|
120
121
|
tokens current returns the current token ID without its secret.
|
|
121
122
|
tokens revoke disables a token server-side within your account. --current ends this connection;
|
|
122
|
-
|
|
123
|
+
run login to reconnect by approval link. logout only removes local credentials.
|
|
123
124
|
|
|
124
125
|
${message('Language', '언어')}:
|
|
125
126
|
${message('Messages follow the OS default locale: Korean or English. Unsupported locales use English.', '안내는 OS 기본 로캘에 따라 한국어 또는 영어로 표시합니다. 미지원 로캘은 영어를 사용합니다.')}
|
|
@@ -133,17 +134,18 @@ Global flags:
|
|
|
133
134
|
`);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
function printReportHelp() {
|
|
137
|
-
|
|
137
|
+
function printReportHelp(command = 'report') {
|
|
138
|
+
const feedback = command === 'feedback';
|
|
139
|
+
console.log(`JoripSpace ${command}
|
|
138
140
|
|
|
139
141
|
Submit a project-related problem, bug, or improvement suggestion to JoripSpace.
|
|
140
142
|
|
|
141
143
|
Usage:
|
|
142
|
-
joripspace
|
|
144
|
+
joripspace ${command} --project PROJECT ${feedback ? '' : '--category problem|bug|feedback '}--summary "SUMMARY"
|
|
143
145
|
|
|
144
146
|
Options:
|
|
145
147
|
--project PROJECT Existing project name; defaults to the current linked project.
|
|
146
|
-
--category TYPE problem (default), bug, or feedback (suggestions and improvements).
|
|
148
|
+
${feedback ? ' Category is always feedback. This command wraps report --category feedback.' : ' --category TYPE problem (default), bug, or feedback (suggestions and improvements).'}
|
|
147
149
|
--summary TEXT Required summary, up to 160 characters. --message is an alias.
|
|
148
150
|
--details TEXT Context or reproduction steps, up to 8000 characters.
|
|
149
151
|
--expected TEXT Expected behavior or desired improvement, up to 4000 characters.
|
|
@@ -153,8 +155,8 @@ Options:
|
|
|
153
155
|
--json Return structured success or failure without prompting.
|
|
154
156
|
|
|
155
157
|
Examples:
|
|
156
|
-
joripspace
|
|
157
|
-
joripspace
|
|
158
|
+
joripspace ${command}${feedback ? '' : ' --category bug'} --summary "${feedback ? 'Add filtering to deployment history' : 'Deployment status is incorrect'}"
|
|
159
|
+
joripspace feedback --summary "Add filtering to deployment history"
|
|
158
160
|
|
|
159
161
|
The command sends a report; it does not just save a local draft.
|
|
160
162
|
Use an existing login. Never include credentials, personal data, or private source.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function createLoginCommand({ ensureProjectEnvIgnored, projectWorkspaceDir, stringFlag, normalizeCredentialApiUrl, unauthenticatedApiBaseUrl, normalizeConnectToken, saveBrowserConnectToken, resolveConnection, approvalLogin }) {
|
|
2
|
+
return async function login(flags) {
|
|
3
|
+
if (flags['connect-token'] !== undefined || flags.code !== undefined || flags['legacy-code'] !== undefined) {
|
|
4
|
+
throw Object.assign(new Error('Run login without code options to approve the connection in your browser.'), { code: 'unsupported_login_option' });
|
|
5
|
+
}
|
|
6
|
+
let existing;
|
|
7
|
+
try { existing = resolveConnection(flags); }
|
|
8
|
+
catch (error) { if (error.code !== 'credential_store_unavailable') throw error; }
|
|
9
|
+
if (existing?.apiToken) {
|
|
10
|
+
try {
|
|
11
|
+
await saveBrowserConnectToken(flags, normalizeConnectToken(existing.apiToken), existing.source, existing.apiBaseUrl);
|
|
12
|
+
return;
|
|
13
|
+
} catch (error) { if (error.status !== 401) throw error; }
|
|
14
|
+
}
|
|
15
|
+
ensureProjectEnvIgnored(projectWorkspaceDir(flags, { discover: false }));
|
|
16
|
+
await approvalLogin.login({ ...flags, 'no-open': flags['no-open'] || !!flags.json }, normalizeCredentialApiUrl(unauthenticatedApiBaseUrl(flags)));
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
module.exports = { createLoginCommand };
|
package/lib/project-create.js
CHANGED
|
@@ -140,7 +140,7 @@ function loginRequired(name) {
|
|
|
140
140
|
);
|
|
141
141
|
error.exitCode = 2;
|
|
142
142
|
error.details = {
|
|
143
|
-
|
|
143
|
+
connection_method: 'approval_link',
|
|
144
144
|
login_args: ['login', '--json'],
|
|
145
145
|
resume_args: ['create', '--name', name, '--json'],
|
|
146
146
|
next_action: 'login-then-retry-create; obtain-explicit-agreement-after-login',
|
package/lib/secret-commands.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
const { message } = require('./locale');
|
|
2
|
-
|
|
3
|
-
function secretManagementUrl(project) {
|
|
4
|
-
return `https://joripspace.com/projects/${encodeURIComponent(project)}/?tab=secrets`;
|
|
5
|
-
}
|
|
2
|
+
const { secretEntryName, secretManagementUrl, secretEntryHandoff } = require('../vendor/core/secret-entry.cjs');
|
|
6
3
|
|
|
7
4
|
function createSecretCommands(deps) {
|
|
8
5
|
return async function secrets(rest, flags) {
|
|
@@ -14,12 +11,15 @@ function createSecretCommands(deps) {
|
|
|
14
11
|
throw new Error('secret command requires: list, generate, set, or update');
|
|
15
12
|
}
|
|
16
13
|
const project = deps.requireProjectId(flags);
|
|
17
|
-
const
|
|
14
|
+
const requestedName = deps.stringFlag(flags, 'name');
|
|
15
|
+
if (requestedName && !secretEntryName(requestedName)) throw new Error('Invalid or reserved secret name.');
|
|
16
|
+
const url = secretManagementUrl(project, requestedName);
|
|
18
17
|
const auth = deps.projectAuth(flags);
|
|
19
18
|
const endpoint = `/v1/projects/${encodeURIComponent(project)}/secrets`;
|
|
20
19
|
let result;
|
|
21
20
|
if (subcommand === 'list') {
|
|
22
21
|
result = await deps.apiRequest(flags, endpoint, { method: 'GET', ...auth });
|
|
22
|
+
if (requestedName) result = { ...result, secret_entry: secretEntryHandoff(project, requestedName, result.secrets || []) };
|
|
23
23
|
} else {
|
|
24
24
|
const name = deps.stringFlag(flags, 'name').toUpperCase();
|
|
25
25
|
if (!name || !/^[_A-Z][_A-Z0-9]{0,127}$/.test(name)) {
|
package/lib/start-command.js
CHANGED
|
@@ -46,8 +46,9 @@ function createStartProjectCommand(
|
|
|
46
46
|
const apiUrlArgument = connection?.apiBaseUrl
|
|
47
47
|
? ` --api-url ${quoteCliArgument(connection.apiBaseUrl)}`
|
|
48
48
|
: '';
|
|
49
|
+
const loginMethod = `--no-open --project ${quoteCliArgument(project)}`;
|
|
49
50
|
const invocation = `${executable === path.resolve(process.argv[1] || '') ? quoteCliArgument(process.execPath) + ' ' : ''}${quoteCliArgument(executable)}`;
|
|
50
|
-
const loginCommand = `${invocation} login
|
|
51
|
+
const loginCommand = `${invocation} login ${loginMethod} --cwd ${quoteCliArgument(cwd)}${apiUrlArgument} --json`;
|
|
51
52
|
const resumeCommand = `${invocation} start ${quoteCliArgument(project)} --cwd ${quoteCliArgument(cwd)} --json`;
|
|
52
53
|
const value = {
|
|
53
54
|
ok: false,
|
|
@@ -55,14 +56,12 @@ function createStartProjectCommand(
|
|
|
55
56
|
project,
|
|
56
57
|
cwd,
|
|
57
58
|
executable,
|
|
58
|
-
|
|
59
|
-
message: message(
|
|
60
|
-
'Approve the connection in your browser and exchange the displayed five-minute one-time code first.',
|
|
61
|
-
'브라우저에서 연결을 승인하고 표시된 5분 일회용 연결 코드를 먼저 교환하세요.'
|
|
62
|
-
),
|
|
59
|
+
message: message('Run login_command, show its approval_url to the user, wait for approval, then run resume_command.', 'login_command를 실행하고 반환된 승인 링크를 사용자에게 보여주세요. 연결 완료 후 resume_command를 실행하세요.'),
|
|
63
60
|
login_command: loginCommand,
|
|
64
61
|
resume_command: resumeCommand,
|
|
65
62
|
next_action: 'run-login-command-then-resume-command',
|
|
63
|
+
connection_method: 'approval_link',
|
|
64
|
+
next_command: createStartOnboarding(executable, cwd, project, false, connection?.apiBaseUrl).commands.login,
|
|
66
65
|
continue_with: 'cli',
|
|
67
66
|
onboarding: createStartOnboarding(executable, cwd, project, false, connection?.apiBaseUrl),
|
|
68
67
|
};
|
package/lib/start.js
CHANGED
|
@@ -1484,7 +1484,7 @@ function createStartOnboarding(executable, cwd, project, connected = false, apiB
|
|
|
1484
1484
|
resume: command(['start', project, '--cwd', cwd, '--json']),
|
|
1485
1485
|
help: command(['--help']),
|
|
1486
1486
|
...(!connected
|
|
1487
|
-
? { login: command(['login', '--
|
|
1487
|
+
? { login: command(['login', '--no-open', '--project', project, '--cwd', cwd, '--json']) }
|
|
1488
1488
|
: {}),
|
|
1489
1489
|
},
|
|
1490
1490
|
};
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@joripspace/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"description": "The official JoripSpace CLI. Build and deploy web apps with AI agents. Powered by Cosmosfarm.",
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"bin": {
|
|
8
|
-
"joripspace": "bin/joripspace.js"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://joripspace.com",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/JoripSpace/joripspace-cli.git"
|
|
14
|
-
},
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/JoripSpace/joripspace-cli/issues"
|
|
17
|
-
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public",
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
21
|
-
},
|
|
22
|
-
"engines": {
|
|
23
|
-
"node": ">=18"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"bin/joripspace.js",
|
|
27
|
-
"lib/*.js",
|
|
28
|
-
"vendor/core/*.cjs",
|
|
29
|
-
"vendor/templates/index.js",
|
|
30
|
-
"vendor/templates/templates/**",
|
|
31
|
-
"README.md",
|
|
32
|
-
"LICENSE",
|
|
33
|
-
"THIRD_PARTY_NOTICES.md"
|
|
34
|
-
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"check": "node scripts/check-package.mjs",
|
|
37
|
-
"test": "node scripts/test.mjs",
|
|
38
|
-
"test:package": "node scripts/verify-package.mjs",
|
|
39
|
-
"prepack": "node scripts/check-package.mjs"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"@napi-rs/keyring": "2.1.2",
|
|
43
|
-
"fflate": "^0.8.2",
|
|
44
|
-
"ignore": "7.0.12",
|
|
45
|
-
"jsonc-parser": "^3.3.1",
|
|
46
|
-
"smol-toml": "^1.9.1"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@joripspace/cli",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "The official JoripSpace CLI. Build and deploy web apps with AI agents. Powered by Cosmosfarm.",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"joripspace": "bin/joripspace.js"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://joripspace.com",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/JoripSpace/joripspace-cli.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/JoripSpace/joripspace-cli/issues"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"bin/joripspace.js",
|
|
27
|
+
"lib/*.js",
|
|
28
|
+
"vendor/core/*.cjs",
|
|
29
|
+
"vendor/templates/index.js",
|
|
30
|
+
"vendor/templates/templates/**",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"THIRD_PARTY_NOTICES.md"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"check": "node scripts/check-package.mjs",
|
|
37
|
+
"test": "node scripts/test.mjs",
|
|
38
|
+
"test:package": "node scripts/verify-package.mjs",
|
|
39
|
+
"prepack": "node scripts/check-package.mjs"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@napi-rs/keyring": "2.1.2",
|
|
43
|
+
"fflate": "^0.8.2",
|
|
44
|
+
"ignore": "7.0.12",
|
|
45
|
+
"jsonc-parser": "^3.3.1",
|
|
46
|
+
"smol-toml": "^1.9.1"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// Shared by CLI responses, generated documents, public onboarding, and MCP guidance.
|
|
2
2
|
const JORIPSPACE_TOOL_SELECTION_LINES = [
|
|
3
|
+
'Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
3
4
|
'Discover capabilities for the current installation instead of memorizing a static feature list: read CLI --help, then the relevant command help; use knowledge search --query for task-specific guidance. In MCP-only environments, inspect tools/list and the selected tool inputSchema, then resources/list and only the relevant manual. Recheck help/schema after an update or unknown option; generic global help is not proof that an invented command exists. Do not load all manuals or duplicate every tool option into AGENTS.md.',
|
|
4
|
-
'When the user requests a platform problem report or improvement suggestion, use CLI report --help and
|
|
5
|
-
'For an exposed connection token, use CLI tokens revoke --current (or --token-id ID); if CLI is unavailable, use MCP revoke_api_token with token_id=current or an exact same-account ID. Never guess a target or read/print the secret. Revoking current ends the connection; reconnect
|
|
5
|
+
'When the user requests a platform problem report or improvement suggestion, use CLI report --help for problems and bugs, or feedback --help for suggestions. CLI feedback wraps report --category feedback with the same arguments, authentication, submission and response. On older CLIs without feedback, use report --category feedback. MCP sessions submit through the CLI; there is no direct MCP report or feedback tool. Sending a report requires the user request or existing explicit authorization; never silently send suggestions. Include only relevant non-secret diagnostics and return the actual report_id. If submission status is unknown, do not blindly retry.',
|
|
6
|
+
'For an exposed connection token, use CLI tokens revoke --current (or --token-id ID); if CLI is unavailable, use MCP revoke_api_token with token_id=current or an exact same-account ID. Never guess a target or read/print the secret. Revoking current ends the connection; reconnect through login approval. logout alone does not revoke.',
|
|
6
7
|
'Prefer the JoripSpace CLI even when MCP tools are available. For generated bundles and large projects, the CLI uploads local bytes in verified chunks. Before each new onboarding, resolve the executable and compare its --version with npm view @joripspace/cli@latest version. An existing installation is not evidence that it is current. When Node.js 18+ and npm, terminal, file, and network access permit installation, install or update with npm install -g @joripspace/cli@latest. Verify the actual executable version again after installation. If PATH or a saved invocation still selects an older native binary, npm prefix, or npx cache entry, use Node with the absolute npm root -g package entrypoint or npx -y @joripspace/cli@latest, verify its version against the registry, and use that verified invocation for start and subsequent commands. Do not claim an update succeeded merely because npm install exited successfully. If the registry cannot be reached, state that freshness is unverified and continue only with capabilities confirmed in the installed help. If the global prefix is not writable, use npx -y @joripspace/cli@latest instead. Do not change global agent configuration or elevate solely for CLI installation.',
|
|
7
|
-
'Use CLI start PROJECT --json and its onboarding.invocation for subsequent operations. MCP tool availability alone does not prove CLI authentication: reuse an existing authorized CLI login or an existing locally authenticated .env.joripspace. If neither authenticates,
|
|
8
|
+
'Use CLI start PROJECT --json and its onboarding.invocation for subsequent operations. MCP tool availability alone does not prove CLI authentication: reuse an existing authorized CLI login or an existing locally authenticated .env.joripspace. If neither authenticates, prefer approval-link login when supported, otherwise use the legacy CLI one-time-code flow. Never extract hidden MCP client credentials or duplicate tokens into client configuration. If the CLI cannot be installed or executed, continue with the available MCP tools and their existing authorized connection. Do not block supported MCP work merely because the CLI environment is unavailable.',
|
|
8
9
|
];
|
|
9
10
|
|
|
10
11
|
const JORIPSPACE_CLI_GUIDE = [
|
|
@@ -24,8 +25,8 @@ const JORIPSPACE_CLI_GUIDE = [
|
|
|
24
25
|
"Only when the user explicitly requests a new Free project, run create --name NAME --json. Present every returned agreement faithfully in the user's language, link to the terms, and obtain explicit consent before passing --agree-noncommercial --agree-billing --agree-retention. Never infer agreement from the creation request. start never creates a project, and create does not link the workspace. If creation state is unknown, list projects and check the name before retrying.",
|
|
25
26
|
'The JoripSpace project is stored in `.joripspace/project`. Resolve different or invalid markers, symlinks, and conflicting local work without overwriting user files.',
|
|
26
27
|
'For CLI sessions: Use the installed JoripSpace CLI for JoripSpace infrastructure, domains, and deployment. Do not configure or wait for MCP. Existing MCP integrations remain available for users who choose that workflow; this start session continues through the CLI.',
|
|
27
|
-
'For an existing MCP session, use the tools advertised by that connection. create_project creates only Free projects after explicit confirmation and all returned agreements; start_project_session connects an existing project. MCP supports DB, storage, deployment, checkpoints, domains, crons, mail, realtime, and value-blind Secret generation/listing. Internal random Secret generation is available through generate_project_secret without another confirmation when the task already authorizes it. External Secret registration/replacement uses CLI secret set --value-stdin when a safe authorized input is available; use the project Secret web page when user-only entry is needed. MCP has no arbitrary-value Secret registration tool. MCP authentication stays in its server-bound transport session or client-managed OAuth connection. MCP responses and workspace metadata never carry API token values. CLI login stores its own credentials locally; an existing locally authenticated project env remains supported. Do not copy MCP credentials into local files or client configuration. When switching to CLI,
|
|
28
|
-
'When start returns connection_required,
|
|
28
|
+
'For an existing MCP session, use the tools advertised by that connection. create_project creates only Free projects after explicit confirmation and all returned agreements; start_project_session connects an existing project. MCP supports DB, storage, deployment, checkpoints, domains, crons, mail, realtime, and value-blind Secret generation/listing. Internal random Secret generation is available through generate_project_secret without another confirmation when the task already authorizes it. External Secret registration/replacement uses CLI secret set --value-stdin when a safe authorized input is available; use the project Secret web page when user-only entry is needed. MCP has no arbitrary-value Secret registration tool. MCP authentication stays in its server-bound transport session or client-managed OAuth connection. MCP responses and workspace metadata never carry API token values. CLI login stores its own credentials locally; an existing locally authenticated project env remains supported. Do not copy MCP credentials into local files or client configuration. When switching to CLI, run its own login approval-link flow if no authorized CLI login exists.',
|
|
29
|
+
'When start returns connection_required, execute login_command, show approval_url from stderr, keep that process alive until connected, then run resume_command. Reuse the connection on later runs. Never request or print a code or token. logout removes the local login without revoking server tokens.',
|
|
29
30
|
'New CLI logins prefer the OS credential store and reuse it across project folders for the same OS user. When that store is available, `.env.joripspace` keeps only the API URL and account reference. If the OS store is unavailable before writing, login saves the token in the project-local `.env.joripspace` instead; that fallback is reused only in this project. Failed OS writes or readback verification do not trigger fallback. Older CLI versions and existing token-bearing `.env.joripspace` files remain supported; keep that file Git-ignored and excluded from deployments and checkpoints. logout removes saved project tokens and the matching OS-stored account credential. OS logins are shared across project folders, including folders where logout was previously run. Do not copy credentials into documents, skills, logs, or source code.',
|
|
30
31
|
'',
|
|
31
32
|
'## Execute commands reliably',
|
|
@@ -82,7 +83,7 @@ const JORIPSPACE_CLI_GUIDE = [
|
|
|
82
83
|
'## Project secrets',
|
|
83
84
|
'',
|
|
84
85
|
'A request to generate an internal Secret, or its necessity within authorized implementation, is sufficient authorization; do not ask for duplicate consent or browser registration. Infer the binding name from the project and ask only if its purpose is ambiguous. Use secret generate --name NAME --json to create an internal random secret without seeing its value. It preserves an existing active secret. Use secret set --name NAME --value-stdin --json (alias: secret update) to create or replace a binding with an authorized value from an external server, provider, or system. Pass the exact UTF-8 bytes through process standard input, never command arguments, chat, logs, source, or temporary project files. No secret value is returned. set/update both create or replace; deleting a secret remains a web operation.',
|
|
85
|
-
'The start onboarding object and secret list/generate/set/update results include secret_management_url for the selected project. Include this as a clickable link when reporting creation or replacement, and whenever the user needs to enter or change a value. Explain the exact key name and purpose in the user\'s language.
|
|
86
|
+
'The start onboarding object and secret list/generate/set/update results include secret_management_url for the selected project. Include this as a clickable link when reporting creation or replacement, and whenever the user needs to enter or change a value. Explain the exact key name and purpose in the user\'s language. For a provider-issued value the user must enter, first run secret list --name NAME --json. Show the returned secret_management_url with secret_name, explain its purpose and ask for only the value on that page. The name is prefilled and the value field focused. Do not generate a placeholder value. Wait for user confirmation, then verify with secret list --name NAME --json. An existing active key is preserved unless replacement is needed for the requested task; for replacement require updated_at newer than the initial secret_entry.previous_updated_at. A saved key does not by itself prove the external integration works. Do not ask for secret values in chat. Perform the relevant connection check before reporting that an integration works.',
|
|
86
87
|
].join('\n');
|
|
87
88
|
|
|
88
89
|
const JORIPSPACE_NPM_ONBOARDING_DOCUMENT = [
|
|
@@ -15,7 +15,7 @@ const JORIPSPACE_ONBOARDING_GITIGNORE_ENTRIES = [
|
|
|
15
15
|
'.joripspace/local-backups/',
|
|
16
16
|
];
|
|
17
17
|
const JORIPSPACE_ONBOARDING_GITIGNORE_REMOVALS = ['.joripspace/agent-session.json'];
|
|
18
|
-
const JORIPSPACE_AGENT_GUIDE_UPDATED_AT = '2026-
|
|
18
|
+
const JORIPSPACE_AGENT_GUIDE_UPDATED_AT = '2026-11-04T12:13:33+09:00';
|
|
19
19
|
const JORIPSPACE_WORKFLOW_POLICY = Object.freeze({
|
|
20
20
|
target: 'joripspace',
|
|
21
21
|
guide_required: true,
|
|
@@ -120,7 +120,7 @@ const BEGINNER_ONBOARDING_LINES = [
|
|
|
120
120
|
'- If the user says they do not know, give 2-3 simple examples, recommend one default, and continue.',
|
|
121
121
|
'- Explain only the next useful action. Avoid long technical explanations unless the user asks.',
|
|
122
122
|
'- If something fails, inspect logs, deployments, and runtime events directly; do not make the user debug technical details.',
|
|
123
|
-
'- For a user-requested platform problem report or improvement suggestion, submit one incident with the installed CLI `report` command after reading
|
|
123
|
+
'- For a user-requested platform problem report or improvement suggestion, submit one incident with the installed CLI `report` command for problems or bugs, or the `feedback` command for suggestions, after reading the corresponding --help. CLI feedback wraps report --category feedback; use that legacy form when feedback is unavailable. MCP sessions also submit through CLI feedback, not a direct MCP tool. Include a summary, expected and actual behavior, available error code, and non-secret details. Do not send unsolicited reports or include credentials, personal data, or duplicates. Report the returned report_id; an uncertain response is not a confirmed submission.',
|
|
124
124
|
];
|
|
125
125
|
|
|
126
126
|
const USER_CHOICE_PRESENTATION_RULE_LINES = [
|
|
@@ -192,10 +192,9 @@ const CODEX_MCP_ONBOARDING_LINES = [
|
|
|
192
192
|
'Codex MCP onboarding flow:',
|
|
193
193
|
'- If the user provides only "프로젝트: {project_id}", do not call get_project first by project ID alone.',
|
|
194
194
|
'- First check whether JoripSpace MCP tools are visible in the current agent session, then check the current working folder.',
|
|
195
|
-
'- Without an authenticated MCP transport session, do not call project tools.
|
|
195
|
+
'- Without an authenticated MCP transport session, do not call project tools. Reuse client OAuth authentication or complete start_login approval in the initialized MCP session; never ask the user for an API token.',
|
|
196
196
|
'- Never use an empty string, dummy value, environment bearer token, browser cookie, localStorage value, profile page value, or settings file value as a connect_token.',
|
|
197
|
-
'-
|
|
198
|
-
'- After exchange_connection_code succeeds, call start_project_session with project_id in the same MCP transport session without token arguments. The server resolves the credential internally. Write only the returned nonsecret workspace metadata and preserve existing local credentials. The user should never have to find, name, or enter JORIPSPACE_API_TOKEN manually.',
|
|
197
|
+
'- Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
199
198
|
'- Do not ask for email, password, Google app password, SMTP password, personal API key, or payment key in chat.',
|
|
200
199
|
'- If deploy_code, deploy_checkpoint, or rollback_deployment returns deployment_state_unknown, call list_deployments before any retry. If a new successful deployment exists, verify it and do not redeploy. Otherwise retry the same deployment tool at most once.',
|
|
201
200
|
'- Do not restart the connection flow for a deployment timeout. Restart connection only for connection_required, invalid_token, or another explicit authentication error.',
|
|
@@ -210,7 +209,7 @@ const CODEX_MCP_ONBOARDING_LINES = [
|
|
|
210
209
|
'- Only when onboarding.template_choice.status is required_before_service_questions, show option 0 as "Start without a template" and show the embedded selectable templates in a Markdown table. Wait for the user choice; templates are optional.',
|
|
211
210
|
'- When the user selects a template, run the installed JoripSpace CLI absolute path with `install-template --template TEMPLATE_SLUG --project PROJECT_ID --dir .` without putting any token in the command and without `--force`. Inspect the installed files and complete the required template setup below before continuing the normal service questions and customization. If files collide, overwrite nothing; continue without a template unless the user explicitly approves an overwrite retry.',
|
|
212
211
|
"- After installing a selected template and before service questions or customization, inspect its code, documentation, configuration, and schema or migration files to determine whether it uses env.DB. When it uses DB, setting up the required project DB is mandatory: call describe_db first, compare the existing schema with the template's actual queries, review tables, indexes, and seed data for compatibility, apply only the required compatible changes with run_db_migration, then verify the resulting schema with describe_db and relevant reads with query_db. Do not merely copy SQL files, expose a public migration route, deploy, or report the template ready while required DB setup is incomplete. If a safe compatible migration cannot be determined, stop and report the specific schema or data conflict instead of guessing, dropping existing data, or resetting the DB.",
|
|
213
|
-
'-
|
|
212
|
+
'- Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
214
213
|
'- Only for a completely new project whose template_choice.status is required_before_service_questions, after the optional template choice collect only the missing service requirements in a single combined service-brief question: name, purpose, required features, login, and integrations. Skip values already provided by the user; follow up only when a missing answer blocks the requested work. Apply the shared framework and deployment rules.',
|
|
215
214
|
'- When both existing work and a service description are absent, ask once for the company or service, required content, and desired mood. Keep the resulting project brief in the application source only when it is useful to the project.',
|
|
216
215
|
'- Before deployment, verify the project connection, source entrypoint, relevant checks available in the current environment, and target URL. If runtime source imports package dependencies, run the project build and deploy the generated bundled Worker entrypoint such as dist/worker.js; never deploy an unbundled source entrypoint that depends on node_modules. Direct MCP deployment of Worker-compatible source does not require Node.js or Git.',
|
|
@@ -220,11 +219,9 @@ const CODEX_MCP_ONBOARDING_LINES = [
|
|
|
220
219
|
];
|
|
221
220
|
|
|
222
221
|
const CODEX_MCP_USER_CONNECT_MESSAGE_LINES = [
|
|
223
|
-
'JoripSpace
|
|
224
|
-
'
|
|
225
|
-
'
|
|
226
|
-
'3. 화면에 표시되는 MCP/CLI 전용 연결 코드를 이 채팅에 붙여넣습니다. Codex는 이 코드를 exchange_connection_code로 교환한 뒤 받은 연결 토큰으로 프로젝트 세션을 시작합니다.',
|
|
227
|
-
'주의: 이메일이나 비밀번호는 필요하지 않습니다. Google 앱 비밀번호나 SMTP 비밀번호를 채팅에 붙여넣지 마세요. Codex가 브라우저 쿠키나 저장소에서 토큰을 직접 찾으면 안 됩니다. 연결 코드는 연결 토큰이 아니며 한 번만 사용할 수 있습니다. 교환 후 발급되는 연결 토큰은 프로젝트 온보딩 세션을 시작하기 위한 값이며, 일반 API bearer token과 다릅니다.',
|
|
222
|
+
'JoripSpace 연결 승인 링크를 열고 로그인 계정을 확인한 뒤 연결 승인을 눌러주세요.',
|
|
223
|
+
'코드를 복사하거나 채팅에 입력할 필요가 없습니다. 같은 MCP 세션에서 start_login에 request_id를 전달해 승인 상태를 확인하고 연결 후 프로젝트 온보딩을 이어갑니다.',
|
|
224
|
+
'이메일, 비밀번호, API 토큰을 채팅에 입력하지 마세요. 에이전트는 브라우저 쿠키나 저장소에서 인증 정보를 찾지 않습니다.',
|
|
228
225
|
];
|
|
229
226
|
|
|
230
227
|
const SECRET_RULE_LINES = [
|
|
@@ -235,15 +232,15 @@ const SECRET_RULE_LINES = [
|
|
|
235
232
|
'- Never put API keys, payment keys, SMS/email keys, database URLs, or tokens in source code, README files, browser JavaScript, screenshots, chat summaries, logs, error messages, or audit metadata.',
|
|
236
233
|
'- Store external service keys used by deployed code only as JoripSpace project secrets. Only the selected project User Worker secret binding stores the value; the platform DB keeps project-scoped name, status, and lifecycle timestamps only.',
|
|
237
234
|
'- Never copy project Secret values into source code, env.DB, env.STORAGE, deployment source, checkpoint files, saved copies, logs, error messages, or audit metadata.',
|
|
238
|
-
'- Do not ask the user to paste provider Secret values into chat. Prefer CLI secret set --name NAME --value-stdin for an authorized external value supplied through safe process input; otherwise
|
|
239
|
-
'- Every user-facing request for an external provider credential must include a clickable Markdown link to `https://joripspace.com/projects/{project_id}/?tab=secrets`. Use the selected project slug in place of `{project_id}`. Never mention only the tab name or provide an unlinked URL.',
|
|
235
|
+
'- Do not ask the user to paste provider Secret values into chat. Prefer CLI secret set --name NAME --value-stdin for an authorized external value supplied through safe process input; otherwise run CLI secret list --name NAME --json, or MCP list_secrets with name, to prepare a user-entry link without creating a placeholder secret. Show the returned secret_management_url and explain the purpose; the name is prefilled and the user enters only the value. After confirmation verify active metadata; for replacement require updated_at newer than the saved previous_updated_at before checking the integration. Deletion remains a web operation. Verify metadata with CLI secret list or MCP list_secrets. Secret values never appear in list responses or agent reports.',
|
|
236
|
+
'- Every user-facing request for an external provider credential must include a clickable Markdown link to `https://joripspace.com/projects/{project_id}/?tab=secrets&secret_name=NAME`. Include only the validated key name in the URL, never its value. Use the selected project slug in place of `{project_id}`. Never mention only the tab name or provide an unlinked URL.',
|
|
240
237
|
'- Before browser assistance for an external provider credential, explain the exact required binding names, purpose, and chat safety rule. If browser assistance was not already authorized, ask once "제가 브라우저로 비밀 키 등록을 진행할까요?". Do not ask again for already authorized assistance.',
|
|
241
238
|
'- Treat clear affirmative replies such as "네", "진행해", "너가 해", or "ㅇㅇ" as approval for that described browser-assisted credential task only. Approval does not authorize unrelated account changes, credential rotation, billing changes, or destructive actions.',
|
|
242
239
|
"- After approval, use an available browser-control tool with the user's existing signed-in session to open the provider and selected JoripSpace project Secret pages and complete safe navigation and form steps. Never inspect cookies, localStorage, sessionStorage, saved passwords, or unrelated account pages.",
|
|
243
240
|
'- Keep provider Secret values out of chat, screenshots, shell commands, clipboard history, local files, tool summaries, and logs. If the browser environment cannot transfer a value without exposing it, or if reauthentication, MFA, CAPTCHA, credential reveal, or other user-only verification is required, stop at that exact visible step and ask the user to complete only that step in the browser. Continue automatically after the user confirms completion.',
|
|
244
241
|
'- After browser-assisted registration, call list_secrets and report only the binding name and registration status. Never repeat, reveal, compare, or summarize the Secret value.',
|
|
245
242
|
'- Prefer the OS credential store for local JoripSpace CLI tokens. If it is unavailable before writing, login uses the ignored project-local `.env.joripspace`; logout removes that saved token. Never duplicate the value in JSON, TOML, source, another session file, or MCP client configuration. The shared project identity is the one-line `.joripspace/project` slug.',
|
|
246
|
-
'-
|
|
243
|
+
'- Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
247
244
|
'- Secret names must match [_A-Z][_A-Z0-9]* and be at most 128 characters. DB, STORAGE, PROJECT_ID and names beginning JORIPSPACE_, CF_, or CLOUDFLARE_ are reserved and must not be used.',
|
|
248
245
|
'- A project supports at most 60 active secrets, and each value must be 1-5,120 UTF-8 bytes. Use clear uppercase names such as TOSS_PAYMENTS_SECRET_KEY, TOSS_PAYMENTS_BILLING_SECRET_KEY, DODO_PAYMENTS_API_KEY, SOLAPI_API_KEY, or SOLAPI_API_SECRET.',
|
|
249
246
|
'- For app-internal random values such as session signing, CSRF protection, encryption, or test secrets, prefer CLI secret generate --name NAME --json; use generate_project_secret when the CLI cannot run. Both generate and store the value without exposing it and preserve an existing active binding. Do not ask the user to enter a random value.',
|
|
@@ -405,7 +402,7 @@ const AGENT_OPERATING_RULE_LINES = [
|
|
|
405
402
|
'- Public pricing page copy is product-approved content. Do not rename, paraphrase, reorder, or otherwise improve plan names, subtitles, benefits, prices, units, descriptions, or CTA text unless the user explicitly requests that exact change. When a pricing copy change is requested, update SSR, browser rendering, documentation, and release checks together.',
|
|
406
403
|
'- JoripSpace execution order: prefer the installed CLI, or install/update it when the environment supports it, even when MCP tools are active. Use onboarding.invocation from CLI start. Use MCP only when CLI installation or execution is unavailable; do not move credentials between configurations.',
|
|
407
404
|
'- MCP-only setup and deploy do not require Node.js or Git. Follow the local tool readiness rules: check and report both tools during onboarding, but install only a missing tool that the current project path actually requires and only after explicit user approval. Never ask the beginner to run npm or git commands.',
|
|
408
|
-
'-
|
|
405
|
+
'- Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
409
406
|
'- Legacy scripts that execute .joripspace/*.mjs helpers are conditional compatibility only. New `start` connection setup does not generate them. A verified joripspace:deploy script that builds the app and invokes the current CLI is a supported deployment entrypoint, not a legacy helper. Prepare it only during authorized app implementation or deployment, never merely to link or refresh a workspace.',
|
|
410
407
|
'- Use the installed CLI for checkpoint, restore, pull, and archive deployment when MCP is unavailable or inline transport is unsuitable. Node.js readiness is determined only by the project build itself or an explicitly requested legacy helper workflow.',
|
|
411
408
|
'- When MCP is unavailable, use the installed JoripSpace CLI absolute path returned by start. Use its `deploy --dir` command for generated bundles, large files, or large multi-file projects. Do not require an app restart or project-local helper. The current npm CLI needs Node.js 18+; use supported MCP capabilities when that runtime is unavailable, and do not ask the user to choose or run the command.',
|
|
@@ -468,7 +465,7 @@ const AFTER_CONNECTION_RULE_LINES = [
|
|
|
468
465
|
"- At the start of each new distinct user task, use CLI knowledge search when available; in the MCP fallback, call search_knowledge once with the user's plain request before answering, planning, asking questions, or starting work. Apply the returned user_guidance, recommendation, and actions to both the response and the work, including short user requests. Do not repeat the search for every follow-up in the same task unless the topic changes or current guidance is needed.",
|
|
469
466
|
'- If search_knowledge returns no direct match, use its prioritized fallback guidance and ask at most three short business questions. If the knowledge service fails, continue with the built-in JoripSpace guide and explain only when the failure blocks the task.',
|
|
470
467
|
'- Do not stop with only "yes, it is possible" or a capability checklist.',
|
|
471
|
-
'-
|
|
468
|
+
'- Reuse existing valid CLI logins and authenticated MCP sessions without a new approval. New CLI connections use login --no-open --json: show approval_url from stderr, keep the process running, and follow the final stdout next_action/next_command. No code entry is required. For MCP initialize the transport, retain Mcp-Session-Id, and call start_login without arguments; show approval_url, then respect interval and call start_login with the returned request_id in the same session until connected. Continue with start_project_session without token arguments. Pending means wait; denial, expiry and errors must not switch flows or create duplicate approvals. Never request or expose a token; do not browse around or inspect browser storage. The server alone retains old code APIs for already released clients; current clients never fall back to a code flow.',
|
|
472
469
|
'- The user does not need to say "onboarding". After connection succeeds, continue into project selection, workspace file writing, and the first service questions automatically.',
|
|
473
470
|
'- When the CLI cannot be installed or executed, prefer a single start_project_session tool call for the MCP fallback. It combines session lookup, project choice handling, workspace file instructions, and first questions.',
|
|
474
471
|
'- If an MCP response includes workspace_setup.files, write those files into the current working folder immediately before replying.',
|
|
@@ -701,7 +698,7 @@ function projectSecretManagementLines(projectConfig = {}) {
|
|
|
701
698
|
const projectId = String(projectConfig.project_id || projectConfig.project_slug || '').trim();
|
|
702
699
|
const encodedProjectId = projectId ? encodeURIComponent(projectId) : '{project_id}';
|
|
703
700
|
return [
|
|
704
|
-
`- Secret
|
|
701
|
+
`- Secret value entry: use CLI secret list --name NAME --json or MCP list_secrets with name to get https://joripspace.com/projects/${encodedProjectId}/?tab=secrets&secret_name=NAME. Show the returned clickable link and key purpose; the user enters only the value. Do not create a random placeholder for a provider-issued key. Verify registration after confirmation, requiring a newer updated_at when replacing an existing key.`,
|
|
705
702
|
];
|
|
706
703
|
}
|
|
707
704
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function secretEntryName(value) {
|
|
4
|
+
const name = typeof value === 'string' ? value.toUpperCase() : '';
|
|
5
|
+
return /^[_A-Z][_A-Z0-9]{0,127}$/.test(name) &&
|
|
6
|
+
!['DB', 'STORAGE', 'PROJECT_ID'].includes(name) &&
|
|
7
|
+
!['JORIPSPACE_', 'CF_', 'CLOUDFLARE_'].some(prefix => name.startsWith(prefix)) ? name : '';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function secretManagementUrl(project, name = '') {
|
|
11
|
+
const base = `https://joripspace.com/projects/${encodeURIComponent(project)}/?tab=secrets`;
|
|
12
|
+
const selected = secretEntryName(name);
|
|
13
|
+
return selected ? `${base}&secret_name=${encodeURIComponent(selected)}` : base;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function secretEntryHandoff(project, name, secrets = []) {
|
|
17
|
+
const selected = secretEntryName(name);
|
|
18
|
+
if (!selected) return null;
|
|
19
|
+
const previous = secrets.find(secret => secret.name === selected && secret.status === 'active');
|
|
20
|
+
return {
|
|
21
|
+
project_id: project,
|
|
22
|
+
name: selected,
|
|
23
|
+
status: previous ? 'active' : 'not_registered',
|
|
24
|
+
operation: previous ? 'replace' : 'create',
|
|
25
|
+
previous_updated_at: previous?.updated_at || null,
|
|
26
|
+
next_action: previous ? 'verify_existing_secret_or_request_replacement_if_needed' : 'show_secret_management_url_then_wait_for_user',
|
|
27
|
+
verify_with: {
|
|
28
|
+
cli_args: ['secret', 'list', '--project', project, '--name', selected, '--json'],
|
|
29
|
+
mcp: { name: 'list_secrets', arguments: { project_id: project, name: selected } },
|
|
30
|
+
},
|
|
31
|
+
verification: previous
|
|
32
|
+
? 'After the user confirms saving, list secrets again and require this name to be active with updated_at newer than previous_updated_at. Then run the relevant integration check.'
|
|
33
|
+
: 'After the user confirms saving, list secrets again and require this name to be active. Then run the relevant integration check.',
|
|
34
|
+
instruction: 'Show the clickable secret_management_url and explain the key purpose. The name is already filled in; the user enters only the value and saves. Do not generate a placeholder value, request the value in chat, or report registration complete before verification.',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = { secretEntryName, secretManagementUrl, secretEntryHandoff };
|