@joripspace/cli 0.6.0 → 0.6.1

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/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@joripspace/cli",
3
- "version": "0.6.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.6.1",
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,4 +1,12 @@
1
- // One guide for CLI responses, project documents, and the public onboarding URL.
1
+ // Shared by CLI responses, generated documents, public onboarding, and MCP guidance.
2
+ const JORIPSPACE_TOOL_SELECTION_LINES = [
3
+ '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 submit report with category problem, bug, or feedback as appropriate. feedback is a report category, not a CLI command or MCP 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.',
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 with a fresh code. logout alone does not revoke.',
6
+ '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, complete the 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
+
2
10
  const JORIPSPACE_CLI_GUIDE = [
3
11
  '# JoripSpace project onboarding',
4
12
  '',
@@ -9,11 +17,13 @@ const JORIPSPACE_CLI_GUIDE = [
9
17
  '',
10
18
  '## Workspace and connection',
11
19
  '',
20
+ ...JORIPSPACE_TOOL_SELECTION_LINES,
21
+ '',
12
22
  'Use the project name supplied by the user. The connection flow does not create a missing project. Use the current Git root when one exists, otherwise the current working directory; use --cwd to specify the intended workspace. Never use the npm cache or package installation folder as the project workspace.',
13
23
  "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.",
14
24
  'The JoripSpace project is stored in `.joripspace/project`. Resolve different or invalid markers, symlinks, and conflicting local work without overwriting user files.',
15
25
  '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.',
16
- '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. For direct Secret registration/replacement, show the selected project Secret web page and ask the user to enter the value there. MCP and CLI credentials are separate; do not assume an OS CLI login authenticates MCP or copy tokens between client configurations.',
26
+ '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, use its own connection-code login if no authorized CLI login exists.',
17
27
  'When start returns connection_required, show connect_url as a clickable link, ask the user to approve the connection and provide the five-minute one-time code, then execute login_command and resume_command. A successful connection also logs in; do not add a separate login step. Never request or print the exchanged token. Reuse the existing connection on later runs. Use logout to remove the current local login without revoking server tokens.',
18
28
  '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.',
19
29
  '',
@@ -43,20 +53,32 @@ const JORIPSPACE_CLI_GUIDE = [
43
53
  '| 2 | Copy current files only | No template update link |',
44
54
  '',
45
55
  'Never replace that table with only a prose sentence. Use install-template --template TEMPLATE_SLUG --project PROJECT --dir PROJECT_ROOT for option 1. Append --files-only for option 2. Never put a token in either command. When git_history_available is false, explain that only file copying is available and use --files-only without offering an unavailable mode. Never add --force without explicit overwrite approval.',
56
+ 'After installing a template, inspect its source, configuration, schema, and migrations before customization or deployment. Installation copies files and does not initialize the project DB. When the template uses env.DB, run db schema first, compare the actual queries and indexes, apply only compatible required migrations with db migrate --file PATH, then verify the schema and representative reads with db query. Never report the template ready with missing tables or reset existing data to resolve a conflict.',
57
+ 'For a Git-history template, check template pull before application work. An available update requires explicit approval before rerunning with --yes; preserve origin and stop on local changes, rewritten history, or merge conflicts.',
46
58
  '',
47
59
  '## Build, verify, and deploy',
48
60
  '',
49
61
  "After connecting, continue the user's existing request. If the user only asked to start, report the connection and relevant next step; do not invent an app or deploy unchanged files just to complete onboarding. Clarify missing requirements with short questions and concrete choices.",
50
62
  'Use normal local tools to inspect source, install project dependencies, build, test, and verify requested behavior. Preserve user edits and project structure. Read actual project scripts and CLI help for the matching deployment path. Do not invent setup or init commands or change infrastructure providers.',
63
+ 'Use Hono as the default server framework for every new project, including single-route and simple services. Preserve the current framework of an existing project unless the user requests migration. Use feature-focused modules as complexity grows and deploy them as one bundled Worker service.',
64
+ 'Server-render meaningful initial HTML for user-facing routes by default. Honor an explicitly requested SPA, client-only app, or WebView. Give each independent main screen a distinct pathname that supports direct access and refresh; verify the route inventory, requested flows, validation, authorization, responsive layout, and relevant automated checks before deployment.',
51
65
  'Before deployment, inspect runtime imports. When source imports package dependencies, run the project build and deploy its generated bundled Worker entrypoint such as dist/worker.js. Never deploy an unbundled source entrypoint that depends on excluded node_modules.',
52
66
  'Directory deployment applies root .gitignore, .ignore, .joripspaceignore and nested .gitignore rules to both small inline uploads and chunked archives. Ignored credentials and protected connection files are excluded in both paths. If the build output is ignored in the project root, select the build output directory with --dir instead of removing credential ignore rules.',
53
- 'Respect the deployment mode returned by the project. With an active GitHub deployment connection, follow its configured branch and trigger. Otherwise use the existing CLI deployment/checkpoint commands. Do not create GitHub Actions workflows merely to deploy an unconnected project. Store external provider secrets in project Secret bindings through the existing authorized flow, never in application source.',
67
+ 'Respect context.deployment returned by start; for older CLIs that omit it, run get --project PROJECT --json before choosing a deployment route. With an active GitHub deployment connection, follow its configured branch and trigger, commit and push the verified requested change, and verify the resulting Actions run and JoripSpace deployment. Do not create a separate pre-push checkpoint or use direct deploy for that route. Otherwise use the existing CLI deployment/checkpoint commands. Do not create GitHub Actions workflows merely to deploy an unconnected project. Store external provider secrets in project Secret bindings through the existing authorized flow, never in application source.',
54
68
  'When GitHub connection is requested, show https://joripspace.com/projects/PROJECT/?tab=deployment as a clickable link with the selected project slug. The user connects the GitHub App and selects the repository and trigger on that page. Keep the existing GitHub Actions workflow. An authorized agent push to the configured branch triggers automatic deployment for a branch-push connection; follow the configured release trigger for release deployments. Check project status and deployment history afterward.',
55
69
  'When development and deployment are requested, verify the build, deploy through JoripSpace, and check the production URL before reporting completion. Report the URL, actual verification, and any unresolved failure. If a response is lost, inspect deployment state before retrying a mutation. For transient reads, follow retryable and retry-after information with bounded backoff. Do not blindly retry authentication, permission, conflict, or invalid-input failures.',
70
+ 'Deployment requires an explicit request for the current change. After meaningful verified work without deployment, use checkpoint save with a concise label. A request only to refresh guidance does not authorize application changes, checkpoints, commit, push, or deployment; preserve existing application source and do not invent a deployment because guide files changed.',
71
+ '',
72
+ '## Runtime capabilities and current operating guidance',
73
+ '',
74
+ 'At the start of each distinct task, use knowledge search --query "USER_REQUEST" once for current operating guidance. Use ordinary product words in user-facing answers, translated into the user\'s language: server, DB, storage, realtime. Read relevant command help for the current program instead of assuming older behavior.',
75
+ 'Use env.DB with prepared statements for structured records and env.STORAGE for uploaded or generated files; keep fixed design assets in deployment source. Inspect schema and design indexes for actual queries and pagination before DB changes. Use db schema/query/migrate and storage list/get/put/delete for agent operations; never expose a public migration route.',
76
+ 'For realtime v2, read realtime-v2 docs, check realtime-v2 status, and activate only the requested project with realtime-v2 activate when needed. Use the SDK server authorization and recovery flow. Existing managed realtime uses /_joripspace/realtime?room=main for public demos; private conversations need opaque room ids and membership checks. Do not invent Worker-global socket broadcasts or a second D1 message-history store. Verify two independent clients, reconnect recovery, and room isolation.',
77
+ 'For project mail, call mail connect first, follow the returned SMTP setup or browser approval link, then use mail status and mail test. Never ask for SMTP credentials in chat or build a separate mail integration. Domains and scheduled jobs use domain and cron commands; inspect --help and the actual returned status.',
56
78
  '',
57
79
  '## Project secrets',
58
80
  '',
59
- '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.',
81
+ '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.',
60
82
  '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. If the user must enter a provider-issued value, ask them to enter it on that page and click Register or replace, then verify the name, status, and updated_at with secret list --json. Do not ask for secret values in chat. Perform the relevant connection check before reporting that an integration works.',
61
83
  ].join('\n');
62
84
 
@@ -86,4 +108,4 @@ const JORIPSPACE_NPM_ONBOARDING_DOCUMENT = [
86
108
  JORIPSPACE_CLI_GUIDE,
87
109
  ].join('\n');
88
110
 
89
- module.exports = { JORIPSPACE_CLI_GUIDE, JORIPSPACE_NPM_ONBOARDING_DOCUMENT };
111
+ module.exports = { JORIPSPACE_TOOL_SELECTION_LINES, JORIPSPACE_CLI_GUIDE, JORIPSPACE_NPM_ONBOARDING_DOCUMENT };