| import { ApiClient, requireProject } from '../api.js'; | ||
| import { info, printJson } from '../util.js'; | ||
| /** | ||
| * The label that names WHERE a resource runs. | ||
| * | ||
| * `kind` is the platform's internal resource kind, and for compute it is always 'fly' — 'fly' is | ||
| * the compute SEAT, occupied by the microvm plane on any environment that has cut over. Printing | ||
| * it is how `insta manifest` came to tell users and agents that a microvm-backed service ran on | ||
| * Fly (staging, 2026-08-25: `fly(api)` for a row serving from warm pod insta-warm-00178a-16). | ||
| * | ||
| * So for compute rows the label is the platform's explicit `provider`, and when that is absent -- | ||
| * an older platform, or a row whose provider the platform itself could not determine -- we fall | ||
| * back to the neutral 'compute'. That names the resource without asserting a plane: no provider | ||
| * beats a wrong one. Non-compute kinds keep printing their kind. | ||
| */ | ||
| export function resourceLabel(r) { | ||
| const kind = r.kind ?? 'resource'; | ||
| const label = kind === 'fly' ? (r.provider === 'fly' || r.provider === 'microvm' ? r.provider : 'compute') : kind; | ||
| return `${label}${r.name ? `(${r.name})` : ''}`; | ||
| } | ||
| // One `manifest` resource line. Pure, so the label is unit-tested without a network mock. | ||
| export function resourceLine(r) { | ||
| const where = r.ref?.url ?? r.ref?.bucket ?? r.ref?.neonProjectId ?? ''; | ||
| return ` - ${resourceLabel(r)} ${where} [${r.status}]`; | ||
| } | ||
| // Agent-legible view of each environment's databases / storage / compute. | ||
@@ -14,8 +37,6 @@ export async function manifest(opts) { | ||
| const rs = detail.resources.filter((r) => r.branchId === b.id || (b.is_default && r.branchId === null)); | ||
| for (const r of rs) { | ||
| const where = r.ref?.url ?? r.ref?.bucket ?? r.ref?.neonProjectId ?? ''; | ||
| info(` - ${r.kind}${r.name ? `(${r.name})` : ''} ${where} [${r.status}]`); | ||
| } | ||
| for (const r of rs) | ||
| info(resourceLine(r)); | ||
| } | ||
| } | ||
| //# sourceMappingURL=manifest.js.map |
@@ -18,2 +18,3 @@ // `insta setup agent` — make this machine's coding agents InstaCloud-native in one step | ||
| import { loginOauth } from './auth.js'; | ||
| import { projectLink } from './project.js'; | ||
| import { envUse } from './env.js'; | ||
@@ -428,3 +429,3 @@ import { installAgentConfigs } from './mcp.js'; | ||
| stdoutTty: !!process.stdout.isTTY, | ||
| }) { | ||
| }, link = projectLink) { | ||
| if (!opts.yes && !process.stdout.isTTY) { | ||
@@ -490,2 +491,27 @@ info('non-interactive shell — assuming -y'); | ||
| } | ||
| // --project: link this directory inside the SAME process. The console's connect panel used to | ||
| // print `setup agent && insta project link <id>` as one paste — but no shell joiner survives | ||
| // every Windows shell, and in shells without bracketed paste the queued link line is eaten as | ||
| // the answer to the login prompt above (console PR #290). Carrying the id as a flag is the one | ||
| // form where "one line" is safe. Linking needs the session: without one the manual command is | ||
| // the hint, never a hang; a failed link (bad id, no access) is a REAL error — the link is the | ||
| // entire point of the flag — so it sets the exit code instead of pretending setup succeeded. | ||
| if (opts.project) { | ||
| if (!loggedIn) { | ||
| info(` not logged in — project not linked; run \`insta login\`, then \`insta project link ${opts.project}\``); | ||
| } | ||
| else { | ||
| try { | ||
| await link(opts.project); | ||
| } | ||
| catch (e) { | ||
| // Stop here — like the skill-install failure above, finishing with the success summary | ||
| // and a cheerful `next:` after an error is mixed messaging. Setup itself did succeed, | ||
| // so say exactly that alongside the retry command. | ||
| info(` project link failed (${e instanceof Error ? e.message : String(e)}) — agent setup itself is done; run \`insta project link ${opts.project}\` to retry the link`); | ||
| process.exitCode = 1; | ||
| return; | ||
| } | ||
| } | ||
| } | ||
| // THE summary line. The restart note exists because config-file agents only read their MCP | ||
@@ -492,0 +518,0 @@ // config at startup; the skill files need no restart. |
+1
-0
@@ -90,2 +90,3 @@ #!/usr/bin/env node | ||
| .option('--mcp-token', 'register the MCP server with a minted insta_ API token instead of OAuth (headless machines / CI)') | ||
| .option('--project <id>', 'also link this directory to an existing project after setup (flows through login first if needed)') | ||
| .action(guard((o) => setup.setupAgent(o))); | ||
@@ -92,0 +93,0 @@ // ---- MCP server integration ---- |
+1
-1
| { | ||
| "name": "insta", | ||
| "version": "0.0.47", | ||
| "version": "0.0.48", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "description": "InstaCloud CLI — a thin client of the platform control-plane API.", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
347002
0.85%6021
0.8%