@notis_ai/cli 0.2.31 → 0.2.33

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 (92) hide show
  1. package/README.md +88 -9
  2. package/config/notis_app_design_rules.json +22 -0
  3. package/dist/agent-hooks/notis-agent-hook.mjs +4677 -913
  4. package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
  5. package/dist/base-skills/notis-cli/SKILL.md +7 -3
  6. package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
  7. package/dist/base-skills/notis-spaces/SKILL.md +9 -4
  8. package/dist/base-skills/notis-spaces/references/comments.md +94 -0
  9. package/dist/base-skills/notis-spaces/references/context.md +20 -19
  10. package/dist/base-skills/notis-spaces/references/design.md +3 -2
  11. package/dist/base-skills/notis-spaces/references/fixtures.md +4 -2
  12. package/dist/base-skills/notis-spaces/references/reading.md +3 -1
  13. package/dist/base-skills/notis-spaces/references/release.md +3 -1
  14. package/dist/base-skills/notis-spaces/references/sdk.md +160 -88
  15. package/dist/base-skills/notis-spaces/references/store.md +24 -1
  16. package/dist/sdk/src/components/SelectionActionBar.tsx +42 -7
  17. package/dist/sdk/src/components/SpaceTextComments.tsx +284 -0
  18. package/dist/sdk/src/config.ts +3 -1
  19. package/dist/sdk/src/functions.ts +203 -0
  20. package/dist/sdk/src/hooks/useAgentQueue.ts +17 -28
  21. package/dist/sdk/src/hooks/useCollectionInteractions.ts +7 -2
  22. package/dist/sdk/src/hooks/useConnection.ts +102 -0
  23. package/dist/sdk/src/hooks/useFunction.ts +42 -0
  24. package/dist/sdk/src/hooks/useNotisSettings.ts +101 -0
  25. package/dist/sdk/src/index.ts +15 -4
  26. package/dist/sdk/src/runtime.ts +16 -1
  27. package/dist/sdk/src/space.ts +333 -33
  28. package/dist/sdk/src/ui/comments/passageModel.ts +99 -0
  29. package/dist/sdk/src/ui/comments/textHighlights.ts +33 -0
  30. package/dist/sdk/src/ui/icons.tsx +17 -1
  31. package/dist/skill-sync/index.js +239 -30
  32. package/dist/skill-sync-worker.mjs +453 -124
  33. package/dist/space-harness/host.js +218 -93
  34. package/dist/space-sdk/dist/chunk-4GWS2IFO.js +3 -0
  35. package/dist/space-sdk/dist/index.js +3 -3
  36. package/dist/space-sdk/dist/ui.js +9 -8
  37. package/dist/space-sdk/src/config.ts +3 -1
  38. package/dist/space-sdk/src/functions.ts +203 -0
  39. package/dist/space-sdk/src/hooks/useAgentQueue.d.ts +2 -13
  40. package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +2 -0
  41. package/dist/space-sdk/src/hooks/useConnection.d.ts +42 -0
  42. package/dist/space-sdk/src/hooks/useFunction.d.ts +20 -0
  43. package/dist/space-sdk/src/hooks/useNotisSettings.d.ts +48 -0
  44. package/dist/space-sdk/src/index.d.ts +10 -4
  45. package/dist/space-sdk/src/runtime.d.ts +14 -1
  46. package/dist/space-sdk/src/space.ts +333 -33
  47. package/dist/space-sdk/src/tailwind-candidates.d.ts +227 -152
  48. package/dist/space-sdk/src/ui/blocks/blocks.d.ts +18 -0
  49. package/dist/space-sdk/src/ui/blocks/index.d.ts +2 -2
  50. package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +7 -4
  51. package/dist/space-sdk/src/ui/comments/agentRuntime.d.ts +10 -2
  52. package/dist/space-sdk/src/ui/comments/commentModel.d.ts +55 -88
  53. package/dist/space-sdk/src/ui/comments/commentWords.d.ts +9 -0
  54. package/dist/space-sdk/src/ui/comments/hostComments.d.ts +13 -9
  55. package/dist/space-sdk/src/ui/comments/index.d.ts +1 -1
  56. package/dist/space-sdk/src/ui/comments/paneParts.d.ts +27 -5
  57. package/dist/space-sdk/src/ui/comments/passageModel.d.ts +12 -36
  58. package/dist/space-sdk/src/ui/comments/useCommentRouting.d.ts +26 -4
  59. package/dist/space-sdk/src/ui/comments/useComments.d.ts +64 -74
  60. package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +8 -4
  61. package/dist/space-sdk/src/ui/icons.d.ts +6 -0
  62. package/dist/space-sdk/src/ui/index.d.ts +2 -2
  63. package/dist/space-sdk/src/ui/layout/SidePane.d.ts +3 -4
  64. package/dist/space-sdk/src/ui/list/ListReader.d.ts +8 -0
  65. package/dist/space-sdk/src/ui/period/dateFormat.d.ts +27 -8
  66. package/dist/view-renderer/dist/host.js +285 -160
  67. package/package.json +3 -3
  68. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
  69. package/skills/notis-spaces/cli.md +17 -3
  70. package/src/cli.js +2 -1
  71. package/src/command-specs/index.js +3 -0
  72. package/src/command-specs/repository-secrets.js +171 -0
  73. package/src/command-specs/spaces.js +70 -3
  74. package/src/runtime/agent-credential.js +175 -0
  75. package/src/runtime/agent-identity.js +92 -15
  76. package/src/runtime/app-boundary-validator.js +248 -3
  77. package/src/runtime/app-data-literals.js +32 -23
  78. package/src/runtime/app-platform.js +8 -0
  79. package/src/runtime/auth-recovery.js +14 -0
  80. package/src/runtime/profiles.js +15 -0
  81. package/src/runtime/skill-sync/index.ts +3 -2
  82. package/src/runtime/skill-sync/symlink-manager.ts +354 -35
  83. package/src/runtime/skill-sync/types.ts +10 -1
  84. package/src/runtime/space-functions.js +211 -0
  85. package/src/runtime/space-platform.js +12 -3
  86. package/src/runtime/space-source.js +116 -13
  87. package/src/runtime/space-test-server.js +44 -7
  88. package/src/runtime/space-verification.js +3 -1
  89. package/src/runtime/transport.js +15 -0
  90. package/dist/sdk/src/components/NotisCommentBoundary.tsx +0 -132
  91. package/dist/space-sdk/dist/chunk-3DFOGU26.js +0 -3
  92. package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +0 -26
package/README.md CHANGED
@@ -64,22 +64,26 @@ The CLI defaults to `json` output in agent or non-TTY contexts and `table` outpu
64
64
  - `--timeout-ms <n>` — Time limit in milliseconds for each call, automatic retries included
65
65
  - `--idempotency-key <key>` — Override the generated idempotency key for mutating commands
66
66
  - `--no-retry` (or `NOTIS_NO_RETRY=1`): turn off automatic retries. By default the CLI retries an interrupted tool call (network error, timeout, 502, 503 or 504) when repeating it is safe: a read, or a write with an idempotency key. It makes up to 3 attempts within `--timeout-ms` and reports the count in `meta.attempts`, or `error.details.attempts` on a failure.
67
- - `--agent-name <name>`, `--agent-id <id>`, `--agent-thread <thread>` (or `NOTIS_AGENT_NAME`, `NOTIS_AGENT_ID`, `NOTIS_AGENT_THREAD`): the agent making the call. See Agents declare themselves.
67
+ - `--agent-name <name>`, `--agent-id <id>`, `--agent-thread <thread>`, `--agent-thread-name <name>` (or `NOTIS_AGENT_NAME`, `NOTIS_AGENT_ID`, `NOTIS_AGENT_THREAD`, `NOTIS_AGENT_THREAD_NAME`): the agent making the call. See Agents declare themselves.
68
68
 
69
69
  ## Agents declare themselves
70
70
 
71
71
  An agent using the CLI (Claude Code or Codex on your computer, a script, a session on your Cloud Computer) says who it is on every call, so what it writes is its own and not yours: a comment's Author is its name, the comment never counts as yours, and it never wakes the agent that wrote it. Set the variables once for the agent's session, or pass the flags on a call (a flag wins over its variable):
72
72
 
73
73
  ```bash
74
- export NOTIS_AGENT_NAME="fred-and-the-machine" # a fresh lowercase band name, shown as "Fred And The Machine"
75
- export NOTIS_AGENT_THREAD="<notis thread id or link>" # optional: where replies go
74
+ export NOTIS_AGENT_NAME="fred-and-the-machine" # a fresh imaginary rock-band name, shown as "Fred And The Machine"
75
+ export NOTIS_AGENT_ID="<your session id>" # your own unique id, such as your T3 thread or Codex session id
76
+ export NOTIS_AGENT_THREAD_NAME="PR #3851" # the name of the thread you work in, shown after your name
76
77
  ```
77
78
 
78
- - The name is a fresh lowercase imaginary rock-band name: lowercase letters and digits in at least two words joined by hyphens, 3 to 60 characters, such as `fred-and-the-machine`. Anything else stops the command before it is sent (`usage_error`; the server answers `invalid_agent_identity`).
79
- - The name is only a name; an id decides which comments are the agent's own. The first time a name is used on a computer, the CLI generates a random id for it and keeps it in `agents.json` next to the CLI config file, then sends it with that name on every call. Two agents with the same name on two computers are two agents. `NOTIS_AGENT_ID` (or `--agent-id`) overrides it: up to 128 letters, digits and `. _ : @ / + -`.
80
- - The name is required whenever an id or a thread is set. The thread is an id or link of up to 512 characters without spaces. A Notis thread of yours named in `NOTIS_AGENT_THREAD` gets the replies to the agent's comments. A Notis thread you do not own is ignored; any other value (another tool's session id or link) is kept as a label.
79
+ - Every agent, and every sub-agent, picks a fresh lowercase imaginary rock-band name of its own, so the person sees which one wrote: lowercase letters and digits in at least two words joined by hyphens, 3 to 60 characters, such as `fred-and-the-machine`. A harness or product name (`claude`, `claude-code`, `codex`, `cursor`, `cursor-agent`, `gemini`, `notis`, `t3`, `t3-code`, `opencode`, `agent`, `assistant`, `bot`, also with `-cli` or `-agent`) is no band name. Anything else stops the command before it is sent (`usage_error`; the server answers `invalid_agent_identity`).
80
+ - The name is only a name; an id decides which comments are the agent's own. Set `NOTIS_AGENT_ID` (or `--agent-id`) to your own unique id, such as your session id: 3 to 128 letters, digits and `. _ : @ / + -`. Without one, the CLI generates a random id the first time a name is used on a computer, keeps it in `agents.json` next to the CLI config file and sends it with that name on every call, so two agents with the same name on two computers are two agents.
81
+ - `NOTIS_AGENT_THREAD_NAME` (or `--agent-thread-name`) names the thread you work in, whatever you call it (a T3 thread title, `PR #3851`): at most 80 characters on one line, shown after your name on your comments and on the Goes to line.
82
+ - The CLI tells Notis which harness runs it (Claude Code, Codex, Cursor...) from the variables that harness sets, so your comments show its logo; `NOTIS_AGENT_HARNESS` (`claude_code`, `codex`, `cursor_agent`...) overrides it.
83
+ - The name is required whenever an id, a thread or a thread name is set. The thread is an id or link of up to 512 characters without spaces. A Notis thread of yours named in `NOTIS_AGENT_THREAD` gets the replies to the agent's comments. A Notis thread you do not own is ignored; any other value (another tool's session id or link) is kept as a label.
81
84
  - The declaration names the writer; it never grants access, and Notis records it as declared. A Notis agent's own Cloud Computer command already carries a signed identity, which wins over a declaration.
82
85
  - Declarations take effect on accounts with unified comments on (being rolled out). On other accounts Notis ignores them and every write counts as yours, as before; only a badly formed name still stops the command locally.
86
+ - A comment thread you wrote in last is yours: when the person replies or answers there, Notis wakes no agent of its own; you read the reply the next time you check (`list`, `thread` or `waiting` of `LOCAL_NOTIS_SPACE_COMMENT_THREADS`), and until then the person sees that you have not read it yet. The person can hand the thread to a Notis thread with Change.
83
87
  - With unified comments on, comments written through the CLI always need a name, even when you type the command yourself: without one the comment is refused with `agent_name_required`, and a declaration without an id with `agent_id_required`. Other writes made with your own sign-in and no declaration count as yours. The Notis assistant itself never writes comments: it starts a sub-agent, whose comments carry the sub-agent's name.
84
88
 
85
89
  ## Authentication
@@ -407,6 +411,20 @@ When to use: Find a link binding and its revision before removing it, including
407
411
  Examples:
408
412
  - `npx --package @notis_ai/cli@latest -- notis spaces links list <space-id>`
409
413
 
414
+ ### `npx --package @notis_ai/cli@latest -- notis spaces records <space-id> <binding>`
415
+
416
+ List the records of one database linked into a Space you edit: record key and title, oldest first, one page at a time.
417
+
418
+ When to use: Find the record keys and titles of a linked database, for example to write fixtures or link to one record. Editors only; anyone else reads through the Space's declared actions.
419
+
420
+ Options:
421
+ - `--limit <number>` — Records per page, 1 to 100; defaults to 20.
422
+ - `--offset <number>` — Zero-based start; pass next_offset from the previous page.
423
+ - `--record <record-key>` — Fixed record context, when this is a record-scoped Space.
424
+
425
+ Examples:
426
+ - `npx --package @notis_ai/cli@latest -- notis spaces records <space-id> tasks --limit 20`
427
+
410
428
  ### `npx --package @notis_ai/cli@latest -- notis spaces links remove <space-id> <binding-id>`
411
429
 
412
430
  Remove one database, Skill or automation link from a Space by its binding.
@@ -684,9 +702,9 @@ Examples:
684
702
 
685
703
  ### `npx --package @notis_ai/cli@latest -- notis spaces store publish <space-id>`
686
704
 
687
- Publish a Space and its sub-Spaces as the next Store version.
705
+ Publish what a Space's source lists in store.ships as the next Store version.
688
706
 
689
- When to use: Share a Space you own as an installable template: link and team listings publish at once, public ones wait for review. A link listing never shows in the Store; only people with its link see it. Notis runs the same safety scan and Owner check as the submission page and explains any refusal.
707
+ When to use: Share a Space you own as an installable template: link and team listings publish at once, public ones wait for review. A link listing never shows in the Store; only people with its link see it. Only what the root's defineSpace lists in store: { ships: { <source key>: [<alias>, ...] } } ships; every other sub-Space and linked item stays private, and publishing (an update of an existing listing included) is refused until that list is deployed. The result (and --dry-run) names what ships and what stays private under ships. Notis runs the same safety scan and Owner check as the submission page and explains any refusal, including a shipped view that reads or writes a database that stays private.
690
708
 
691
709
  Options:
692
710
  - `--channel <link|team|public>` — Where to publish: anyone with the link, your team or everyone.
@@ -694,7 +712,7 @@ Options:
694
712
  - `--starter <json>` — Starter row IDs per database ({"<database-id>":["<record-key>"]}).
695
713
  - `--notes <text>` — Release notes for this version.
696
714
  - `--request-id <key>` — Stable intent key. Reuse after timeouts or lost replies.
697
- - `--dry-run` — Show the package counts and review diff without publishing.
715
+ - `--dry-run` — Show what ships and stays private, the package counts and the review diff without publishing.
698
716
 
699
717
  Examples:
700
718
  - `npx --package @notis_ai/cli@latest -- notis spaces store publish <space-id> --channel team --request-id publish-1 --dry-run`
@@ -991,6 +1009,67 @@ Examples:
991
1009
  - `npx --package @notis_ai/cli@latest -- notis computer ssh --revoke <key_id>`
992
1010
 
993
1011
 
1012
+ ## Repository secrets
1013
+
1014
+ Keep a repository's secrets encrypted for your team (or for you alone without a team): single variables, such as `STRIPE_SECRET_KEY`, or whole env files named by their path in the repository, such as `server/.env`. Notis never shows a value again, to you or anyone: `list` answers names, kinds, who set each one and when. `set` reads the value here (`--file` or `--stdin`, never an argument) and any team member can replace one. `exec` runs a command with the repository's secrets as environment variables, never as a file: everything after `--` is the command, and it never prints a value (names of secrets it left out go to stderr). Branch dev servers get them this way. Agents use `LOCAL_NOTIS_LIST_REPOSITORY_SECRETS` and `LOCAL_NOTIS_MANAGE_REPOSITORY_SECRETS`, which never return a value; people use Settings, Cloud Computer, Repository secrets.
1015
+
1016
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets list`
1017
+
1018
+ List the repository secrets of your team (or your own): names, kinds, who set each one and when.
1019
+
1020
+ When to use: See which variables and env files Notis keeps for a repository. Values are never shown.
1021
+
1022
+ Options:
1023
+ - `--repository <name>` — Only this repository.
1024
+
1025
+ Examples:
1026
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets list`
1027
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets list --repository notis`
1028
+
1029
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets set`
1030
+
1031
+ Store or replace a variable or an env file as a repository secret, encrypted. It is never shown again.
1032
+
1033
+ When to use: Give the team's dev servers a key (--name STRIPE_SECRET_KEY --stdin) or a whole env file (--file server/.env). Any team member can replace one.
1034
+
1035
+ Options:
1036
+ - `--repository <name>` — The repository's short name, such as notis.
1037
+ - `--name <name>` — A variable's name, such as STRIPE_SECRET_KEY, or the env file's path in the repository, such as server/.env (defaults to --file).
1038
+ - `--file <path>` — Read the value from this file.
1039
+ - `--stdin` — Read the value from standard input.
1040
+
1041
+ Examples:
1042
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets set --repository notis --file server/.env`
1043
+ - `printf %s "$KEY" | notis repository-secrets set --repository web --name STRIPE_SECRET_KEY --stdin`
1044
+
1045
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets delete`
1046
+
1047
+ Remove a repository secret.
1048
+
1049
+ When to use: A variable or env file the repository no longer needs.
1050
+
1051
+ Options:
1052
+ - `--repository <name>` — The repository's short name, such as notis.
1053
+ - `--name <name>` — The variable's name or the env file's path, such as server/.env.
1054
+
1055
+ Examples:
1056
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets delete --repository notis --name portal/.env.local`
1057
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets delete --repository web --name STRIPE_SECRET_KEY`
1058
+
1059
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets exec [command...]`
1060
+
1061
+ Run a command with the repository's secrets as environment variables. Never prints a value.
1062
+
1063
+ When to use: Start a dev server or a script that needs the repository's keys, without writing them to a file. Everything after -- is the command; it gets your environment plus the secrets, and NOTIS_REPOSITORY_SECRET_NAMES lists their names. Needs a CLI sign-in that can write.
1064
+
1065
+ Options:
1066
+ - `--repository <name>` — The repository's short name, such as notis.
1067
+
1068
+ Examples:
1069
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets exec --repository notis -- ./dev.sh`
1070
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets exec --repository web -- npm run dev`
1071
+
1072
+
994
1073
  ## Generic Tools
995
1074
 
996
1075
  ### `npx --package @notis_ai/cli@latest -- notis tools toolkits`
@@ -20,6 +20,28 @@
20
20
  },
21
21
  "toolkit_live_pieces": [],
22
22
  "toolkit_note": "Rules with a toolkit_piece point at a hand-rolled pattern the live Notis toolkit replaces. They stay warnings until that piece name is added to toolkit_live_pieces, then they refuse like any error.",
23
+ "icons": {
24
+ "id": "space-unknown-icon",
25
+ "profiles": ["space"],
26
+ "description": "Every name the toolkit's Icon draws (SHAPES in packages/sdk/src/ui/icons.tsx, exported as ICON_NAMES; packages/sdk/src/ui/icons.test.tsx fails when this list drifts from it). A kebab-case string literal handed to a toolkit icon input must be one of them: name on Icon and icon on any other component imported from @notis/sdk (aliases and namespaces resolved), and an icon field of an object that also has a label (reader actions, menu items, tabs). Only whole literal values are read, never text inside strings or comments; Phosphor stored names (phosphor:x), emoji, URLs and the Space config files (whose icon is a phosphor:<name> the deploy checks) are not checked. {name} and {suggestions} fill the message.",
27
+ "message": "Unknown icon \"{name}\": the toolkit has no icon by that name, so it draws nothing. Closest names: {suggestions}. Use a name from the toolkit set (every name is listed in the notis-spaces SDK reference) or pass a @phosphor-icons/react element as the icon.",
28
+ "suggestions": 3,
29
+ "exclude": ["**/space.config.*", "**/notis.config.*"],
30
+ "names": [
31
+ "archive", "arrow-bend-up-right", "arrow-clockwise", "arrow-counter-clockwise", "arrow-left", "arrow-square-out",
32
+ "arrows-clockwise", "arrows-left-right", "arrows-out", "caret-down", "caret-left", "caret-right",
33
+ "caret-up", "chart-line-up", "chat-circle-text", "chats", "check", "check-circle",
34
+ "check-circle-fill", "circle", "circle-dashed", "circle-half", "circle-three-quarter", "clipboard-text",
35
+ "clock", "clock-countdown", "copy", "corners-out", "dots-three", "download-simple",
36
+ "envelope-open", "envelope-simple", "file", "file-audio", "file-image", "file-text",
37
+ "file-video", "flask", "fork-knife", "funnel-simple", "hourglass", "info",
38
+ "kanban", "link", "magnifying-glass-minus", "magnifying-glass-plus", "minus-circle", "paper-plane-right",
39
+ "paper-plane-tilt", "paperclip", "pause", "pencil-simple", "play", "plus",
40
+ "rocket-launch", "sidebar-simple", "sparkle", "square-center", "star", "star-fill",
41
+ "toggle-left", "toggle-right", "trash", "tray-arrow-up", "user-plus", "x",
42
+ "x-circle-fill"
43
+ ]
44
+ },
23
45
  "rules": [
24
46
  {
25
47
  "id": "no-side-bar",