@installagent/sdk 0.12.0 → 0.14.0

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/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export { type HoursExportScheduleOptions, type HoursExportScheduleResult, instal
31
31
  export { buildHoursLedger, CLIENT_FIELDS, DEFAULT_HOURS_LEDGER_DIR, type HoursLedgerConfig, type HoursLedgerData, type HoursLedgerIngest, type HoursLedgerOptions, type HoursLedgerPersonTotal, type HoursLedgerResult, type HoursLedgerRow, identityMatches, LEDGER_WINDOW_START, OTHER_LEAD_SLUG, TEAM_FIELDS, } from "./hours-ledger.js";
32
32
  export { CLIENT_TEMPLATE_URL, type InitStep, type InitWorkspaceOptions, type InitWorkspaceResult, initWorkspace, MCP_RECOMMENDATIONS, type McpRecommendation, TEAM_CLIENTS_URL, } from "./init.js";
33
33
  export { type HookInstallFn, type InstallClientHooksResult, installClientHooks, unhookedClientRepos, } from "./lefthook-hooks.js";
34
- export { findProjectBySlugId, LINEAR_API_TOKEN_ENV, LinearAuthError, type LinearIssue, LinearProjectNotFoundError, type LinearProjectOptions, type LinearProjectResult, linearProject, linearProjectIssues, linearRequest, type ProjectNode, } from "./linear-project.js";
34
+ export { CLIENT_LINE_MAX, clientLineOf, findProjectBySlugId, LINEAR_API_TOKEN_ENV, LinearAuthError, type LinearIssue, LinearProjectNotFoundError, type LinearProjectOptions, type LinearProjectResult, linearProject, linearProjectIssues, linearRequest, type ProjectNode, } from "./linear-project.js";
35
35
  export { type CreateLoggerOptions, createLogger, type LogFields, type Logger, type LogLevel, redactFields, } from "./log.js";
36
36
  export { applyClientDefaults, clientWorkflowName, DEFAULT_EXECUTION_TIMEOUT_S, DEFAULT_GET_RETRY, DEFAULT_WORKFLOW_SETTINGS, ERROR_WORKFLOW_PLACEHOLDER, IA_ERROR_WORKFLOW_ID, type LintFileResult, type LintFinding, type LintOptions, lintN8nWorkflow, lintWorkflowFiles, WORKFLOW_NAME_PATTERN, } from "./n8n-defaults.js";
37
37
  export { type ExtractNodeOutputsOptions, extractNodeOutputs, listN8nExecutions, listNodesRun, type N8nExecutionDetail, type N8nExecutionStatus, type N8nExecutionSummary, type N8nExecutionsInput, type N8nExecutionsOptions, type N8nExecutionsResult, type N8nNodeOutput, unflattenExecutionData, } from "./n8n-executions.js";
@@ -40,10 +40,10 @@ export { opInstallCommand, opInstallFix, opIntegrationFix } from "./op-cli.js";
40
40
  export { defaultOpTitle, type MintImpls, type MintToOpOptions, type MintToOpRequest, type MintToOpResult, mintToOnePassword, } from "./op-store.js";
41
41
  export { type PingResult, ping } from "./ping.js";
42
42
  export { detectPlatform, detectPlatformInfo, detectShell, opNeedsAnotherShell, type Platform, type PlatformInfo, type Shell, } from "./platform.js";
43
- export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, type PortalAddUserInput, type PortalAddUserResult, PortalAdminAuthError, type PortalAdminOptions, type PortalAgent, type PortalAgentSyncRow, type PortalBuild, type PortalBuildType, type PortalCreateAgentInput, type PortalCreateBuildInput, type PortalCreateOrgInput, type PortalCreateOrgResult, type PortalListAgentsResult, type PortalListBuildsResult, type PortalListOrgsResult, type PortalOrg, type PortalOrgUser, PortalRequestError, type PortalSetAgentNameInput, type PortalSetAgentNameResult, type PortalSetAgentStatusInput, type PortalSetAgentStatusResult, type PortalSetAgentTriageResult, type PortalSetAgentWorkflowInput, type PortalSetAgentWorkflowResult, type PortalSetBuildDetailsInput, type PortalSetBuildDetailsResult, type PortalSetBuildStatusInput, type PortalSetDriveFolderResult, type PortalSetPasswordResult, type PortalSetUserInput, type PortalSetUserResult, type PortalSyncRunsResult, type PortalTriageBackfillResult, type PortalTriageProvider, type PortalTriageRecordsPage, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildDetails, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
43
+ export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_TODO_ACCESS_TABS, PORTAL_TODO_CHANGES, PORTAL_TODO_KINDS, PORTAL_URL_ENV, type PortalAddTodoInput, type PortalAddTodoResult, type PortalAddUserInput, type PortalAddUserResult, PortalAdminAuthError, type PortalAdminOptions, type PortalAgent, type PortalAgentSyncRow, type PortalBuild, type PortalBuildType, type PortalCreateAgentInput, type PortalCreateBuildInput, type PortalCreateOrgInput, type PortalCreateOrgResult, type PortalListAgentsResult, type PortalListBuildsResult, type PortalListOrgsResult, type PortalListTodosResult, type PortalOrg, type PortalOrgUser, PortalRequestError, type PortalSetAgentNameInput, type PortalSetAgentNameResult, type PortalSetAgentStatusInput, type PortalSetAgentStatusResult, type PortalSetAgentTriageResult, type PortalSetAgentWorkflowInput, type PortalSetAgentWorkflowResult, type PortalSetBuildDetailsInput, type PortalSetBuildDetailsResult, type PortalSetBuildStatusInput, type PortalSetDriveFolderResult, type PortalSetPasswordResult, type PortalSetTodoInput, type PortalSetTodoResult, type PortalSetUserInput, type PortalSetUserResult, type PortalSyncRunsResult, type PortalTodo, type PortalTodoAccessTab, type PortalTodoChange, type PortalTodoKind, type PortalTodoStatus, type PortalTriageBackfillResult, type PortalTriageProvider, type PortalTriageRecordsPage, portalAddTodo, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalListTodos, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildDetails, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetTodo, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
44
44
  export { BUILD_DESCRIPTION_MAX, BUILD_NAME_MAX, BUILDS_MANIFEST_END, BUILDS_MANIFEST_START, type BuildsManifest, type BuildsManifestSource, type BuildsManifestState, type BuildsSyncAction, type BuildsSyncActionResult, type BuildsSyncOptions, type BuildsSyncOrgResult, type BuildsSyncPlan, type BuildsSyncResult, type ManifestBuild, type ManifestBuildStatus, parseBuildsManifest, planBuildsSync, type RemoteClientMdReader, syncBuilds, } from "./portal-sync-builds.js";
45
45
  export { expectedGithubAccount, type PrOpenOptions, type PrOpenResult, parseGithubRemote, prOpen, } from "./pr-open.js";
46
- export { CLIENT_LINE_MAX, parseRoadmapRows, ROADMAP_LABELS, ROADMAP_SOURCES, type RoadmapMigrateClient, type RoadmapMigrateOptions, type RoadmapMigrateResult, type RoadmapMigrateRow, type RoadmapRow, roadmapMigrate, } from "./roadmap-migrate.js";
46
+ export { parseRoadmapRows, ROADMAP_LABELS, ROADMAP_SOURCES, type RoadmapMigrateClient, type RoadmapMigrateOptions, type RoadmapMigrateResult, type RoadmapMigrateRow, type RoadmapRow, roadmapMigrate, } from "./roadmap-migrate.js";
47
47
  export { type OnboardingChange, type OnboardingRetirePlan, planOnboardingRetire, ROADMAP_ARCHIVE, ROADMAP_FILE, type RoadmapRetireClient, type RoadmapRetireOptions, type RoadmapRetireResult, roadmapRetire, } from "./roadmap-retire.js";
48
48
  export { type StandupCallPrep, type StandupCallPrepStatus, type StandupGitState, type StandupIssueRef, type StandupLinear, type StandupOptions, type StandupRepo, type StandupRepoLint, type StandupResult, type StandupStaleTodo, standup, } from "./standup.js";
49
49
  export { type SyncRepoResult, type SyncRepoStatus, type SyncReposOptions, type SyncReposResult, syncRepos, workspaceRepoNames, } from "./sync-repos.js";
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ export { installHoursExportSchedule, uninstallHoursExportSchedule, } from "./hou
34
34
  export { buildHoursLedger, CLIENT_FIELDS, DEFAULT_HOURS_LEDGER_DIR, identityMatches, LEDGER_WINDOW_START, OTHER_LEAD_SLUG, TEAM_FIELDS, } from "./hours-ledger.js";
35
35
  export { CLIENT_TEMPLATE_URL, initWorkspace, MCP_RECOMMENDATIONS, TEAM_CLIENTS_URL, } from "./init.js";
36
36
  export { installClientHooks, unhookedClientRepos, } from "./lefthook-hooks.js";
37
- export { findProjectBySlugId, LINEAR_API_TOKEN_ENV, LinearAuthError, LinearProjectNotFoundError, linearProject, linearProjectIssues, linearRequest, } from "./linear-project.js";
37
+ export { CLIENT_LINE_MAX, clientLineOf, findProjectBySlugId, LINEAR_API_TOKEN_ENV, LinearAuthError, LinearProjectNotFoundError, linearProject, linearProjectIssues, linearRequest, } from "./linear-project.js";
38
38
  export { createLogger, redactFields, } from "./log.js";
39
39
  export { applyClientDefaults, clientWorkflowName, DEFAULT_EXECUTION_TIMEOUT_S, DEFAULT_GET_RETRY, DEFAULT_WORKFLOW_SETTINGS, ERROR_WORKFLOW_PLACEHOLDER, IA_ERROR_WORKFLOW_ID, lintN8nWorkflow, lintWorkflowFiles, WORKFLOW_NAME_PATTERN, } from "./n8n-defaults.js";
40
40
  export { extractNodeOutputs, listN8nExecutions, listNodesRun, unflattenExecutionData, } from "./n8n-executions.js";
@@ -43,10 +43,10 @@ export { opInstallCommand, opInstallFix, opIntegrationFix } from "./op-cli.js";
43
43
  export { defaultOpTitle, mintToOnePassword, } from "./op-store.js";
44
44
  export { ping } from "./ping.js";
45
45
  export { detectPlatform, detectPlatformInfo, detectShell, opNeedsAnotherShell, } from "./platform.js";
46
- export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_URL_ENV, PortalAdminAuthError, PortalRequestError, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildDetails, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
46
+ export { DEFAULT_PORTAL_URL, PORTAL_ADMIN_SECRET_ENV, PORTAL_BUILD_TYPES, PORTAL_PASSWORD_WARNING, PORTAL_SYNC_MAX_DAYS, PORTAL_TODO_ACCESS_TABS, PORTAL_TODO_CHANGES, PORTAL_TODO_KINDS, PORTAL_URL_ENV, PortalAdminAuthError, PortalRequestError, portalAddTodo, portalAddUser, portalBackfillTriageRecords, portalBuildType, portalBuildWorkflowId, portalCreateAgent, portalCreateBuild, portalCreateOrg, portalListAgents, portalListBuilds, portalListOrgs, portalListTodos, portalReadTriageRecords, portalSetAgentName, portalSetAgentStatus, portalSetAgentTriage, portalSetAgentWorkflow, portalSetBuildDetails, portalSetBuildName, portalSetBuildStatus, portalSetBuildTriage, portalSetBuildWorkflow, portalSetDriveFolder, portalSetOrgSlackChannel, portalSetPassword, portalSetTodo, portalSetUser, portalSyncRuns, validatePortalBuildFields, } from "./portal-admin.js";
47
47
  export { BUILD_DESCRIPTION_MAX, BUILD_NAME_MAX, BUILDS_MANIFEST_END, BUILDS_MANIFEST_START, parseBuildsManifest, planBuildsSync, syncBuilds, } from "./portal-sync-builds.js";
48
48
  export { expectedGithubAccount, parseGithubRemote, prOpen, } from "./pr-open.js";
49
- export { CLIENT_LINE_MAX, parseRoadmapRows, ROADMAP_LABELS, ROADMAP_SOURCES, roadmapMigrate, } from "./roadmap-migrate.js";
49
+ export { parseRoadmapRows, ROADMAP_LABELS, ROADMAP_SOURCES, roadmapMigrate, } from "./roadmap-migrate.js";
50
50
  export { planOnboardingRetire, ROADMAP_ARCHIVE, ROADMAP_FILE, roadmapRetire, } from "./roadmap-retire.js";
51
51
  export { standup, } from "./standup.js";
52
52
  export { syncRepos, workspaceRepoNames, } from "./sync-repos.js";
@@ -9,6 +9,11 @@ export interface LinearIssue {
9
9
  assignee: string | null;
10
10
  labels: string[];
11
11
  updatedAt: string;
12
+ /**
13
+ * The `Client line:` of the description: the one sentence the client portal
14
+ * shows for this issue in Now / Next / Later. Null = an internal issue.
15
+ */
16
+ clientLine: string | null;
12
17
  }
13
18
  export interface LinearProjectResult {
14
19
  project: {
@@ -71,6 +76,13 @@ export interface LinearIssueState {
71
76
  export declare function linearProjectIssueStates(fetchImpl: typeof fetch, token: string, project: ProjectNode, options?: {
72
77
  maxPages?: number;
73
78
  }): Promise<LinearIssueState[]>;
79
+ /**
80
+ * The portal hides a client line over this length (team-web
81
+ * apps/portal/lib/client-plan.ts CLIENT_LINE_MAX). Change both together.
82
+ */
83
+ export declare const CLIENT_LINE_MAX = 90;
84
+ /** The text of a description's `Client line:`, whatever its length; null when there is none. */
85
+ export declare function clientLineOf(description: string | null): string | null;
74
86
  /**
75
87
  * Open (not completed/canceled/duplicate) issues in an already-resolved
76
88
  * Linear project — "what's left to do" for that project. Either returns the
@@ -140,6 +140,17 @@ export async function linearProjectIssueStates(fetchImpl, token, project, option
140
140
  }
141
141
  return out;
142
142
  }
143
+ // The portal's pattern (team-web apps/portal/lib/client-plan.ts CLIENT_LINE).
144
+ const CLIENT_LINE_PATTERN = /^[ \t]*(?:[-*][ \t]+)?(?:\*\*)?client line:(?:\*\*)?[ \t]*(.*?)[ \t]*$/im;
145
+ /**
146
+ * The portal hides a client line over this length (team-web
147
+ * apps/portal/lib/client-plan.ts CLIENT_LINE_MAX). Change both together.
148
+ */
149
+ export const CLIENT_LINE_MAX = 90;
150
+ /** The text of a description's `Client line:`, whatever its length; null when there is none. */
151
+ export function clientLineOf(description) {
152
+ return CLIENT_LINE_PATTERN.exec(description ?? "")?.[1]?.trim() || null;
153
+ }
143
154
  function toIssue(node) {
144
155
  return {
145
156
  identifier: node.identifier,
@@ -151,6 +162,7 @@ function toIssue(node) {
151
162
  assignee: node.assignee?.name ?? null,
152
163
  labels: node.labels.nodes.map((l) => l.name),
153
164
  updatedAt: node.updatedAt,
165
+ clientLine: clientLineOf(node.description),
154
166
  };
155
167
  }
156
168
  function countOccurrences(text, term) {
@@ -235,6 +235,72 @@ export declare function portalAddUser(input: PortalAddUserInput, options?: Porta
235
235
  */
236
236
  export declare function portalSetUser(input: PortalSetUserInput, options?: PortalAdminOptions): Promise<PortalSetUserResult>;
237
237
  export declare function portalListOrgs(options?: PortalAdminOptions): Promise<PortalListOrgsResult>;
238
+ export type PortalTodoKind = "question" | "action" | "access";
239
+ export declare const PORTAL_TODO_KINDS: readonly PortalTodoKind[];
240
+ export type PortalTodoAccessTab = "overview" | "vault" | "new";
241
+ export declare const PORTAL_TODO_ACCESS_TABS: readonly PortalTodoAccessTab[];
242
+ export type PortalTodoChange = "confirm" | "reopen" | "cancel";
243
+ export declare const PORTAL_TODO_CHANGES: readonly PortalTodoChange[];
244
+ export type PortalTodoStatus = "open" | "waiting_on_us" | "done" | "canceled";
245
+ export interface PortalTodo {
246
+ id: string;
247
+ /** Set on an item that a seed file or a sync made; null for a hand-made item. */
248
+ key: string | null;
249
+ kind: PortalTodoKind;
250
+ title: string;
251
+ detail: string | null;
252
+ accessTab: PortalTodoAccessTab | null;
253
+ accessSystem: string | null;
254
+ /** `waiting_on_us` = the client ticked it and staff have not confirmed it. */
255
+ status: PortalTodoStatus;
256
+ /** The answer text is the client's own words; read it on the admin page. */
257
+ hasAnswer: boolean;
258
+ clientDoneAt: string | null;
259
+ confirmedAt: string | null;
260
+ sortOrder: number;
261
+ }
262
+ export interface PortalListTodosResult {
263
+ slug: string;
264
+ todos: PortalTodo[];
265
+ }
266
+ export interface PortalAddTodoInput {
267
+ slug: string;
268
+ kind: PortalTodoKind;
269
+ /** The client reads the title and the detail: no email address, no price. */
270
+ title: string;
271
+ detail?: string;
272
+ /** The Access tab the item's button opens. */
273
+ accessTab?: PortalTodoAccessTab;
274
+ /** With `accessTab: "new"` only: the system name that prefills the credential form. */
275
+ accessSystem?: string;
276
+ sortOrder?: number;
277
+ }
278
+ export interface PortalAddTodoResult {
279
+ slug: string;
280
+ todo: PortalTodo;
281
+ }
282
+ export interface PortalSetTodoInput {
283
+ slug: string;
284
+ /** The item's id, from `portalListTodos`. */
285
+ item: string;
286
+ change: PortalTodoChange;
287
+ }
288
+ export interface PortalSetTodoResult {
289
+ slug: string;
290
+ todo: PortalTodo;
291
+ /** False when the item was already in that state. */
292
+ changed: boolean;
293
+ }
294
+ /** One org's To-do items in display order, canceled ones included (GET /api/admin/todos). */
295
+ export declare function portalListTodos(slug: string, options?: PortalAdminOptions): Promise<PortalListTodosResult>;
296
+ /** Add one To-do item to an org (POST /api/admin/todos). */
297
+ export declare function portalAddTodo(input: PortalAddTodoInput, options?: PortalAdminOptions): Promise<PortalAddTodoResult>;
298
+ /**
299
+ * Confirm, reopen or cancel one To-do item (PATCH /api/admin/todos). `confirm`
300
+ * locks the item for the client; `cancel` hides it from the client and keeps
301
+ * the row; `reopen` clears the tick, the confirm and a cancel. Never deletes.
302
+ */
303
+ export declare function portalSetTodo(input: PortalSetTodoInput, options?: PortalAdminOptions): Promise<PortalSetTodoResult>;
238
304
  /**
239
305
  * The client-side check of a create: an agent needs its n8n workflow id, an
240
306
  * app must not carry one, and a url (either type) must be https. The portal
@@ -146,6 +146,61 @@ export async function portalSetUser(input, options = {}) {
146
146
  export async function portalListOrgs(options = {}) {
147
147
  return portalRequest("GET", "/api/admin/orgs", options);
148
148
  }
149
+ export const PORTAL_TODO_KINDS = ["question", "action", "access"];
150
+ export const PORTAL_TODO_ACCESS_TABS = ["overview", "vault", "new"];
151
+ export const PORTAL_TODO_CHANGES = ["confirm", "reopen", "cancel"];
152
+ const TODO_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
153
+ /** One org's To-do items in display order, canceled ones included (GET /api/admin/todos). */
154
+ export async function portalListTodos(slug, options = {}) {
155
+ const org = normalizeSlug(slug, "org");
156
+ return portalRequest("GET", `/api/admin/todos?slug=${encodeURIComponent(org)}`, options);
157
+ }
158
+ /** Add one To-do item to an org (POST /api/admin/todos). */
159
+ export async function portalAddTodo(input, options = {}) {
160
+ const slug = normalizeSlug(input.slug, "org");
161
+ if (!PORTAL_TODO_KINDS.includes(input.kind)) {
162
+ throw new Error(`kind must be ${PORTAL_TODO_KINDS.join("|")}`);
163
+ }
164
+ const title = input.title.trim();
165
+ if (!title)
166
+ throw new Error("the title is empty");
167
+ if (input.accessTab !== undefined && !PORTAL_TODO_ACCESS_TABS.includes(input.accessTab)) {
168
+ throw new Error(`access tab must be ${PORTAL_TODO_ACCESS_TABS.join("|")}`);
169
+ }
170
+ const accessSystem = input.accessSystem?.trim();
171
+ if (accessSystem && input.accessTab !== "new") {
172
+ throw new Error("--access-system goes with --access-tab new only");
173
+ }
174
+ if (input.sortOrder !== undefined && !Number.isInteger(input.sortOrder)) {
175
+ throw new Error("the order must be a whole number");
176
+ }
177
+ const detail = input.detail?.trim();
178
+ return portalRequest("POST", "/api/admin/todos", options, {
179
+ slug,
180
+ kind: input.kind,
181
+ title,
182
+ ...(detail ? { detail } : {}),
183
+ ...(input.accessTab ? { accessTab: input.accessTab } : {}),
184
+ ...(accessSystem ? { accessSystem } : {}),
185
+ ...(input.sortOrder !== undefined ? { sortOrder: input.sortOrder } : {}),
186
+ });
187
+ }
188
+ /**
189
+ * Confirm, reopen or cancel one To-do item (PATCH /api/admin/todos). `confirm`
190
+ * locks the item for the client; `cancel` hides it from the client and keeps
191
+ * the row; `reopen` clears the tick, the confirm and a cancel. Never deletes.
192
+ */
193
+ export async function portalSetTodo(input, options = {}) {
194
+ const slug = normalizeSlug(input.slug, "org");
195
+ const item = input.item.trim().toLowerCase();
196
+ if (!TODO_ID_PATTERN.test(item)) {
197
+ throw new Error("give the full item id from `ia portal list-todo`");
198
+ }
199
+ if (!PORTAL_TODO_CHANGES.includes(input.change)) {
200
+ throw new Error(`change must be ${PORTAL_TODO_CHANGES.join("|")}`);
201
+ }
202
+ return portalRequest("PATCH", "/api/admin/todos", options, { slug, item, change: input.change });
203
+ }
149
204
  // ─── Builds registry (named `agents` before 2026-10-13) ─────────────────────
150
205
  //
151
206
  // The portal renamed its `agents` registry to `builds` and added a build type
@@ -1,5 +1,4 @@
1
1
  export declare const ROADMAP_SOURCES: string[];
2
- export declare const CLIENT_LINE_MAX = 140;
3
2
  export declare const ROADMAP_LABELS: readonly ["value", "client-ask", "parked"];
4
3
  export interface RoadmapRow {
5
4
  rank: string;
@@ -17,15 +17,14 @@
17
17
  // It never changes a state, a title, a priority or an assignee: a state that
18
18
  // does not match the row is a report line for a person. It refuses a Client
19
19
  // line with `$` (Linear is shared by all staff: no dollar amounts), a ticket
20
- // id, or more than 140 characters. Angello runs `--apply`.
20
+ // id, or more than 90 characters. Angello runs `--apply`.
21
21
  import { existsSync, readFileSync } from "node:fs";
22
22
  import { join, resolve } from "node:path";
23
23
  import { parseLinearProjectSlugId } from "./client-linear.js";
24
24
  import { readManifestKey } from "./client-manifest.js";
25
- import { findProjectBySlugId, LINEAR_API_TOKEN_ENV, linearRequest } from "./linear-project.js";
25
+ import { CLIENT_LINE_MAX, findProjectBySlugId, LINEAR_API_TOKEN_ENV, linearRequest, } from "./linear-project.js";
26
26
  import { adhocReason, selectClientSlugs } from "./template-sync.js";
27
27
  export const ROADMAP_SOURCES = ["docs/06-roadmap.md", "docs/archive/06-roadmap.md"];
28
- export const CLIENT_LINE_MAX = 140;
29
28
  export const ROADMAP_LABELS = ["value", "client-ask", "parked"];
30
29
  const ISSUE_ID = /\bINS-\d+\b/g;
31
30
  const TICKET_ID = /\b[A-Z][A-Z0-9]{1,9}-\d+\b/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@installagent/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Install Agent's shared SDK for internal team operations (client repos, n8n workflows, docs search, and more).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,6 +49,7 @@ installagent/
49
49
  | Build/edit anything *for* a client (spec, workflow, diagram, PDF, site, agent) | `clients/client-<slug>/` | that repo's `CADENCE.md` (how to ship it) + `AGENT.md` + `CLIENT.md` |
50
50
  | Ship a change into a client repo without causing drift (feature, fix, scope change) | `clients/client-<slug>/CADENCE.md` | it *is* the read — five stages + the surface matrix |
51
51
  | Answer "what did we ship for X / does it work?" | `clients/client-<slug>/docs/00-delivery-log.md` + `evidence/` | same |
52
+ | A build goes live (its portal card + estimated build cost) | the `## Builds` row in `clients/client-<slug>/CLIENT.md` + `ia build-estimate --build <slug> --write` (market hours, never dollars) | that repo's `CADENCE.md` (row *A build goes live*) + team hub → Techs → Client engagement → Estimated build cost |
52
53
  | Check or change deal status | **Airtable (`Clients - Master`)** — never a file in git | — |
53
54
  | Build or edit an n8n workflow (ours or a client's) | **check `agents/` (the bank) first**, then the client repo's `workflows/` or `team-infra/n8n-workflows/` | `agents/README.md` + `team-infra/skills/n8n-workflow.md` |
54
55
  | An n8n workflow sends a PDF on to a size-capped step (a Vercel app, an email, an LLM, a vendor upload) | the **`pdf` compress service** on the n8n box (`http://pdf:8080`): compress first, keep the size gate, keep the original on any error | `team-infra/skills/n8n-workflow.md` § 3 + `team-infra/pdf-service/README.md` |
@@ -56,6 +56,7 @@ secrets).
56
56
  | Weekly triage summary into the client's channel | `ia portal set-org-slack-channel --slug <slug> --channel <C…>` (`none` clears it) — the digest only posts for an org with a channel |
57
57
  | Mint a GCP SA key / Gemini key / Fathom webhook | `ia secrets mint <kind> …` |
58
58
  | Portal org/agent admin (create org, passwords, run sync) | `ia portal <cmd>` — CLI-only, never via MCP |
59
+ | A build went live / "what would this build cost at market rate?" | add its row to `CLIENT.md` `## Builds`, then `ia build-estimate --build <slug>` in the client repo: market hours (low–high) + a one-line basis, from one Gemini call on the build's spec. Hours only — never a rate or a dollar figure, in git, Linear or Slack. Review it, then `--write` sets the row's `est_hours`; commit it with the row. The portal multiplies by its one rate (admin Clients page); `ia portal sync-builds --apply` (account owner) carries it over. `--force` re-estimates a row; `--spec <file>` points it at the right spec |
59
60
 
60
61
  Flags, inputs, and required env vars per command: the generated reference at
61
62
  `team-tools/docs/reference/cli.md` (MCP twins: `mcp-tools.md`). That
@@ -78,10 +78,14 @@ portal reads **Now / Next / Later** from the client's project at request time.
78
78
  | Rank | priority, then the project's manual sort order. The account owner moves ranks; a technician moves states | the order inside each list |
79
79
  | Who it serves | label `value` (moves the number we committed to), `client-ask` (the client asked); both labels = both | — |
80
80
  | Why this rank | the issue description | — |
81
- | The client-safe line | one line in the description: `Client line: <one sentence, 140 characters at most>` | the only text the client sees |
82
-
83
- **Client line rules:** plain words, no tool names, no ticket numbers, **no
84
- dollar amounts** (Linear is shared by all staff). An issue with no `Client
81
+ | The client-safe line | one line in the description: `Client line: <one short sentence, 90 characters at most>` | the only text the client sees |
82
+
83
+ **Client line rules:** one idea, said directly: the result for the client, not
84
+ how we do it. **90 characters at most**, so it fits two rows of a portal card;
85
+ the portal hides a longer line. Plain words, no tool names, no ticket numbers,
86
+ **no dollar amounts** (Linear is shared by all staff). Check a project with
87
+ `ia client-linear <slug> --client-lines`: it prints each line with its length
88
+ and marks one over the limit. `Client line: none` marks an internal issue. An issue with no `Client
85
89
  line:` is internal: the client never sees it. The portal never shows an issue
86
90
  title or any other part of the description, and drops a line with `$` or a
87
91
  ticket id.