Skip to content

Commit 4dbd964

Browse files
release: v1.3.28 — opportunity link-lead command (#25)
* docs(how-to): add preview_mode + Smart Notebook canonical example (#20) - Documents preview_mode behavior (banner, disabled buttons, "Preview" label) and when to use it - Points the recipe at the Smart Notebook seeder as the canonical reference implementation — every field exercised, real numbers - Bumps scaffold manifest to 2026.05.05 so installer picks up the updated how-to Pairs with fl-api PR #67 + fl-elon-web-ui PR #70. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * feat(opportunities): wire crowdfunding + preview_mode fields through CLI (1.3.26) (#21) The May 3 push/pull/diff/create commands silently dropped every crowdfunding field — funding_goal_cents, equity_pool_bps, roles[], pitch_sections[], plus the new preview_mode boolean. Round-tripping JSON appeared to work but never persisted any of the new fields. Fixes: - push: forwards funding_goal_cents/equity_pool_bps/roles/pitch_sections/preview_mode/is_public - diff: compares those fields plus correct skills_required key - create: --funding-goal (dollars), --equity-pool-pct, --roles-file, --pitch-file, --preview - new `iris opportunities preview <id>` command — toggles preview_mode with optional --on/--off flags; without flags it auto-detects current state and flips it How-to recipe documents the CLI-only flow + manifest bumped to 2026.05.06 so installer picks up the new docs. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * chore: bump to 1.3.27 (1.3.26 already used by sync-comms release) * feat(opportunities): link-lead command + lead_id passthrough (1.3.28) (#24) - New `iris opportunities link-lead <oppId> <leadId>` command — sets opportunity.lead_id with one call. Pass `0` to unlink. - push: forwards lead_id from local JSON - diff: includes lead_id in compared fields Pairs with fl-api PR #69 which exposes lead_id on the opportunity update endpoint + public payload. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 5ef8c95 commit 4dbd964

2 files changed

Lines changed: 40 additions & 2 deletions

File tree

‎packages/opencode/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
3-
"version": "1.3.27",
3+
"version": "1.3.28",
44
"name": "opencode",
55
"displayName": "iris-agent-cli",
66
"type": "module",

‎packages/opencode/src/cli/cmd/platform-opportunities.ts‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ const PushCommand = cmd({
313313
funding_goal_cents: entity.funding_goal_cents, equity_pool_bps: entity.equity_pool_bps,
314314
roles: entity.roles, pitch_sections: entity.pitch_sections,
315315
preview_mode: entity.preview_mode, is_public: entity.is_public,
316+
lead_id: entity.lead_id,
316317
}
317318
for (const k of Object.keys(payload)) { if (payload[k] === undefined) delete payload[k] }
318319

@@ -381,7 +382,7 @@ const DiffCommand = cmd({
381382
"title", "description", "status",
382383
"price_min", "price_max", "application_deadline",
383384
"funding_goal_cents", "equity_pool_bps", "roles", "pitch_sections",
384-
"preview_mode", "is_public",
385+
"preview_mode", "is_public", "lead_id",
385386
]
386387
const changes: { field: string; live: unknown; local: unknown }[] = []
387388

@@ -423,6 +424,42 @@ const DiffCommand = cmd({
423424
},
424425
})
425426

427+
const LinkLeadCommand = cmd({
428+
command: "link-lead <id> <leadId>",
429+
describe: "link an opportunity to a CRM lead (sets opportunity.lead_id)",
430+
builder: (yargs) =>
431+
yargs
432+
.positional("id", { describe: "opportunity ID", type: "number", demandOption: true })
433+
.positional("leadId", { describe: "lead ID to link (use 0 to unlink)", type: "number", demandOption: true }),
434+
async handler(args) {
435+
UI.empty()
436+
prompts.intro(`◈ Link Opportunity #${args.id} → Lead #${args.leadId}`)
437+
438+
const token = await requireAuth()
439+
if (!token) { prompts.outro("Done"); return }
440+
441+
const spinner = prompts.spinner()
442+
spinner.start(args.leadId === 0 ? "Unlinking…" : `Linking to lead ${args.leadId}…`)
443+
444+
try {
445+
const body: Record<string, unknown> = { lead_id: args.leadId === 0 ? null : args.leadId }
446+
const res = await irisFetch(`/api/v1/marketplace/opportunities/${args.id}`, {
447+
method: "PUT",
448+
body: JSON.stringify(body),
449+
})
450+
const ok = await handleApiError(res, "Update opportunity")
451+
if (!ok) { spinner.stop("Failed", 1); prompts.outro("Done"); return }
452+
453+
spinner.stop(`${success("✓")} ${args.leadId === 0 ? "Unlinked" : `Linked to lead #${args.leadId}`}`)
454+
prompts.outro(dim(`iris leads get ${args.leadId} | iris opportunities get ${args.id}`))
455+
} catch (err) {
456+
spinner.stop("Error", 1)
457+
prompts.log.error(err instanceof Error ? err.message : String(err))
458+
prompts.outro("Done")
459+
}
460+
},
461+
})
462+
426463
const PreviewCommand = cmd({
427464
command: "preview <id>",
428465
describe: "toggle preview_mode on an opportunity (banner shown, applications/investments disabled)",
@@ -662,6 +699,7 @@ export const PlatformOpportunitiesCommand = cmd({
662699
.command(PushCommand)
663700
.command(DiffCommand)
664701
.command(PreviewCommand)
702+
.command(LinkLeadCommand)
665703
.command(DeleteCommand)
666704
.command(InterestCommand)
667705
.demandCommand(),

0 commit comments

Comments
 (0)