@notis_ai/cli 0.2.32 → 0.2.34

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 (95) hide show
  1. package/README.md +75 -11
  2. package/dist/agent-hooks/notis-agent-hook.mjs +4407 -905
  3. package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
  4. package/dist/base-skills/notis-cli/SKILL.md +7 -3
  5. package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
  6. package/dist/base-skills/notis-spaces/SKILL.md +5 -3
  7. package/dist/base-skills/notis-spaces/references/comments.md +102 -0
  8. package/dist/base-skills/notis-spaces/references/context.md +20 -19
  9. package/dist/base-skills/notis-spaces/references/design.md +3 -2
  10. package/dist/base-skills/notis-spaces/references/sdk.md +135 -83
  11. package/dist/base-skills/notis-spaces/references/store.md +24 -1
  12. package/dist/sdk/src/components/NotisSelectionBoundary.tsx +13 -5
  13. package/dist/sdk/src/components/SelectionActionBar.tsx +45 -8
  14. package/dist/sdk/src/components/SpaceTextComments.tsx +293 -0
  15. package/dist/sdk/src/components/selectionRange.ts +65 -0
  16. package/dist/sdk/src/config.ts +3 -1
  17. package/dist/sdk/src/functions.ts +218 -0
  18. package/dist/sdk/src/hooks/useAgentQueue.ts +17 -28
  19. package/dist/sdk/src/hooks/useCollectionInteractions.ts +66 -9
  20. package/dist/sdk/src/hooks/useConnection.ts +102 -0
  21. package/dist/sdk/src/hooks/useFunction.ts +42 -0
  22. package/dist/sdk/src/hooks/useNotisSettings.ts +101 -0
  23. package/dist/sdk/src/index.ts +16 -4
  24. package/dist/sdk/src/interactions/shortcuts.tsx +6 -1
  25. package/dist/sdk/src/interactions/swipeDownToDismiss.ts +158 -0
  26. package/dist/sdk/src/interactions/textBoxTwoState.ts +174 -0
  27. package/dist/sdk/src/interactions.ts +17 -0
  28. package/dist/sdk/src/runtime.ts +16 -1
  29. package/dist/sdk/src/space.ts +401 -33
  30. package/dist/sdk/src/ui/comments/passageModel.ts +99 -0
  31. package/dist/sdk/src/ui/comments/textHighlights.ts +33 -0
  32. package/dist/skill-sync/index.js +262 -31
  33. package/dist/skill-sync-worker.mjs +515 -127
  34. package/dist/space-harness/host.js +389 -154
  35. package/dist/space-sdk/dist/chunk-3NPBCE6E.js +3 -0
  36. package/dist/space-sdk/dist/index.js +3 -3
  37. package/dist/space-sdk/dist/ui.js +16 -11
  38. package/dist/space-sdk/src/config.ts +3 -1
  39. package/dist/space-sdk/src/functions.ts +218 -0
  40. package/dist/space-sdk/src/hooks/useAgentQueue.d.ts +2 -13
  41. package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +7 -0
  42. package/dist/space-sdk/src/hooks/useConnection.d.ts +42 -0
  43. package/dist/space-sdk/src/hooks/useFunction.d.ts +20 -0
  44. package/dist/space-sdk/src/hooks/useNotisSettings.d.ts +48 -0
  45. package/dist/space-sdk/src/index.d.ts +10 -4
  46. package/dist/space-sdk/src/interactions/shortcuts.d.ts +5 -0
  47. package/dist/space-sdk/src/runtime.d.ts +14 -1
  48. package/dist/space-sdk/src/space.ts +401 -33
  49. package/dist/space-sdk/src/tailwind-candidates.d.ts +400 -204
  50. package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +90 -15
  51. package/dist/space-sdk/src/ui/comments/PassageComments.d.ts +4 -1
  52. package/dist/space-sdk/src/ui/comments/agentRuntime.d.ts +4 -2
  53. package/dist/space-sdk/src/ui/comments/commentDrafts.d.ts +63 -0
  54. package/dist/space-sdk/src/ui/comments/commentModel.d.ts +59 -88
  55. package/dist/space-sdk/src/ui/comments/commentWords.d.ts +32 -1
  56. package/dist/space-sdk/src/ui/comments/handover.d.ts +34 -0
  57. package/dist/space-sdk/src/ui/comments/hostComments.d.ts +13 -9
  58. package/dist/space-sdk/src/ui/comments/hostPanel.d.ts +113 -0
  59. package/dist/space-sdk/src/ui/comments/index.d.ts +7 -2
  60. package/dist/space-sdk/src/ui/comments/paneOutlet.d.ts +33 -0
  61. package/dist/space-sdk/src/ui/comments/paneParts.d.ts +71 -27
  62. package/dist/space-sdk/src/ui/comments/passageModel.d.ts +12 -36
  63. package/dist/space-sdk/src/ui/comments/reviewRun.d.ts +190 -0
  64. package/dist/space-sdk/src/ui/comments/useCommentRouting.d.ts +26 -4
  65. package/dist/space-sdk/src/ui/comments/useComments.d.ts +116 -77
  66. package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +8 -4
  67. package/dist/space-sdk/src/ui/index.d.ts +1 -1
  68. package/dist/space-sdk/src/ui/layout/SidePane.d.ts +3 -4
  69. package/dist/space-sdk/src/ui/period/dateFormat.d.ts +27 -8
  70. package/dist/view-renderer/dist/host.js +450 -215
  71. package/package.json +3 -3
  72. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
  73. package/skills/notis-spaces/cli.md +3 -3
  74. package/src/cli.js +2 -1
  75. package/src/command-specs/index.js +3 -0
  76. package/src/command-specs/repository-secrets.js +171 -0
  77. package/src/command-specs/spaces.js +3 -3
  78. package/src/runtime/agent-credential.js +175 -0
  79. package/src/runtime/agent-identity.js +95 -19
  80. package/src/runtime/app-platform.js +8 -0
  81. package/src/runtime/auth-recovery.js +14 -0
  82. package/src/runtime/profiles.js +74 -2
  83. package/src/runtime/skill-sync/cloud-client.ts +33 -3
  84. package/src/runtime/skill-sync/index.ts +4 -3
  85. package/src/runtime/skill-sync/symlink-manager.ts +354 -35
  86. package/src/runtime/skill-sync/types.ts +14 -2
  87. package/src/runtime/space-functions.js +213 -0
  88. package/src/runtime/space-platform.js +12 -3
  89. package/src/runtime/space-source.js +116 -13
  90. package/src/runtime/space-test-server.js +22 -4
  91. package/src/runtime/space-verification.js +3 -1
  92. package/src/runtime/transport.js +15 -0
  93. package/dist/sdk/src/components/NotisCommentBoundary.tsx +0 -132
  94. package/dist/space-sdk/dist/chunk-I4Z4UFGB.js +0 -3
  95. package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +0 -26
package/README.md CHANGED
@@ -64,23 +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
- - 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.
83
- - 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.
85
+ - 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.
86
+ - Comments are being rolled out: on an account without them the comment tool is not available. Where they are 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
87
 
85
88
  ## Authentication
86
89
 
@@ -698,9 +701,9 @@ Examples:
698
701
 
699
702
  ### `npx --package @notis_ai/cli@latest -- notis spaces store publish <space-id>`
700
703
 
701
- Publish a Space and its sub-Spaces as the next Store version.
704
+ Publish what a Space's source lists in store.ships as the next Store version.
702
705
 
703
- 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.
706
+ 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.
704
707
 
705
708
  Options:
706
709
  - `--channel <link|team|public>` — Where to publish: anyone with the link, your team or everyone.
@@ -708,7 +711,7 @@ Options:
708
711
  - `--starter <json>` — Starter row IDs per database ({"<database-id>":["<record-key>"]}).
709
712
  - `--notes <text>` — Release notes for this version.
710
713
  - `--request-id <key>` — Stable intent key. Reuse after timeouts or lost replies.
711
- - `--dry-run` — Show the package counts and review diff without publishing.
714
+ - `--dry-run` — Show what ships and stays private, the package counts and the review diff without publishing.
712
715
 
713
716
  Examples:
714
717
  - `npx --package @notis_ai/cli@latest -- notis spaces store publish <space-id> --channel team --request-id publish-1 --dry-run`
@@ -1005,6 +1008,67 @@ Examples:
1005
1008
  - `npx --package @notis_ai/cli@latest -- notis computer ssh --revoke <key_id>`
1006
1009
 
1007
1010
 
1011
+ ## Repository secrets
1012
+
1013
+ 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.
1014
+
1015
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets list`
1016
+
1017
+ List the repository secrets of your team (or your own): names, kinds, who set each one and when.
1018
+
1019
+ When to use: See which variables and env files Notis keeps for a repository. Values are never shown.
1020
+
1021
+ Options:
1022
+ - `--repository <name>` — Only this repository.
1023
+
1024
+ Examples:
1025
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets list`
1026
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets list --repository notis`
1027
+
1028
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets set`
1029
+
1030
+ Store or replace a variable or an env file as a repository secret, encrypted. It is never shown again.
1031
+
1032
+ 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.
1033
+
1034
+ Options:
1035
+ - `--repository <name>` — The repository's short name, such as notis.
1036
+ - `--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).
1037
+ - `--file <path>` — Read the value from this file.
1038
+ - `--stdin` — Read the value from standard input.
1039
+
1040
+ Examples:
1041
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets set --repository notis --file server/.env`
1042
+ - `printf %s "$KEY" | notis repository-secrets set --repository web --name STRIPE_SECRET_KEY --stdin`
1043
+
1044
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets delete`
1045
+
1046
+ Remove a repository secret.
1047
+
1048
+ When to use: A variable or env file the repository no longer needs.
1049
+
1050
+ Options:
1051
+ - `--repository <name>` — The repository's short name, such as notis.
1052
+ - `--name <name>` — The variable's name or the env file's path, such as server/.env.
1053
+
1054
+ Examples:
1055
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets delete --repository notis --name portal/.env.local`
1056
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets delete --repository web --name STRIPE_SECRET_KEY`
1057
+
1058
+ ### `npx --package @notis_ai/cli@latest -- notis repository-secrets exec [command...]`
1059
+
1060
+ Run a command with the repository's secrets as environment variables. Never prints a value.
1061
+
1062
+ 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.
1063
+
1064
+ Options:
1065
+ - `--repository <name>` — The repository's short name, such as notis.
1066
+
1067
+ Examples:
1068
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets exec --repository notis -- ./dev.sh`
1069
+ - `npx --package @notis_ai/cli@latest -- notis repository-secrets exec --repository web -- npm run dev`
1070
+
1071
+
1008
1072
  ## Generic Tools
1009
1073
 
1010
1074
  ### `npx --package @notis_ai/cli@latest -- notis tools toolkits`