insta 0.0.83 → 0.1.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.
@@ -7,7 +7,7 @@ import { alreadyTracked, ensureGitignore } from '../gitignore.js';
7
7
  const MARKER = 'insta-observe';
8
8
  // What the hook leaves under ./.insta that is machine-local, not project source: observe/ is a
9
9
  // copy of this CLI version's hook + scanner (regenerated by every `project link`), and
10
- // audit.jsonl is this machine's findings (fingerprints + redacted context — `insta observe sync`
10
+ // audit.jsonl is this machine's findings (fingerprints + redacted context — `insta agent observe sync`
11
11
  // is the share path). ./.insta/project.json stays committable: it is the team's project binding.
12
12
  const LOCAL_PATHS = ['.insta/observe/', '.insta/audit.jsonl'];
13
13
  const GITIGNORE_COMMENT = '# InstaCloud: local observe-hook state (regenerated per machine, not source)';
@@ -1,4 +1,4 @@
1
- // `insta services add` with no type (or no name): the kinds are otherwise only discoverable by
1
+ // `insta service add` with no type (or no name): the kinds are otherwise only discoverable by
2
2
  // guessing wrong and reading `type must be postgres|storage|compute|redis|mysql|mongodb`, so missing arguments answer
3
3
  // "what can I add?" instead. The list mirrors the dashboard's Add Service menu (frontend
4
4
  // `add-service-button.tsx`) — Docker Image sits BESIDE Empty Service, not under it, because
@@ -41,8 +41,8 @@ export function suggestServiceName(ref) {
41
41
  /** The non-interactive command for a kind — what an agent should run instead of being asked. */
42
42
  export function kindCommand(k) {
43
43
  if (k.needsImage)
44
- return `insta services add compute <name> --image <ref> --port <n>`;
45
- return `insta services add ${k.type} ${k.defaultName}`;
44
+ return `insta service add compute <name> --image <ref> --port <n>`;
45
+ return `insta service add ${k.type} ${k.defaultName}`;
46
46
  }
47
47
  /** The kind list, one line each — what a terminal picks from and an agent reads. */
48
48
  export function serviceKindLines() {
@@ -57,7 +57,7 @@ export function missingArgsMessage(type) {
57
57
  return ['what to add:', ...serviceKindLines()].join('\n');
58
58
  }
59
59
  /**
60
- * Fill in whatever `insta services add` was not given. An unknown type passes straight through so
60
+ * Fill in whatever `insta service add` was not given. An unknown type passes straight through so
61
61
  * `assertType` — not this — reports it, keeping one wording for a bad type everywhere. Flags that
62
62
  * were already supplied are never asked for again.
63
63
  */
package/dist/telemetry.js CHANGED
@@ -29,17 +29,17 @@ const SERVICE = oneOf(SERVICE_TYPES);
29
29
  // `login`/`env use` accept the name case-insensitively; so does this.
30
30
  const ENV = (v) => isEnvName(v.trim().toLowerCase());
31
31
  const ON_OFF = oneOf(['on', 'off']);
32
- const TARGET = oneOf(['db', 'compute', 'redis', 'mysql', 'mongodb']);
33
32
  const POLICY_ACTION = (v) => /^(?:secrets|deploy|project|branch|service|storage)(?:\.[a-zA-Z]+)?$/.test(v);
34
33
  const SAFE_ARGS = {
35
34
  'env use': { 0: ENV }, 'project link': { 0: ID },
36
- 'services add': { 0: SERVICE }, 'services remove': { 0: SERVICE }, 'services rename': { 0: SERVICE }, 'services secrets': { 0: SERVICE },
37
- 'services set-access': { 0: SERVICE, 2: oneOf(['public', 'private']) },
38
- 'services scale': { 0: SERVICE, 2: NUMBER, 3: REGION }, 'services upgrade': { 0: SERVICE, 2: SLUG },
39
- 'compute always-on': { 0: ON_OFF }, 'db always-on': { 0: ON_OFF }, metrics: { 0: TARGET }, logs: { 0: TARGET },
40
- 'template info': { 0: SLUG }, 'billing upgrade': { 0: oneOf(['pro', 'team']) },
41
- 'approvals approve': { 0: ID }, 'approvals deny': { 0: ID },
42
- 'agent-policy rule set': { 0: POLICY_ACTION, 1: oneOf(['allow', 'deny', 'approve']) }, autoupdate: { 0: ON_OFF },
35
+ 'service add': { 0: SERVICE }, 'service remove': { 0: SERVICE }, 'service rename': { 0: SERVICE },
36
+ 'storage set-access': { 0: oneOf(['public', 'private']) },
37
+ 'compute scale': { 0: NUMBER },
38
+ 'compute always-on': { 0: ON_OFF }, 'postgres always-on': { 0: ON_OFF },
39
+ 'redis always-on': { 0: ON_OFF }, 'mysql always-on': { 0: ON_OFF }, 'mongodb always-on': { 0: ON_OFF },
40
+ 'template info': { 0: SLUG }, 'billing subscribe': { 0: oneOf(['pro', 'team']) },
41
+ 'agent approvals approve': { 0: ID }, 'agent approvals deny': { 0: ID },
42
+ 'agent policy rule set': { 0: POLICY_ACTION, 1: oneOf(['allow', 'deny', 'approve']) }, 'config autoupdate': { 0: ON_OFF },
43
43
  };
44
44
  const SAFE_OPTIONS = {
45
45
  org: ID, project: ID, region: REGION, env: ENV, oauth: oneOf(['github', 'google']),
package/dist/util.js CHANGED
@@ -204,20 +204,23 @@ export function handleApproval(res, json) {
204
204
  if (res.status === 202 && res.body?.status === 'approval_required') {
205
205
  if (json)
206
206
  printJson(res.body);
207
- process.stderr.write(`approval required for ${res.body.action} — run: insta approvals approve ${res.body.approvalId}\n`);
207
+ process.stderr.write(`approval required for ${res.body.action} — run: insta agent approvals approve ${res.body.approvalId}\n`);
208
208
  process.exitCode = 2;
209
209
  return true;
210
210
  }
211
211
  return false;
212
212
  }
213
- // Neutral op → an `insta` command string. Unknown ops fall back to reason-only (no crash).
213
+ // Neutral op → an `insta` command string. Unknown ops fall back to reason-only (no crash). The
214
+ // platform names an observability target with its component word (`db` for postgres); the CLI
215
+ // groups by service type, so the target becomes the parent command.
216
+ const targetGroup = (a) => (a.target === 'db' ? 'postgres' : String(a.target ?? 'compute'));
214
217
  const OP_COMMAND = {
215
- 'service.add': (a) => `insta services add ${a.type ?? '<type>'} ${a.name ?? '<name>'}`,
218
+ 'service.add': (a) => `insta service add ${a.type ?? '<type>'} ${a.name ?? '<name>'}`,
216
219
  deploy: (a) => `insta deploy${a.branch ? ` --branch ${a.branch}` : ''}`,
217
220
  'secrets.set': (a) => `insta secrets set ${a.name ?? '<NAME>'} ${a.value ?? '<value>'}`,
218
- metrics: (a) => `insta metrics ${a.target ?? 'compute'}`,
219
- logs: (a) => `insta logs ${a.target ?? 'compute'}`,
220
- 'approvals.approve': (a) => `insta approvals approve ${a.approvalId ?? '<id>'}`,
221
+ metrics: (a) => `insta ${targetGroup(a)} metrics`,
222
+ logs: (a) => `insta ${targetGroup(a)} logs`,
223
+ 'approvals.approve': (a) => `insta agent approvals approve ${a.approvalId ?? '<id>'}`,
221
224
  };
222
225
  // Pure — builds the printable lines (unit-tested). Empty input → [].
223
226
  export function nextActionsLines(actions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insta",
3
- "version": "0.0.83",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "InstaCloud CLI — a thin client of the platform control-plane API.",
6
6
  "keywords": [