@instafy/cli 0.2.2 → 0.2.4

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 (52) hide show
  1. package/README.md +60 -3
  2. package/dist/bind/LICENSE +661 -0
  3. package/dist/bind/bin/instafy-bind.mjs +542 -0
  4. package/dist/bind/client/bind-client.js +1219 -0
  5. package/dist/bind/src/apply.mjs +293 -0
  6. package/dist/bind/src/bound.mjs +202 -0
  7. package/dist/bind/src/budget.mjs +58 -0
  8. package/dist/bind/src/check.mjs +176 -0
  9. package/dist/bind/src/config.mjs +180 -0
  10. package/dist/bind/src/controller.mjs +244 -0
  11. package/dist/bind/src/executors/agent.mjs +336 -0
  12. package/dist/bind/src/executors/script.mjs +163 -0
  13. package/dist/bind/src/handler-kit.mjs +150 -0
  14. package/dist/bind/src/init.mjs +238 -0
  15. package/dist/bind/src/jobs.mjs +316 -0
  16. package/dist/bind/src/net.mjs +281 -0
  17. package/dist/bind/src/page-fetch.mjs +43 -0
  18. package/dist/bind/src/preview-host.mjs +114 -0
  19. package/dist/bind/src/protocol.mjs +103 -0
  20. package/dist/bind/src/records-schema.mjs +580 -0
  21. package/dist/bind/src/records.mjs +161 -0
  22. package/dist/bind/src/save-owner.mjs +492 -0
  23. package/dist/bind/src/schema-lite.mjs +212 -0
  24. package/dist/bind/src/server.mjs +908 -0
  25. package/dist/bind/src/sse.mjs +119 -0
  26. package/dist/bind/src/starters/blank/app.js +17 -0
  27. package/dist/bind/src/starters/blank/index.html +22 -0
  28. package/dist/bind/src/starters/checklist/app.js +171 -0
  29. package/dist/bind/src/starters/checklist/bound.json +29 -0
  30. package/dist/bind/src/starters/checklist/data.json +26 -0
  31. package/dist/bind/src/starters/checklist/index.html +23 -0
  32. package/dist/bind/src/starters/compare/app.js +316 -0
  33. package/dist/bind/src/starters/compare/bound.json +26 -0
  34. package/dist/bind/src/starters/compare/data.json +170 -0
  35. package/dist/bind/src/starters/compare/index.html +23 -0
  36. package/dist/bind/src/starters/handlers/read_offer.mjs +55 -0
  37. package/dist/bind/src/starters/handlers/set_check.mjs +41 -0
  38. package/dist/bind/src/starters/ranked/app.js +166 -0
  39. package/dist/bind/src/starters/ranked/bound.json +26 -0
  40. package/dist/bind/src/starters/ranked/data.json +142 -0
  41. package/dist/bind/src/starters/ranked/index.html +23 -0
  42. package/dist/bind/src/starters/site.js +888 -0
  43. package/dist/bind/src/starters/theme.css +492 -0
  44. package/dist/bind/src/starters/timeline/app.js +143 -0
  45. package/dist/bind/src/starters/timeline/data.json +41 -0
  46. package/dist/bind/src/starters/timeline/index.html +22 -0
  47. package/dist/bind/src/static.mjs +141 -0
  48. package/dist/bind/src/tokens.mjs +102 -0
  49. package/dist/bind/src/try.mjs +139 -0
  50. package/dist/bind/src/web.mjs +191 -0
  51. package/dist/cli.js +5031 -2446
  52. package/package.json +5 -4
package/README.md CHANGED
@@ -31,14 +31,23 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
31
31
  - Works for existing members and pending invites.
32
32
  - `builder` means read & write.
33
33
  - Fallbacks: `--space <id>` or `--team-id <uuid>` when the folder is not linked yet
34
- - `instafy conversation search "<keywords>"` — find earlier conversations in the linked space by title, preview, and recent message content.
35
- - `instafy conversation show "<title-or-id>"` — inspect one conversation’s messages so you can reuse earlier context in a new chat.
34
+ - `instafy conversation search "<keywords>"` — search recent titles/previews and recent messages in at most 12 conversations. Use `grep` for persisted message content beyond those recent pages.
35
+ - `instafy conversation grep "<text>" --json` — search authorized persisted user/assistant messages in the linked space, with snippets and exact message IDs.
36
+ - `instafy conversation context <conversationId> <messageId> --json` — read a bounded window around an exact message, including old messages outside the latest history page.
37
+ - `instafy conversation show "<title-or-id>"` — inspect one conversation’s messages so you can reuse earlier context in a new chat. With no target it reads `INSTAFY_CONVERSATION_ID`, the conversation a runtime job belongs to.
38
+ - Add `--transcript --json` for original user/assistant text with message IDs and timestamps, without tool events or runtime metadata. JSON messages are newest first; `--limit` counts transcript messages (default 80, maximum 200). Each call scans at most 2,000 stored rows. When `hasMore` is true, continue with `--transcript --cursor <nextCursor>`; an empty page can still have older text. This is a text-only view: attachment/card metadata stays available in the unchanged raw `--json` output.
36
39
  - `instafy conversation create --parent <conversationId> --thread-kind agent --title "Octo coordination"` — create a linked child thread for conversation-native agent coordination.
37
40
  - `instafy chat --conversation <threadId> "@octo ..." --no-wait` — involve another agent by posting a normal message into a normal conversation/thread. Use non-blocking posts from inside an active runtime turn.
38
41
  - Like an ordinary Studio chat, the CLI marks the turn as potentially workspace-writing. Controller and member permissions still apply, and read-only questions do not require a file change.
42
+ - `instafy bind serve <site>` — serve a bound site: a website whose clicks become typed intents, run by a handler script, with records streamed back to every viewer. "Ask Octo" clicks are handed to Studio and sent as the clicker's own chat message, so the binder needs no login. Runs the binder bundled with the CLI (`packages/instafy-bind`, copied into `dist/bind` at build time; `INSTAFY_BIND_BIN` overrides it). See `docs/Bound-Sites.md`.
39
43
  - `instafy agents list` — list available top-level agents.
44
+ - `instafy agents settings` — inspect the linked space's shared multi-agent limits. Add `--interactive` to edit them, or use `--max-agents-per-plan <n>` and/or `--max-concurrent-agents <n>`.
45
+ - Plans default to at most 64 team workers (range 1–256); at most 8 team workers run concurrently across the space (range 1–64), subject to runtime capacity. Lead/root jobs and native provider subagents are outside the concurrent team-worker count. Changing settings requires permission to manage the space; runtime job tokens cannot change them.
40
46
  - `instafy agents context list --query "<topic>"` — inspect optional compact scoped context-card hints for cross-agent coordination.
41
47
  - `instafy agents context put --agent @octo "<summary>"` — save/update a compact context card for the current conversation when `INSTAFY_CONVERSATION_ID` is set.
48
+ - `instafy automations create --name "Octo check-in" --mode space_review --schedule-kind hourly --interval-hours 24` — explicitly opt in to private, quiet space reviews; no custom prompt is needed.
49
+ - `instafy recommendations list --limit 200 --json` — inspect the linked space's recommendations, including delivery state and accepted or dismissed outcomes visible to this session.
50
+ - `instafy recommendations submit --file - --json` — read one JSON recommendation from stdin. Add an optional `message` to deliver a normal private Octo chat with source links; omit it for legacy proposal-only behavior. A workspace file can replace `-`. Delivery does not start the suggested work. Delivered, accepted and dismissed keys keep their existing outcome.
42
51
  - Context cards are a bounded cache, not the primary collaboration path: the controller keeps the newest 200 cards per user/project/agent.
43
52
  - Use context cards for soft work focus and overlap hints, not hard locks: note the agent/thread, topic/path/domain, open questions, and where follow-up should go. Structured `writeScope` metadata remains the safety mechanism for concurrent file edits.
44
53
  - `instafy git <args...>` — run git commands against an Instafy canonical checkout (`.instafy/.git`) when present.
@@ -46,6 +55,7 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
46
55
  - `instafy tunnel list` — list local tunnels started by the CLI.
47
56
  - `instafy tunnel logs <tunnelId> --follow` — tail tunnel logs.
48
57
  - `instafy tunnel stop <tunnelId>` — stop + revoke a tunnel.
58
+ - `instafy preview check --port <port>` — load a local site in a headless browser and list its errors, failed requests and a blank page, with desktop and phone screenshots. Local only; see [docs/CLI.md](https://github.com/instafy-dev/instafy/blob/main/docs/CLI.md#previews) for exit codes and settings.
49
59
  - `instafy secrets list` — list space secret metadata (names/descriptions, never values).
50
60
  - `instafy secrets get <name-or-id>` — inspect one space secret metadata entry.
51
61
  - `instafy secrets put <name> --value ...` — create/update a space secret.
@@ -58,6 +68,14 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
58
68
  signed-in user.
59
69
  - `instafy support list` — list only your own support reports.
60
70
  - `instafy support show <reportId>` — inspect one of your own support reports.
71
+ - `instafy support messages <reportId>` — read the customer-visible case timeline.
72
+ - `instafy support reply <reportId> "More details"` — add a follow-up as the reporter.
73
+
74
+ `support report` and `support reply` print their request UUID to stderr before sending. Reuse that
75
+ value with `--client-request-id` only when retrying the exact same payload after an uncertain
76
+ network result; using the same UUID for different content is rejected.
77
+ Support list/message JSON includes `hasMore` and a stable `nextCursor`; pass its paired activity or
78
+ message cursor flags to read the next page without skipping reports that share a cursor timestamp.
61
79
  - `instafy diagnostics runtime-events` — emit sanitized runtime events for the linked space as
62
80
  versioned JSON.
63
81
  - `instafy diagnostics run-result <runId>` — emit one authorized persisted run result as
@@ -69,6 +87,43 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
69
87
 
70
88
  Run `instafy --help` for the public command list and options.
71
89
 
90
+ ## Search conversation context
91
+
92
+ After `instafy login`, local agents and terminal users can recover earlier chat evidence without
93
+ opening Studio:
94
+
95
+ ```bash
96
+ instafy conversation grep "auth session" --json
97
+ instafy conversation grep "auth session" --org <orgId> --limit 20 --json
98
+ instafy conversation context <conversationId> <messageId> --before 20 --after 20 --json
99
+ rg "auth session" .
100
+ ```
101
+
102
+ Use `grep` for conversation messages and `rg` for local files. `grep` matches literal,
103
+ case-insensitive text (2–200 characters), not regular expressions. It searches the linked space by
104
+ default; choose one of `--space <id>`, `--org <id>`, `--personal`, or `--all` to change scope. Access
105
+ and conversation visibility are enforced by the controller. These reads do not wake a runtime.
106
+
107
+ Results are newest first, with a default page of 30 messages (maximum 50). Repeat the same query
108
+ and scope with `--cursor <nextCursor>` to continue. JSON includes plain-text snippets, UTF-16
109
+ highlight ranges, stable IDs, and pagination. Human output is one escaped line per match:
110
+ `spaceId:conversationId:messageId:role:timestamp: snippet`. Exit codes are 0 for matches, 1 for no
111
+ matches, and 2 for errors, including invalid arguments. JSON no-match output remains a valid empty
112
+ result page.
113
+
114
+ `context` defaults to 20 messages before and after the target (maximum 50 each). JSON retains
115
+ canonical message IDs in newest-first order and provides `olderCursor`/`newerCursor` plus
116
+ `hasOlder`/`hasNewer`. To read farther back, use the older cursor as the next message ID with
117
+ `--before 40 --after 0`; to read forward, use the newer cursor with `--before 0 --after 40`.
118
+ Adjacent pages repeat their anchor; deduplicate by message ID. Human context is chronological and
119
+ marks the requested message with `>`.
120
+
121
+ Both commands require signed-in user credentials from `instafy login`, an explicit user
122
+ `--access-token`, or `INSTAFY_ACCESS_TOKEN`/`SUPABASE_ACCESS_TOKEN`. They do not accept unattended
123
+ runtime-agent, origin, or service credentials and do not mint runtime tokens. Saved logins remain
124
+ bound to their controller origin. The controller must support message search/context; older
125
+ controllers report the unavailable API rather than falling back to a partial recent-message scan.
126
+
72
127
  ## AI-readable diagnostics
73
128
 
74
129
  `instafy diagnostics` is the machine-readable diagnostics surface for local agents such as Codex
@@ -96,7 +151,9 @@ explicit user access token), and the controller limits list/show operations to r
96
151
  that user. Reports use the currently linked space by default; pass `--no-linked-space` to omit that
97
152
  context. Diagnostics are opt-in: details, metadata, logs, and screenshots are uploaded only when
98
153
  their corresponding flags are supplied, and file inputs must stay within the active workspace.
99
- Use `--preview` to inspect the upload summary without sending a report.
154
+ The signed-in account identity, including its email snapshot, is attached for report ownership and
155
+ support contact; it is not part of the optional diagnostic payload. Use `--preview` to inspect the
156
+ upload summary without sending a report.
100
157
  Ordinary users receive a minimized owner-only report view; full triage fields and attachment bytes
101
158
  require operator/service authorization.
102
159