@instafy/cli 0.3.0 → 0.3.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/README.md +3 -2
- package/dist/bind/src/net.mjs +13 -1
- package/dist/bind/src/web.mjs +7 -1
- package/dist/cli.js +1892 -86
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,8 +41,8 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
|
|
|
41
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
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`.
|
|
43
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
|
|
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
|
|
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>`, `--max-concurrent-agents <n>`, and/or `--max-native-subagents <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 helpers are outside the concurrent team-worker count. Native helpers have a separate limit of 3 children per parent (range 1–64), excluding the parent itself; this setting requires a supporting controller. Changing settings requires permission to manage the space; runtime job tokens cannot change them.
|
|
46
46
|
- `instafy agents context list --query "<topic>"` — inspect optional compact scoped context-card hints for cross-agent coordination.
|
|
47
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
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.
|
|
@@ -56,6 +56,7 @@ Run Instafy spaces locally and connect them back to Instafy Studio — from any
|
|
|
56
56
|
- `instafy tunnel logs <tunnelId> --follow` — tail tunnel logs.
|
|
57
57
|
- `instafy tunnel stop <tunnelId>` — stop + revoke a tunnel.
|
|
58
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.
|
|
59
|
+
- `instafy web read <url…> --json` — read up to 6 public pages over plain HTTP and get their text, links and structured data with provenance, wrapped as untrusted page content. robots.txt (including AI-agent user agents), skill-listed link-only sites, private-address checks at every redirect, stop rules and per-turn caps are enforced; see [docs/CLI.md](https://github.com/instafy-dev/instafy/blob/main/docs/CLI.md#reading-web-pages-instafy-web-read).
|
|
59
60
|
- `instafy secrets list` — list space secret metadata (names/descriptions, never values).
|
|
60
61
|
- `instafy secrets get <name-or-id>` — inspect one space secret metadata entry.
|
|
61
62
|
- `instafy secrets put <name> --value ...` — create/update a space secret.
|
package/dist/bind/src/net.mjs
CHANGED
|
@@ -48,8 +48,10 @@ function isPrivateV6(ip) {
|
|
|
48
48
|
if (allZeroUpTo(7) && g[7] === 1) return true; // ::1
|
|
49
49
|
const embedded = () => `${g[6] >> 8}.${g[6] & 255}.${g[7] >> 8}.${g[7] & 255}`;
|
|
50
50
|
if (allZeroUpTo(5) && g[5] === 0xffff) return isPrivateV4(embedded()); // ::ffff:a.b.c.d
|
|
51
|
+
if (allZeroUpTo(4) && g[4] === 0xffff && g[5] === 0) return isPrivateV4(embedded()); // ::ffff:0:a.b.c.d (SIIT translated)
|
|
51
52
|
if (allZeroUpTo(6)) return true; // ::a.b.c.d (deprecated compatible)
|
|
52
53
|
if (g[0] === 0x64 && g[1] === 0xff9b && g.slice(2, 6).every((x) => x === 0)) return isPrivateV4(embedded()); // NAT64
|
|
54
|
+
if (g[0] === 0x64 && g[1] === 0xff9b && g[2] === 1) return true; // 64:ff9b:1::/48 local-use NAT64 (RFC 8215): a network's own translator
|
|
53
55
|
if ((g[0] & 0xfe00) === 0xfc00) return true; // fc00::/7 unique local
|
|
54
56
|
if ((g[0] & 0xffc0) === 0xfe80) return true; // fe80::/10 link local
|
|
55
57
|
if ((g[0] & 0xffc0) === 0xfec0) return true; // fec0::/10 site local
|
|
@@ -70,6 +72,16 @@ export function isPrivateAddress(ip) {
|
|
|
70
72
|
|
|
71
73
|
const LOCAL_NAME_RE = /(^|\.)(localhost|local|internal|lan|home|intranet|localdomain)$/i;
|
|
72
74
|
|
|
75
|
+
/** True for a host name that names this machine or a local network (localhost, *.local, a single label, …). */
|
|
76
|
+
export function isLocalHostName(host) {
|
|
77
|
+
// A fully qualified name may end in a dot ("localhost.", "router.lan."); it names the same host.
|
|
78
|
+
// Trimmed with a loop, not /\.+$/, which backtracks quadratically on a long run of dots.
|
|
79
|
+
let end = host.length;
|
|
80
|
+
while (end > 0 && host.charCodeAt(end - 1) === 0x2e) end -= 1;
|
|
81
|
+
const name = host.slice(0, end);
|
|
82
|
+
return LOCAL_NAME_RE.test(name) || !name.includes(".");
|
|
83
|
+
}
|
|
84
|
+
|
|
73
85
|
/**
|
|
74
86
|
* Check that a URL points at a public http(s) host. Resolves DNS names.
|
|
75
87
|
* Returns {ok: true, addresses} or {ok: false, reason}.
|
|
@@ -88,7 +100,7 @@ export async function checkPublicUrl(raw, { allowLocal = false, lookup = dns.pro
|
|
|
88
100
|
if (net.isIP(host)) {
|
|
89
101
|
return isPrivateAddress(host) ? { ok: false, reason: `${host} is a private or local address` } : { ok: true, addresses: [host] };
|
|
90
102
|
}
|
|
91
|
-
if (
|
|
103
|
+
if (isLocalHostName(host)) return { ok: false, reason: `${host} is a local host name` };
|
|
92
104
|
let addresses;
|
|
93
105
|
try {
|
|
94
106
|
addresses = (await lookup(host, { all: true, verbatim: true })).map((entry) => entry.address);
|
package/dist/bind/src/web.mjs
CHANGED
|
@@ -5,7 +5,13 @@
|
|
|
5
5
|
import { isUnavailable, pageFetch } from "./page-fetch.mjs";
|
|
6
6
|
|
|
7
7
|
export const USER_AGENT = "Instafy-Agent/1.0 (+https://instafy.dev; reads one public page on a person's request)";
|
|
8
|
-
|
|
8
|
+
// The AI crawlers and the user-initiated AI fetchers (the closest match to a read on a person's request). A site that
|
|
9
|
+
// keeps any of them out of a path is not read there.
|
|
10
|
+
export const AI_AGENTS = [
|
|
11
|
+
"gptbot", "chatgpt-user", "oai-searchbot", "claudebot", "claude-user", "claude-searchbot", "anthropic-ai", "perplexitybot",
|
|
12
|
+
"perplexity-user", "ccbot", "google-extended", "applebot-extended", "meta-externalagent", "meta-externalfetcher",
|
|
13
|
+
"bytespider", "amazonbot", "cohere-ai", "mistralai-user", "duckassistbot",
|
|
14
|
+
];
|
|
9
15
|
|
|
10
16
|
/** robots.txt → [{ agents: [lowercase], rules: [{ allow, path }] }] */
|
|
11
17
|
export function parseRobots(txt) {
|