node-autotask 0.8.3 → 0.10.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.
Files changed (84) hide show
  1. package/ARCHITECTURE.md +13 -10
  2. package/MCP_TOOL_CATALOG.json +733 -251
  3. package/MCP_TOOL_MANIFEST.md +162 -133
  4. package/MCP_TOOL_OVERRIDES.json +2 -2
  5. package/N8N_MCP_MANIFEST.json +88 -25
  6. package/N8N_MCP_MANIFEST.md +26 -24
  7. package/README.md +12 -4
  8. package/capabilities.json +12503 -9316
  9. package/dist/capabilities.cjs +2 -3
  10. package/dist/capabilities.js +1 -2
  11. package/dist/{chunk-4WJCXIY2.js → chunk-3VB6N44U.js} +1141 -2977
  12. package/dist/{chunk-32AKZMY4.js → chunk-6KFP5HV3.js} +12502 -9316
  13. package/dist/chunk-DMMMWO6A.js +0 -0
  14. package/dist/chunk-FLB2X6O5.cjs +1 -0
  15. package/dist/{chunk-GYI4ZQID.js → chunk-HWC2WPX2.js} +4781 -89
  16. package/dist/chunk-IDPB4N2Q.cjs +1 -0
  17. package/dist/{chunk-F6YSQRZV.js → chunk-NVJ2PTN3.js} +7 -7
  18. package/dist/{chunk-5UGSQLLO.cjs → chunk-QUM74WLQ.cjs} +136 -136
  19. package/dist/{chunk-LAKEIYET.cjs → chunk-S7VMY5KN.cjs} +1468 -3304
  20. package/dist/chunk-UPQIUWOS.js +0 -0
  21. package/dist/{chunk-KNTUX3RR.cjs → chunk-WTVD2JZN.cjs} +12502 -9316
  22. package/dist/{chunk-V3XPLTIR.cjs → chunk-WTVLHMZA.cjs} +4784 -92
  23. package/dist/{index-B6JeThrY.d.ts → index-BOyh7S65.d.cts} +870 -79
  24. package/dist/{index-B0I2bGtx.d.cts → index-DGgMD8aq.d.ts} +870 -79
  25. package/dist/{index-DOCRp_83.d.cts → index-cQ6CRexR.d.cts} +158 -90
  26. package/dist/{index-DOCRp_83.d.ts → index-cQ6CRexR.d.ts} +158 -90
  27. package/dist/index.cjs +37 -22
  28. package/dist/index.d.cts +46 -5
  29. package/dist/index.d.ts +46 -5
  30. package/dist/index.js +48 -33
  31. package/dist/operations/index.cjs +480 -359
  32. package/dist/operations/index.d.cts +195 -16
  33. package/dist/operations/index.d.ts +195 -16
  34. package/dist/operations/index.js +370 -249
  35. package/dist/pool.cjs +36 -12
  36. package/dist/pool.d.cts +2 -3
  37. package/dist/pool.d.ts +2 -3
  38. package/dist/pool.js +33 -9
  39. package/dist/resources/index.cjs +5 -6
  40. package/dist/resources/index.d.cts +2 -2
  41. package/dist/resources/index.d.ts +2 -2
  42. package/dist/resources/index.js +4 -5
  43. package/dist/types/index.cjs +1 -2
  44. package/dist/types/index.d.cts +1 -1
  45. package/dist/types/index.d.ts +1 -1
  46. package/dist/types/index.js +1 -2
  47. package/dist/untrusted.cjs +0 -1
  48. package/dist/untrusted.js +0 -1
  49. package/docs/API.md +693 -48
  50. package/docs/N8N-ADAPTER.md +4 -4
  51. package/examples/basic.ts +1 -1
  52. package/package.json +5 -3
  53. package/dist/capabilities.cjs.map +0 -1
  54. package/dist/capabilities.js.map +0 -1
  55. package/dist/chunk-32AKZMY4.js.map +0 -1
  56. package/dist/chunk-4WJCXIY2.js.map +0 -1
  57. package/dist/chunk-5UGSQLLO.cjs.map +0 -1
  58. package/dist/chunk-CXM35TEC.cjs +0 -1
  59. package/dist/chunk-CXM35TEC.cjs.map +0 -1
  60. package/dist/chunk-F6YSQRZV.js.map +0 -1
  61. package/dist/chunk-GIVD2CQ3.js +0 -1
  62. package/dist/chunk-GIVD2CQ3.js.map +0 -1
  63. package/dist/chunk-GYI4ZQID.js.map +0 -1
  64. package/dist/chunk-KNTUX3RR.cjs.map +0 -1
  65. package/dist/chunk-LAKEIYET.cjs.map +0 -1
  66. package/dist/chunk-MHBMSBTA.js +0 -1
  67. package/dist/chunk-MHBMSBTA.js.map +0 -1
  68. package/dist/chunk-NZUFSSIZ.cjs +0 -1
  69. package/dist/chunk-NZUFSSIZ.cjs.map +0 -1
  70. package/dist/chunk-V3XPLTIR.cjs.map +0 -1
  71. package/dist/client-DHmr0Oyx.d.ts +0 -203
  72. package/dist/client-Q6NoqinP.d.cts +0 -203
  73. package/dist/index.cjs.map +0 -1
  74. package/dist/index.js.map +0 -1
  75. package/dist/operations/index.cjs.map +0 -1
  76. package/dist/operations/index.js.map +0 -1
  77. package/dist/pool.cjs.map +0 -1
  78. package/dist/pool.js.map +0 -1
  79. package/dist/resources/index.cjs.map +0 -1
  80. package/dist/resources/index.js.map +0 -1
  81. package/dist/types/index.cjs.map +0 -1
  82. package/dist/types/index.js.map +0 -1
  83. package/dist/untrusted.cjs.map +0 -1
  84. package/dist/untrusted.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/maxs/gitrepos/node-autotask/dist/operations/index.cjs","../../src/operations/types.ts","../../src/operations/searchAcrossResources.ts","../../src/operations/resolveAny.ts","../../src/field-sets.ts","../../src/operations/fetchMany.ts","../../src/operations/relationshipMap.ts","../../src/operations/blindSurfaces.ts","../../src/operations/probeReachability.ts","../../src/operations/createGuidance.ts","../../src/operations/fieldCatalog.ts","../../src/operations/recovery.ts","../../src/operations/invoke.ts"],"names":["resourceFor","value","opts"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACA;ACZO,IAAM,mBAAA,EAAwC;AAAA,EACnD,WAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,qBAAA;AAAA,EACA;AACF,CAAA;ADcA;AACA;AEdA,IAAM,cAAA,EAAgB,EAAA;AAOtB,SAAS,WAAA,CAAe,MAAA,EAAwB,GAAA,EAA4B;AAC1E,EAAA,OAAQ,MAAA,CAAoD,wCAAA,GAAY,CAAC,CAAA;AAC3E;AAEA,MAAA,SAAsB,qBAAA,CACpB,MAAA,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,EAAA;AACS,EAAA;AACA,IAAA;AACf,EAAA;AAQe,EAAA;AACA,IAAA;AACf,EAAA;AAUM,EAAA;AACJ,IAAA;AACA,IAAA;AACF,EAAA;AACM,EAAA;AACY,EAAA;AACD,EAAA;AACN,EAAA;AACE,IAAA;AACI,IAAA;AACA,MAAA;AACA,MAAA;AACf,IAAA;AACF,EAAA;AAC6B,EAAA;AAChB,EAAA;AAOL,IAAA;AACU,IAAA;AACF,IAAA;AAChB,EAAA;AACe,EAAA;AACD,EAAA;AAChB;AAGa;AASJ;AACC,EAAA;AACG,IAAA;AACX,EAAA;AACO,EAAA;AACK,IAAA;AACM,IAAA;AACL,IAAA;AACL,IAAA;AACR,EAAA;AACF;AAQsB;AAMF,EAAA;AACpB;AAOsB;AAMF,EAAA;AACpB;AAQsB;AAMF,EAAA;AACpB;AAOsB;AAMF,EAAA;AACpB;AZ6vBqB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/maxs/gitrepos/node-autotask/dist/operations/index.cjs","sourcesContent":[null,"/**\n * Cross-resource operations layer — shared types (ARCHITECTURE section 19.1,\n * 19.5). The operations layer is MCP-independent: plain SDK code, no MCP\n * imports, no schema-library dependency.\n *\n * The default resource set for the cross-resource helpers is the FIVE\n * workflow resources (plan `workflowResource: true`) — the core tier an\n * agent starting from a bare value or a free-text query needs first\n * (section 19.5 R3).\n */\n\nimport type { Identifier } from '../types/common.js';\n\n/** The five workflow resources (plan keys), in core-tier order. */\nexport const WORKFLOW_RESOURCES: readonly string[] = [\n 'companies',\n 'tickets',\n 'contacts',\n 'configuration_items',\n 'projects',\n];\n\n// ---------------------------------------------------------------------------\n// searchAcrossResources\n// ---------------------------------------------------------------------------\n\nexport interface SearchAcrossResourcesOptions {\n /** Resource keys to search (default: the five workflow resources). */\n resources?: readonly string[];\n /** Max matches per resource (default 25, max 500). */\n limit?: number;\n}\n\n/** One searched resource's matches (compact shapes; `Summary = full record`). */\nexport interface SearchAcrossResourcesRow {\n resource: string;\n matches: Array<Record<string, unknown>>;\n}\n\nexport interface SearchAcrossResourcesResult {\n /** The trimmed query that was run. */\n query: string;\n /** One row per resource that HAS a `search` helper, in request order. */\n results: SearchAcrossResourcesRow[];\n /** Requested keys without a `search` helper — skipped and reported, never errored. */\n skipped: string[];\n}\n\n// ---------------------------------------------------------------------------\n// fetchMany (the batch/fan-out read primitive — S12-B, run mcp-fix-20261003)\n// ---------------------------------------------------------------------------\n\n/** One fetchMany item: a single-record GET by vendor numeric id. */\nexport interface FetchManyItem {\n /** The plan resource key (snake_case, e.g. `tickets`) — top-level resources only. */\n resource: string;\n /** The vendor numeric id: a safe integer, or the canonical integer string for ids above 2^53 (non-numeric string identifiers are `resolveAny` territory — refused pre-request). */\n id: Identifier;\n /** Client-side PROJECTION of the fetched record (exact vendor field names; unknown keys are refused pre-request — the vendor single-record GET has no field selection, projection is post-fetch, zero extra wire). */\n fields?: string[];\n}\n\n/** One per-item fault (partial failures are typed PER ITEM — never all-or-nothing). */\nexport interface FetchManyItemError {\n /** The typed error code: `NOT_FOUND` (vendor 404/empty item) or `SERVER_ERROR` (5xx) are the pinned item codes; other real faults carry their typed `AutotaskError` code (e.g. `RATE_LIMITED`). */\n code: string;\n /** The vendor HTTP status when the fault is an HTTP error. */\n httpStatus?: number;\n /** The fault message (redaction-safe: never carries request/response bodies). */\n message: string;\n}\n\n/** One item's outcome — `value` is the record (projected when `fields` was given); `error` is present exactly when `found` is false. */\nexport interface FetchManyItemResult {\n resource: string;\n /** The canonical id as requested (safe integer, or the exact-digit string). */\n id: Identifier;\n found: boolean;\n value: Record<string, unknown> | null;\n error?: FetchManyItemError;\n}\n\n/** The batch result: one row per item, in input order. */\nexport interface FetchManyResult {\n results: FetchManyItemResult[];\n /** Items that returned a record. */\n ok: number;\n /** Items that missed or faulted (typed per item). */\n failed: number;\n}\n\n// ---------------------------------------------------------------------------\n// resolveAny\n// ---------------------------------------------------------------------------\n\nexport interface ResolveAnyOptions {\n /** Resource keys to resolve against (default: the five workflow resources). */\n resources?: readonly string[];\n}\n\n/**\n * One resource's outcome. Unlike single-resource `resolve`, a miss does NOT\n * throw — the `error` code is reported and `value` stays null.\n */\nexport interface ResolveAnyResourceOutcome {\n resource: string;\n /** The compact record when resolved; null on a miss/error. */\n value: Record<string, unknown> | null;\n /** How the match was found (or what was attempted). */\n resolutionCost: 'direct' | 'server-filter' | 'client-scan';\n /** Records read by the bounded client-scan fallback. */\n scanned: number;\n /** True when the scan hit its cap (a complete non-match is unproven). */\n scanTruncated: boolean;\n /** Candidate ids when the resource matched more than one record. */\n candidates: (number | string)[];\n /** Error code when the resource could not resolve (e.g. `NOT_FOUND`, `CONFIG_ERROR`). */\n error?: string;\n}\n\nexport interface ResolveAnyResult {\n identifier: number | string;\n /** One outcome per requested resource, in request order. */\n results: ResolveAnyResourceOutcome[];\n /** The resources that resolved to exactly one record. */\n matches: string[];\n}\n\n// ---------------------------------------------------------------------------\n// invoke (the write governor, section 19.5 R2–R4)\n// ---------------------------------------------------------------------------\n\n/**\n * Caller options for `invoke`. The dry-run flag lives HERE, never in the\n * payload.\n */\nexport interface InvokeOptions {\n /**\n * Writes are DRY-RUN-FIRST: omit this (or pass `true`) and the operation\n * runs on the SDK's dry-run path — the real mutating request is never\n * issued and the result is a `DryRunResult` with `simulated: true`. Only\n * an explicit `dryRun: false` executes a write. A read REFUSES `dryRun:\n * true` (a read has no dry run to run).\n */\n dryRun?: boolean;\n /**\n * Deliberate-act acknowledgement: REQUIRED for a destructive or\n * approval-gated operation and must EQUAL the operation key exactly (no\n * fuzzy matching, no booleans) — e.g. `confirm: 'companies.delete'`.\n */\n confirm?: string;\n /**\n * The caller-observed `lastModifiedDate` (stale-object guard, section\n * 19.3) — passed through to the mutation's `MutationOpts`.\n */\n lastModifiedDate?: string;\n}\n","/**\n * `operations.searchAcrossResources` — bounded multi-resource text search\n * (ARCHITECTURE section 19.2).\n *\n * Runs each requested resource's OWN `search` helper (server-side bounded\n * `contains` — never a listAll scan) across the selected resources with one\n * limit budget. Resources without a `search` helper are skipped and REPORTED\n * (the `skipped` array), never errored. The limit defaults to 25 per\n * resource and is clamped to the vendor max of 500.\n */\nimport { AutotaskConfigError } from '../errors.js';\nimport { clampPageSize } from '../pagination.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey } from '../utils/index.js';\nimport {\n WORKFLOW_RESOURCES,\n type SearchAcrossResourcesOptions,\n type SearchAcrossResourcesResult,\n type SearchAcrossResourcesRow,\n} from './types.js';\n\nconst DEFAULT_LIMIT = 25;\n\n/** A resource surface that carries the `search` helper. */\ninterface Searchable {\n search(query: string, opts?: { limit?: number }): Promise<unknown>;\n}\n\nfunction resourceFor<T>(client: AutotaskClient, key: string): T | undefined {\n return (client as unknown as Record<string, T | undefined>)[camelKey(key)];\n}\n\nexport async function searchAcrossResources(\n client: AutotaskClient,\n query: string,\n opts: SearchAcrossResourcesOptions = {},\n): Promise<SearchAcrossResourcesResult> {\n const text = query.trim();\n if (text === '') {\n throw new AutotaskConfigError('searchAcrossResources: query must be a non-empty string');\n }\n const keys = opts.resources ?? WORKFLOW_RESOURCES;\n if (keys.length === 0) {\n throw new AutotaskConfigError('searchAcrossResources: no resources requested');\n }\n const limit = clampPageSize(opts.limit ?? DEFAULT_LIMIT);\n const results: SearchAcrossResourcesRow[] = [];\n const skipped: string[] = [];\n for (const key of keys) {\n const holder = resourceFor<Searchable>(client, key);\n if (holder === undefined || typeof holder.search !== 'function') {\n skipped.push(key);\n continue;\n }\n const matches = await holder.search(text, { limit });\n const rows = Array.isArray(matches)\n ? matches\n .filter((m): m is Record<string, unknown> => typeof m === 'object' && m !== null)\n .map((m) => m as Record<string, unknown>)\n : [];\n results.push({ resource: key, matches: rows });\n }\n return { query: text, results, skipped };\n}\n","/**\n * `operations.resolveAny` — one identifier against several resources\n * (ARCHITECTURE section 19.2).\n *\n * Calls each requested resource's `resolve` with the SAME identifier. Unlike\n * single-resource `resolve`, a miss does NOT throw: the result lists\n * per-resource candidates and the error code when a resource could not\n * resolve (empty `candidates` = no match). Bare-value order per resource:\n * numeric id, then the primary text field (the resource's `searchCovers`),\n * exact match only; the bounded client-scan fallback (and its truncation\n * cap) apply per resource.\n */\nimport { AutotaskConfigError, isAutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey, parseIdentifier } from '../utils/index.js';\nimport type { BaseResource } from '../resources/base.js';\nimport {\n WORKFLOW_RESOURCES,\n type ResolveAnyOptions,\n type ResolveAnyResourceOutcome,\n type ResolveAnyResult,\n} from './types.js';\n\nfunction resourceFor<T>(client: AutotaskClient, key: string): T | undefined {\n return (client as unknown as Record<string, T | undefined>)[camelKey(key)];\n}\n\n/** Error categories that are real faults, not resolution misses. */\nconst FAULT_CATEGORIES: ReadonlySet<string> = new Set(['auth', 'rate_limit', 'server', 'network', 'timeout', 'policy']);\n\n/** The cost label for a miss: what the resolution attempted. */\nfunction missCost(identifier: number | string): 'direct' | 'server-filter' {\n if (typeof identifier === 'number') return 'direct';\n return /^\\d+$/.test(identifier.trim()) ? 'direct' : 'server-filter';\n}\n\nexport async function resolveAny(\n client: AutotaskClient,\n identifier: number | string,\n opts: ResolveAnyOptions = {},\n): Promise<ResolveAnyResult> {\n if (typeof identifier === 'number') {\n // The SAME identifier contract as every other read path (QA §3\n // unification): parseIdentifier refuses an unsafe (already corrupted)\n // JS number pre-scan, instead of N per-resource CONFIG_ERROR misses.\n parseIdentifier(identifier, 'identifier');\n } else if (identifier.trim() === '') {\n throw new AutotaskConfigError('resolveAny: identifier must be non-empty');\n }\n const keys = opts.resources ?? WORKFLOW_RESOURCES;\n if (keys.length === 0) {\n throw new AutotaskConfigError('resolveAny: no resources requested');\n }\n const results: ResolveAnyResourceOutcome[] = [];\n for (const key of keys) {\n const holder = resourceFor<BaseResource<Record<string, unknown>>>(client, key);\n if (holder === undefined || typeof holder.resolveDetailed !== 'function') {\n // No resolve surface on this resource: reported, not errored.\n results.push({\n resource: key,\n value: null,\n resolutionCost: missCost(identifier),\n scanned: 0,\n scanTruncated: false,\n candidates: [],\n error: 'NO_RESOLVE',\n });\n continue;\n }\n try {\n const r = await holder.resolveDetailed(identifier);\n results.push({\n resource: key,\n value: (r.value ?? null) as Record<string, unknown> | null,\n resolutionCost: r.resolutionCost,\n scanned: r.scanned,\n scanTruncated: r.scanTruncated,\n candidates: (r.candidates ?? []).map((c) => c.id),\n });\n } catch (err) {\n // Misses do not throw: map the error code onto the outcome. A real\n // fault (auth, rate limit, server, network, timeout, policy) is not a\n // miss — it propagates, so a revoked credential never reads as \"no match\".\n let code: string;\n let candidates: (number | string)[] = [];\n if (err instanceof AutotaskConfigError) {\n code = 'CONFIG_ERROR';\n } else if (isAutotaskError(err)) {\n if (FAULT_CATEGORIES.has(err.category)) throw err;\n code = err.code;\n // Only ambiguity carries candidates; a NOT_FOUND miss's resourceIds\n // name the missed id, not candidates.\n if (code === 'RESOLUTION_AMBIGUOUS' && err.resourceIds !== undefined) {\n candidates = err.resourceIds;\n }\n } else {\n throw err;\n }\n results.push({\n resource: key,\n value: null,\n resolutionCost: missCost(identifier),\n scanned: 0,\n scanTruncated: code === 'RESOLUTION_TRUNCATED',\n candidates,\n error: code,\n });\n }\n }\n const matches = results.filter((r) => r.value !== null).map((r) => r.resource);\n return { identifier, results, matches };\n}\n","/**\n * Model field sets (the vendored-spec field sets, resource → model field names).\n * GENERATED by scripts/generate-batch.mjs from api-docs.json + the plan\n * (the 6th generated artifact; S12-B, run mcp-fix-20261003). Do not\n * hand-edit; re-run the generator. The drift guard is\n * scripts/check-capabilities.mjs + test/scripts/fieldsets-artifact.test.ts.\n *\n * Consumers:\n * - operations.fetchMany validates per-item `fields` projections PRE-REQUEST\n * against these sets (a hallucinated field key is a shape error, never a\n * silent projection-miss — the F-A1 lesson applied to reads);\n * - a plan resource WITHOUT an entry is not single-record GETtable by bare\n * id (the 7 {id}-less integration endpoints + the 4 resources with no\n * get row) — fetchMany refuses it pre-request.\n *\n * planHash: e229200fc177d4428a3d73e75be413c91338876fdc1224bc3c9469788f96d975\n */\n// [GENERATED:FIELDSETS:START]\nexport const MODEL_FIELD_SETS: Record<string, readonly string[]> = {\n \"appointments\": [\"id\", \"createDateTime\", \"creatorResourceID\", \"description\", \"endDateTime\", \"resourceID\", \"startDateTime\", \"title\", \"updateDateTime\"],\n \"billing_codes\": [\"id\", \"afterHoursWorkType\", \"billingCodeType\", \"department\", \"description\", \"externalNumber\", \"generalLedgerAccount\", \"isActive\", \"isExcludedFromNewContracts\", \"markupRate\", \"name\", \"taxCategoryID\", \"unitCost\", \"unitPrice\", \"useType\"],\n \"billing_items\": [\"id\", \"accountManagerWhenApprovedID\", \"billingCodeID\", \"billingItemType\", \"companyID\", \"configurationItemID\", \"contractBlockID\", \"contractChargeID\", \"contractID\", \"contractServiceAdjustmentID\", \"contractServiceBundleAdjustmentID\", \"contractServiceBundleID\", \"contractServiceBundlePeriodID\", \"contractServiceID\", \"contractServicePeriodID\", \"description\", \"expenseItemID\", \"extendedPrice\", \"internalCurrencyExtendedPrice\", \"internalCurrencyRate\", \"internalCurrencyTaxDollars\", \"internalCurrencyTotalAmount\", \"invoiceID\", \"itemApproverID\", \"itemDate\", \"itemName\", \"lineItemFullDescription\", \"lineItemGroupDescription\", \"milestoneID\", \"nonBillable\", \"organizationalLevelAssociationID\", \"ourCost\", \"postedDate\", \"postedOnTime\", \"projectChargeID\", \"projectID\", \"purchaseOrderNumber\", \"quantity\", \"rate\", \"roleID\", \"serviceBundleID\", \"serviceID\", \"sortOrderID\", \"subType\", \"taskID\", \"taxDollars\", \"ticketChargeID\", \"ticketID\", \"timeEntryID\", \"totalAmount\", \"vendorID\", \"webServiceDate\"],\n \"change_request_links\": [\"id\", \"changeRequestTicketID\", \"problemOrIncidentTicketID\"],\n \"checklist_libraries\": [\"id\", \"description\", \"entityType\", \"isActive\", \"name\"],\n \"checklist_library_checklist_items\": [\"id\", \"checklistLibraryID\", \"isImportant\", \"itemName\", \"knowledgebaseArticleID\", \"position\", \"soapParentPropertyId\"],\n \"classification_icons\": [\"id\", \"description\", \"isActive\", \"isSystem\", \"name\", \"relativeUrl\"],\n \"companies\": [\"id\", \"additionalAddressInformation\", \"address1\", \"address2\", \"alternatePhone1\", \"alternatePhone2\", \"apiVendorID\", \"assetValue\", \"billToCompanyLocationID\", \"billToAdditionalAddressInformation\", \"billingAddress1\", \"billingAddress2\", \"billToAddressToUse\", \"billToAttention\", \"billToCity\", \"billToCountryID\", \"billToState\", \"billToZipCode\", \"city\", \"classification\", \"companyCategoryID\", \"companyName\", \"companyNumber\", \"companyType\", \"competitorID\", \"countryID\", \"createDate\", \"createdByResourceID\", \"currencyID\", \"fax\", \"impersonatorCreatorResourceID\", \"invoiceEmailMessageID\", \"invoiceMethod\", \"invoiceNonContractItemsToParentCompany\", \"invoiceTemplateID\", \"isActive\", \"isClientPortalActive\", \"isEnabledForComanaged\", \"isSample\", \"isTaskFireActive\", \"isTaxExempt\", \"lastActivityDate\", \"lastTrackedModifiedDateTime\", \"marketSegmentID\", \"ownerResourceID\", \"parentCompanyID\", \"phone\", \"postalCode\", \"purchaseOrderTemplateID\", \"quoteEmailMessageID\", \"quoteTemplateID\", \"sicCode\", \"state\", \"stockMarket\", \"stockSymbol\", \"surveyCompanyRating\", \"taxID\", \"taxRegionID\", \"territoryID\", \"webAddress\", \"userDefinedFields\"],\n \"company_alerts\": [\"id\", \"alertText\", \"alertTypeID\", \"companyID\", \"soapParentPropertyId\"],\n \"company_locations\": [\"id\", \"address1\", \"address2\", \"alternatePhone1\", \"alternatePhone2\", \"city\", \"companyID\", \"countryID\", \"description\", \"fax\", \"isActive\", \"isPrimary\", \"isTaxExempt\", \"overrideCompanyTaxSettings\", \"name\", \"phone\", \"postalCode\", \"roundtripDistance\", \"state\", \"taxRegionID\", \"soapParentPropertyId\"],\n \"company_notes\": [\"id\", \"actionType\", \"assignedResourceID\", \"companyID\", \"completedDateTime\", \"contactID\", \"createDateTime\", \"endDateTime\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastModifiedDate\", \"name\", \"note\", \"opportunityID\", \"startDateTime\", \"soapParentPropertyId\"],\n \"company_site_configurations\": [\"id\", \"companyID\", \"locationName\", \"soapParentPropertyId\", \"userDefinedFields\"],\n \"company_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"configuration_item_billing_product_associations\": [\"id\", \"billingProductID\", \"configurationItemID\", \"effectiveDate\", \"expirationDate\", \"soapParentPropertyId\"],\n \"configuration_item_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isClientPortalDefault\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"configuration_item_category_udf_associations\": [\"id\", \"configurationItemCategoryID\", \"isRequired\", \"userDefinedFieldDefinitionID\", \"soapParentPropertyId\"],\n \"configuration_item_dns_records\": [\"id\", \"createDateTime\", \"data\", \"installedProductID\", \"timeToLiveSeconds\", \"dnsType\", \"soapParentPropertyId\"],\n \"configuration_item_notes\": [\"id\", \"configurationItemID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"noteType\", \"title\", \"soapParentPropertyId\"],\n \"configuration_item_related_items\": [\"id\", \"configurationItemID\", \"relatedConfigurationItemID\", \"relationship\", \"soapParentPropertyId\"],\n \"configuration_item_ssl_subject_alternative_names\": [\"id\", \"configurationItemID\", \"name\", \"soapParentPropertyId\"],\n \"configuration_item_types\": [\"id\", \"isActive\", \"name\"],\n \"configuration_item_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"configuration_items\": [\"id\", \"apiVendorID\", \"configurationItemCategoryID\", \"companyID\", \"companyLocationID\", \"configurationItemType\", \"contactID\", \"contractID\", \"contractServiceBundleID\", \"contractServiceID\", \"createDate\", \"createdByPersonID\", \"dailyCost\", \"dattoAvailableKilobytes\", \"dattoDeviceMemoryMegabytes\", \"dattoDrivesErrors\", \"dattoHostname\", \"dattoInternalIP\", \"dattoKernelVersionID\", \"dattoLastCheckInDateTime\", \"dattoNICSpeedKilobitsPerSecond\", \"dattoNumberOfAgents\", \"dattoNumberOfDrives\", \"dattoNumberOfVolumes\", \"dattoOffsiteUsedBytes\", \"dattoOSVersionID\", \"dattoPercentageUsed\", \"dattoProtectedKilobytes\", \"dattoRemoteIP\", \"dattoSerialNumber\", \"dattoUptimeSeconds\", \"dattoUsedKilobytes\", \"dattoZFSVersionID\", \"deviceNetworkingID\", \"domain\", \"domainRegistrarID\", \"domainRegistrationDateTime\", \"domainLastUpdatedDateTime\", \"domainExpirationDateTime\", \"hourlyCost\", \"impersonatorCreatorResourceID\", \"installDate\", \"installedByContactID\", \"installedByID\", \"isActive\", \"lastActivityPersonID\", \"lastActivityPersonType\", \"lastModifiedTime\", \"location\", \"monthlyCost\", \"notes\", \"numberOfUsers\", \"parentConfigurationItemID\", \"perUseCost\", \"productID\", \"referenceNumber\", \"referenceTitle\", \"rmmDeviceAuditAntivirusStatusID\", \"rmmDeviceAuditArchitectureID\", \"rmmDeviceAuditBackupStatusID\", \"rmmDeviceAuditDescription\", \"rmmDeviceAuditDeviceTypeID\", \"rmmDeviceAuditDisplayAdaptorID\", \"rmmDeviceAuditDomainID\", \"rmmDeviceAuditExternalIPAddress\", \"rmmDeviceAuditHostname\", \"rmmDeviceAuditIPAddress\", \"rmmDeviceAuditLastUser\", \"rmmDeviceAuditMacAddress\", \"rmmDeviceAuditManufacturerID\", \"rmmDeviceAuditFirmwareID\", \"rmmDeviceAuditMemoryBytes\", \"rmmDeviceAuditMissingPatchCount\", \"rmmDeviceAuditMobileNetworkOperatorID\", \"rmmDeviceAuditMobileNumber\", \"rmmDeviceAuditModelID\", \"rmmDeviceAuditMotherboardID\", \"rmmDeviceAuditOperatingSystem\", \"rmmDeviceAuditPatchStatusID\", \"rmmDeviceAuditProcessorID\", \"rmmDeviceAuditServicePackID\", \"rmmDeviceAuditSNMPContact\", \"rmmDeviceAuditSNMPLocation\", \"rmmDeviceAuditSNMPName\", \"rmmDeviceAuditSoftwareStatusID\", \"rmmDeviceAuditStorageBytes\", \"rmmDeviceID\", \"rmmDeviceUID\", \"rmmVsaxDeviceID\", \"rmmOpenAlertCount\", \"serialNumber\", \"serviceBundleID\", \"serviceID\", \"serviceLevelAgreementID\", \"setupFee\", \"sourceChargeID\", \"sourceChargeType\", \"sslSource\", \"sslCommonName\", \"sslValidFromDateTime\", \"sslValidUntilDateTime\", \"sslIssuedBy\", \"sslOrganization\", \"sslOrganizationUnit\", \"sslLocation\", \"sslSerialNumber\", \"sslSignatureAlgorithm\", \"vendorID\", \"warrantyExpirationDate\", \"rmmIsInMaintenanceMode\", \"rmmIsMobileDeviceManagementEnrolled\", \"rmmDeviceUrl\", \"userDefinedFields\"],\n \"contact_group_contacts\": [\"id\", \"contactId\", \"contactGroupId\", \"soapParentPropertyId\"],\n \"contact_groups\": [\"id\", \"name\", \"isActive\"],\n \"contact_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"contacts\": [\"id\", \"additionalAddressInformation\", \"addressLine\", \"addressLine1\", \"alternatePhone\", \"apiVendorID\", \"bulkEmailOptOutTime\", \"city\", \"companyID\", \"companyLocationID\", \"countryID\", \"createDate\", \"emailAddress\", \"emailAddress2\", \"emailAddress3\", \"extension\", \"externalID\", \"facebookUrl\", \"faxNumber\", \"firstName\", \"impersonatorCreatorResourceID\", \"isActive\", \"isOptedOutFromBulkEmail\", \"lastActivityDate\", \"lastModifiedDate\", \"lastName\", \"linkedInUrl\", \"middleInitial\", \"mobilePhone\", \"namePrefix\", \"nameSuffix\", \"note\", \"receivesEmailNotifications\", \"phone\", \"primaryContact\", \"roomNumber\", \"solicitationOptOut\", \"solicitationOptOutTime\", \"state\", \"surveyOptOut\", \"title\", \"twitterUrl\", \"zipCode\", \"soapParentPropertyId\", \"userDefinedFields\"],\n \"contract_billing_rules\": [\"id\", \"contractID\", \"createChargesAsBillable\", \"dailyProratedCost\", \"dailyProratedPrice\", \"determineUnits\", \"endDate\", \"executionMethod\", \"includeItemsInChargeDescription\", \"invoiceDescription\", \"isActive\", \"isDailyProrationEnabled\", \"maximumUnits\", \"minimumUnits\", \"productID\", \"startDate\", \"soapParentPropertyId\"],\n \"contract_block_hour_factors\": [\"id\", \"blockHourMultiplier\", \"contractHourlyRate\", \"contractID\", \"internalCurrencyContractHourlyRate\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_blocks\": [\"id\", \"contractID\", \"datePurchased\", \"endDate\", \"hourlyRate\", \"hours\", \"hoursApproved\", \"invoiceNumber\", \"isPaid\", \"paymentNumber\", \"paymentType\", \"startDate\", \"status\", \"soapParentPropertyId\"],\n \"contract_charges\": [\"id\", \"billableAmount\", \"billingCodeID\", \"chargeType\", \"contractID\", \"contractServiceBundleID\", \"contractServiceID\", \"createDate\", \"creatorResourceID\", \"datePurchased\", \"description\", \"extendedCost\", \"internalCurrencyBillableAmount\", \"internalCurrencyUnitPrice\", \"internalPurchaseOrderNumber\", \"isBillableToCompany\", \"isBilled\", \"name\", \"notes\", \"organizationalLevelAssociationID\", \"productID\", \"purchaseOrderNumber\", \"status\", \"statusLastModifiedBy\", \"statusLastModifiedDate\", \"unitCost\", \"unitPrice\", \"unitQuantity\", \"soapParentPropertyId\"],\n \"contract_exclusion_billing_codes\": [\"id\", \"billingCodeID\", \"contractID\", \"soapParentPropertyId\"],\n \"contract_exclusion_roles\": [\"id\", \"contractID\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_exclusion_set_excluded_roles\": [\"id\", \"contractExclusionSetID\", \"excludedRoleID\", \"soapParentPropertyId\"],\n \"contract_exclusion_set_excluded_work_types\": [\"id\", \"contractExclusionSetID\", \"excludedWorkTypeID\", \"soapParentPropertyId\"],\n \"contract_exclusion_sets\": [\"id\", \"description\", \"isActive\", \"name\"],\n \"contract_milestones\": [\"id\", \"amount\", \"billingCodeID\", \"contractID\", \"createDate\", \"creatorResourceID\", \"dateDue\", \"description\", \"internalCurrencyAmount\", \"isInitialPayment\", \"organizationalLevelAssociationID\", \"status\", \"title\", \"soapParentPropertyId\"],\n \"contract_notes\": [\"id\", \"contractID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"title\", \"soapParentPropertyId\"],\n \"contract_rates\": [\"id\", \"contractHourlyRate\", \"contractID\", \"internalCurrencyContractHourlyRate\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_retainers\": [\"id\", \"amount\", \"amountApproved\", \"contractID\", \"datePurchased\", \"endDate\", \"internalCurrencyAmount\", \"internalCurrencyAmountApproved\", \"invoiceNumber\", \"isPaid\", \"paymentID\", \"paymentNumber\", \"startDate\", \"status\", \"soapParentPropertyId\"],\n \"contract_role_costs\": [\"id\", \"contractID\", \"rate\", \"resourceID\", \"roleID\", \"soapParentPropertyId\"],\n \"contract_service_bundle_units\": [\"id\", \"approveAndPostDate\", \"contractID\", \"contractServiceBundleID\", \"cost\", \"endDate\", \"internalCurrencyPrice\", \"organizationalLevelAssociationID\", \"price\", \"serviceBundleID\", \"startDate\", \"units\", \"soapParentPropertyId\"],\n \"contract_service_bundles\": [\"id\", \"adjustedPrice\", \"contractID\", \"internalCurrencyAdjustedPrice\", \"internalCurrencyUnitPrice\", \"internalDescription\", \"invoiceDescription\", \"quoteItemID\", \"serviceBundleID\", \"unitPrice\", \"soapParentPropertyId\"],\n \"contract_service_units\": [\"id\", \"approveAndPostDate\", \"contractID\", \"contractServiceID\", \"cost\", \"endDate\", \"internalCurrencyPrice\", \"organizationalLevelAssociationID\", \"price\", \"serviceID\", \"startDate\", \"units\", \"vendorCompanyID\", \"soapParentPropertyId\"],\n \"contract_services\": [\"id\", \"contractID\", \"internalCurrencyAdjustedPrice\", \"internalCurrencyUnitPrice\", \"internalDescription\", \"invoiceDescription\", \"quoteItemID\", \"serviceID\", \"unitCost\", \"unitPrice\", \"soapParentPropertyId\"],\n \"contract_ticket_purchases\": [\"id\", \"contractID\", \"datePurchased\", \"endDate\", \"invoiceNumber\", \"isPaid\", \"paymentNumber\", \"paymentType\", \"perTicketRate\", \"startDate\", \"status\", \"ticketsPurchased\", \"ticketsUsed\", \"soapParentPropertyId\"],\n \"contracts\": [\"id\", \"billingPreference\", \"billToCompanyContactID\", \"billToCompanyID\", \"companyID\", \"contactID\", \"contactName\", \"contractCategory\", \"contractExclusionSetID\", \"contractName\", \"contractNumber\", \"contractPeriodType\", \"contractType\", \"description\", \"endDate\", \"estimatedCost\", \"estimatedHours\", \"estimatedRevenue\", \"exclusionContractID\", \"internalCurrencyOverageBillingRate\", \"internalCurrencySetupFee\", \"isCompliant\", \"isDefaultContract\", \"lastModifiedDateTime\", \"opportunityID\", \"organizationalLevelAssociationID\", \"overageBillingRate\", \"purchaseOrderNumber\", \"renewedContractID\", \"serviceLevelAgreementID\", \"setupFee\", \"setupFeeBillingCodeID\", \"startDate\", \"status\", \"timeReportingRequiresStartAndStopTimes\", \"userDefinedFields\"],\n \"countries\": [\"id\", \"addressFormatID\", \"countryCode\", \"displayName\", \"invoiceTemplateID\", \"isActive\", \"isDefaultCountry\", \"name\", \"purchaseOrderTemplateID\", \"quoteTemplateID\"],\n \"departments\": [\"id\", \"description\", \"name\", \"number\", \"primaryLocationID\"],\n \"domain_registrars\": [\"id\", \"name\", \"url\"],\n \"expense_item_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"expenseItemID\", \"expenseReportID\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"expense_items\": [\"id\", \"companyID\", \"description\", \"destination\", \"entertainmentLocation\", \"expenseCategory\", \"expenseCurrencyExpenseAmount\", \"expenseCurrencyID\", \"expenseDate\", \"expenseReportID\", \"glCode\", \"haveReceipt\", \"internalCurrencyExpenseAmount\", \"internalCurrencyReimbursementAmount\", \"isBillableToCompany\", \"isReimbursable\", \"isRejected\", \"miles\", \"odometerEnd\", \"odometerStart\", \"origin\", \"paymentType\", \"projectID\", \"purchaseOrderNumber\", \"reimbursementCurrencyReimbursementAmount\", \"taskID\", \"ticketID\", \"workType\", \"soapParentPropertyId\"],\n \"expense_reports\": [\"id\", \"amountDue\", \"approvedDate\", \"approverID\", \"departmentNumber\", \"internalCurrencyCashAdvanceAmount\", \"internalCurrencyExpenseTotal\", \"name\", \"organizationalLevelAssociationID\", \"quickBooksReferenceNumber\", \"reimbursementCurrencyAmountDue\", \"reimbursementCurrencyCashAdvanceAmount\", \"reimbursementCurrencyID\", \"rejectionReason\", \"status\", \"submit\", \"submitDate\", \"submitterID\", \"weekEnding\"],\n \"holiday_sets\": [\"id\", \"holidaySetDescription\", \"holidaySetName\"],\n \"holidays\": [\"id\", \"holidayDate\", \"holidayName\", \"holidaySetID\", \"soapParentPropertyId\"],\n \"inventory_products\": [\"id\", \"availableUnits\", \"backOrderQuantity\", \"bin\", \"createDateTime\", \"createdByResourceID\", \"inventoryLocationID\", \"onHandUnits\", \"pickedUnits\", \"productID\", \"quantityMaximum\", \"quantityMinimum\", \"referenceNumber\", \"reservedUnits\", \"unitsOnOrder\"],\n \"invoices\": [\"id\", \"batchID\", \"comments\", \"companyID\", \"createDateTime\", \"creatorResourceID\", \"dueDate\", \"fromDate\", \"invoiceDateTime\", \"invoiceEditorTemplateID\", \"invoiceNumber\", \"invoiceTotal\", \"isVoided\", \"orderNumber\", \"paidDate\", \"paymentTerm\", \"taxGroup\", \"taxRegionName\", \"toDate\", \"totalTaxValue\", \"voidedByResourceID\", \"voidedDate\", \"webServiceDate\"],\n \"notification_history\": [\"id\", \"companyID\", \"entityNumber\", \"entityTitle\", \"initiatingContactID\", \"initiatingResourceID\", \"isActive\", \"isDeleted\", \"isTemplateJob\", \"notificationHistoryTypeID\", \"notificationSentTime\", \"opportunityID\", \"projectID\", \"quoteID\", \"recipientDisplayName\", \"recipientEmailAddress\", \"taskID\", \"templateName\", \"ticketID\", \"timeEntryID\"],\n \"opportunities\": [\"id\", \"advancedField1\", \"advancedField2\", \"advancedField3\", \"advancedField4\", \"advancedField5\", \"amount\", \"assessmentScore\", \"barriers\", \"closedDate\", \"companyID\", \"contactID\", \"cost\", \"createDate\", \"creatorResourceID\", \"description\", \"helpNeeded\", \"impersonatorCreatorResourceID\", \"lastActivity\", \"leadSource\", \"lossReason\", \"lossReasonDetail\", \"lostDate\", \"market\", \"monthlyCost\", \"monthlyRevenue\", \"nextStep\", \"onetimeCost\", \"onetimeRevenue\", \"opportunityCategoryID\", \"organizationalLevelAssociationID\", \"ownerResourceID\", \"primaryCompetitor\", \"probability\", \"productID\", \"projectedCloseDate\", \"promisedFulfillmentDate\", \"promotionName\", \"quarterlyCost\", \"quarterlyRevenue\", \"rating\", \"relationshipAssessmentScore\", \"revenueSpread\", \"revenueSpreadUnit\", \"salesOrderID\", \"salesProcessPercentComplete\", \"semiannualCost\", \"semiannualRevenue\", \"stage\", \"startDate\", \"status\", \"technicalAssessmentScore\", \"throughDate\", \"title\", \"totalAmountMonths\", \"useQuoteTotals\", \"winReason\", \"winReasonDetail\", \"yearlyCost\", \"yearlyRevenue\", \"userDefinedFields\"],\n \"opportunity_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentAttachmentID\", \"parentID\", \"publish\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"opportunity_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"phases\": [\"id\", \"createDate\", \"creatorResourceID\", \"description\", \"dueDate\", \"estimatedHours\", \"externalID\", \"isScheduled\", \"lastActivityDateTime\", \"parentPhaseID\", \"phaseNumber\", \"projectID\", \"startDate\", \"title\", \"soapParentPropertyId\"],\n \"product_vendors\": [\"id\", \"isActive\", \"isDefault\", \"productID\", \"vendorCost\", \"vendorID\", \"vendorPartNumber\", \"soapParentPropertyId\"],\n \"products\": [\"id\", \"billingType\", \"chargeBillingCodeID\", \"createdByResourceID\", \"createdTime\", \"defaultVendorID\", \"description\", \"doesNotRequireProcurement\", \"externalProductID\", \"impersonatorCreatorResourceID\", \"internalProductID\", \"isActive\", \"isEligibleForRma\", \"isSerialized\", \"link\", \"manufacturerName\", \"manufacturerProductName\", \"markupRate\", \"msrp\", \"name\", \"periodType\", \"priceCostMethod\", \"productBillingCodeID\", \"productCategory\", \"sku\", \"unitCost\", \"unitPrice\", \"vendorProductNumber\", \"defaultInstalledProductCategoryID\", \"userDefinedFields\"],\n \"project_charges\": [\"id\", \"billableAmount\", \"billingCodeID\", \"chargeType\", \"contractServiceBundleID\", \"contractServiceID\", \"createDate\", \"creatorResourceID\", \"datePurchased\", \"description\", \"estimatedCost\", \"extendedCost\", \"internalCurrencyBillableAmount\", \"internalCurrencyUnitPrice\", \"internalPurchaseOrderNumber\", \"isBillableToCompany\", \"isBilled\", \"name\", \"notes\", \"organizationalLevelAssociationID\", \"productID\", \"projectID\", \"purchaseOrderNumber\", \"status\", \"statusLastModifiedBy\", \"statusLastModifiedDate\", \"unitCost\", \"unitPrice\", \"unitQuantity\", \"soapParentPropertyId\"],\n \"project_notes\": [\"id\", \"createDateTime\", \"createdByContactID\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"isAnnouncement\", \"lastActivityDate\", \"noteType\", \"projectID\", \"publish\", \"title\", \"soapParentPropertyId\"],\n \"projects\": [\"id\", \"actualBilledHours\", \"actualHours\", \"changeOrdersBudget\", \"changeOrdersRevenue\", \"companyID\", \"companyOwnerResourceID\", \"completedDateTime\", \"completedPercentage\", \"contractID\", \"createDateTime\", \"creatorResourceID\", \"department\", \"description\", \"duration\", \"endDateTime\", \"estimatedSalesCost\", \"estimatedTime\", \"extProjectNumber\", \"extProjectType\", \"impersonatorCreatorResourceID\", \"laborEstimatedCosts\", \"laborEstimatedMarginPercentage\", \"laborEstimatedRevenue\", \"lastActivityDateTime\", \"lastActivityPersonType\", \"lastActivityResourceID\", \"opportunityID\", \"organizationalLevelAssociationID\", \"originalEstimatedRevenue\", \"projectCostEstimatedMarginPercentage\", \"projectCostsBudget\", \"projectCostsRevenue\", \"projectLeadResourceID\", \"projectName\", \"projectNumber\", \"projectType\", \"purchaseOrderNumber\", \"sgda\", \"startDateTime\", \"status\", \"statusDateTime\", \"statusDetail\", \"userDefinedFields\"],\n \"purchase_approvals\": [\"id\", \"costType\", \"isApproved\", \"rejectNote\"],\n \"purchase_order_item_receiving\": [\"id\", \"purchaseOrderItemID\", \"quantityBackOrdered\", \"quantityNowReceiving\", \"quantityPreviouslyReceived\", \"receiveDate\", \"receivedByResourceID\", \"serialNumber\", \"vendorInvoiceNumber\", \"soapParentPropertyId\"],\n \"purchase_order_items\": [\"id\", \"chargeID\", \"contractID\", \"estimatedArrivalDate\", \"internalCurrencyUnitCost\", \"inventoryLocationID\", \"memo\", \"orderID\", \"productID\", \"projectID\", \"quantity\", \"salesOrderID\", \"ticketID\", \"unitCost\", \"soapParentPropertyId\"],\n \"purchase_orders\": [\"id\", \"cancelDateTime\", \"createDateTime\", \"creatorResourceID\", \"externalPONumber\", \"fax\", \"freight\", \"generalMemo\", \"impersonatorCreatorResourceID\", \"internalCurrencyFreight\", \"latestEstimatedArrivalDate\", \"paymentTerm\", \"phone\", \"purchaseForCompanyID\", \"purchaseOrderNumber\", \"purchaseOrderTemplateID\", \"shippingDate\", \"shippingType\", \"shipToAddress1\", \"shipToAddress2\", \"shipToCity\", \"shipToName\", \"shipToPostalCode\", \"shipToState\", \"showEachTaxInGroup\", \"showTaxCategory\", \"status\", \"submitDateTime\", \"taxRegionID\", \"useItemDescriptionsFrom\", \"vendorID\", \"vendorInvoiceNumber\", \"additionalVendorInvoiceNumbers\"],\n \"quote_items\": [\"id\", \"averageCost\", \"chargeID\", \"description\", \"expenseID\", \"highestCost\", \"internalCurrencyLineDiscount\", \"internalCurrencyUnitDiscount\", \"internalCurrencyUnitPrice\", \"isOptional\", \"isTaxable\", \"laborID\", \"lineDiscount\", \"markupRate\", \"name\", \"percentageDiscount\", \"periodType\", \"productID\", \"quantity\", \"quoteID\", \"quoteItemType\", \"serviceBundleID\", \"serviceID\", \"shippingID\", \"sortOrderID\", \"taxCategoryID\", \"totalEffectiveTax\", \"unitCost\", \"unitDiscount\", \"unitPrice\", \"soapParentPropertyId\"],\n \"quote_locations\": [\"id\", \"address1\", \"address2\", \"city\", \"postalCode\", \"state\"],\n \"quote_templates\": [\"id\", \"calculateTaxSeparately\", \"createDate\", \"createdBy\", \"currencyNegativeFormat\", \"currencyPositiveFormat\", \"dateFormat\", \"description\", \"displayTaxCategorySuperscripts\", \"isActive\", \"lastActivityBy\", \"lastActivityDate\", \"name\", \"numberFormat\", \"pageLayout\", \"pageNumberFormat\", \"showEachTaxInGroup\", \"showGridHeader\", \"showTaxCategory\", \"showVerticalGridLines\"],\n \"quotes\": [\"id\", \"approvalStatus\", \"approvalStatusChangedByResourceID\", \"approvalStatusChangedDate\", \"billToLocationID\", \"calculateTaxSeparately\", \"comment\", \"companyID\", \"contactID\", \"createDate\", \"creatorResourceID\", \"description\", \"effectiveDate\", \"expirationDate\", \"extApprovalContactResponse\", \"extApprovalResponseDate\", \"extApprovalResponseSignature\", \"externalQuoteNumber\", \"groupByID\", \"impersonatorCreatorResourceID\", \"isActive\", \"lastActivityDate\", \"lastModifiedBy\", \"lastPublishedByResourceID\", \"lastPublishedDateTime\", \"name\", \"opportunityID\", \"paymentTerm\", \"paymentType\", \"primaryQuote\", \"proposalProjectID\", \"purchaseOrderNumber\", \"quoteNumber\", \"quoteTemplateID\", \"shippingType\", \"shipToLocationID\", \"showEachTaxInGroup\", \"showTaxCategory\", \"soldToLocationID\", \"taxRegionID\"],\n \"resource_role_queues\": [\"id\", \"queueID\", \"resourceID\", \"soapParentPropertyId\"],\n \"resource_roles\": [\"id\", \"departmentID\", \"isActive\", \"queueID\", \"resourceID\", \"roleID\", \"soapParentPropertyId\"],\n \"resource_skills\": [\"id\", \"resourceID\", \"skillDescription\", \"skillID\", \"skillLevel\", \"soapParentPropertyId\"],\n \"resource_time_off_approvers\": [\"id\", \"resourceID\", \"approverResourceID\", \"approvalLevel\", \"soapParentPropertyId\"],\n \"resource_time_off_balances\": [\"id\", \"resourceID\", \"floatingHolidayAnnualAllowance\", \"floatingHolidayBalance\", \"floatingHolidayPlanned\", \"floatingHolidayUsed\", \"floatingHolidayWaitingApproval\", \"personalTimeAnnualAllowance\", \"personalTimeBalance\", \"personalTimePlanned\", \"personalTimeUsed\", \"personalTimeWaitingApproval\", \"sickTimeAnnualAllowance\", \"sickTimeBalance\", \"sickTimePlanned\", \"sickTimeUsed\", \"sickTimeWaitingApproval\", \"vacationTimeAnnualAllowance\", \"vacationTimeBalance\", \"vacationTimePlanned\", \"vacationTimeUsed\", \"vacationTimeWaitingApproval\", \"year\", \"soapParentPropertyId\"],\n \"resources\": [\"id\", \"accountingReferenceID\", \"dateFormat\", \"defaultServiceDeskRoleID\", \"email\", \"email2\", \"email3\", \"emailTypeCode\", \"emailTypeCode2\", \"emailTypeCode3\", \"firstName\", \"gender\", \"greeting\", \"hireDate\", \"homePhone\", \"initials\", \"internalCost\", \"isActive\", \"lastName\", \"licenseType\", \"locationID\", \"middleName\", \"mobilePhone\", \"numberFormat\", \"officeExtension\", \"officePhone\", \"payrollIdentifier\", \"payrollType\", \"resourceType\", \"suffix\", \"surveyResourceRating\", \"timeFormat\", \"title\", \"travelAvailabilityPct\", \"userName\", \"userType\"],\n \"roles\": [\"id\", \"description\", \"hourlyFactor\", \"hourlyRate\", \"isActive\", \"isExcludedFromNewContracts\", \"isSystemRole\", \"name\", \"quoteItemDefaultTaxCategoryId\", \"roleType\"],\n \"service_call_task_resources\": [\"id\", \"resourceID\", \"serviceCallTaskID\", \"soapParentPropertyId\"],\n \"service_call_tasks\": [\"id\", \"serviceCallID\", \"taskID\", \"soapParentPropertyId\"],\n \"service_call_ticket_resources\": [\"id\", \"resourceID\", \"serviceCallTicketID\", \"soapParentPropertyId\"],\n \"service_call_tickets\": [\"id\", \"serviceCallID\", \"ticketID\", \"soapParentPropertyId\"],\n \"service_calls\": [\"id\", \"cancelationNoticeHours\", \"canceledByResourceID\", \"canceledDateTime\", \"companyID\", \"companyLocationID\", \"createDateTime\", \"creatorResourceID\", \"description\", \"duration\", \"endDateTime\", \"impersonatorCreatorResourceID\", \"isComplete\", \"lastModifiedDateTime\", \"startDateTime\", \"status\"],\n \"service_level_agreement_results\": [\"id\", \"firstResponseElapsedHours\", \"firstResponseInitiatingResourceID\", \"firstResponseResourceID\", \"isFirstResponseMet\", \"isResolutionMet\", \"isResolutionPlanMet\", \"resolutionElapsedHours\", \"resolutionPlanElapsedHours\", \"resolutionPlanResourceID\", \"resolutionResourceID\", \"serviceLevelAgreementName\", \"ticketID\", \"soapParentPropertyId\"],\n \"services\": [\"id\", \"billingCodeID\", \"createDate\", \"creatorResourceID\", \"description\", \"invoiceDescription\", \"isActive\", \"lastModifiedDate\", \"markupRate\", \"name\", \"periodType\", \"serviceLevelAgreementID\", \"unitCost\", \"unitPrice\", \"updateResourceID\", \"vendorCompanyID\", \"manufacturerServiceProvider\", \"manufacturerServiceProviderProductNumber\", \"catalogNumberPartNumber\", \"sku\", \"internalID\", \"externalID\", \"url\", \"userDefinedFields\"],\n \"skills\": [\"id\", \"categoryID\", \"description\", \"isActive\", \"name\"],\n \"subscription_periods\": [\"id\", \"periodCost\", \"periodDate\", \"periodPrice\", \"postedDate\", \"purchaseOrderNumber\", \"subscriptionID\", \"soapParentPropertyId\"],\n \"subscriptions\": [\"id\", \"configurationItemID\", \"description\", \"effectiveDate\", \"expirationDate\", \"impersonatorCreatorResourceID\", \"materialCodeID\", \"organizationalLevelAssociationID\", \"periodCost\", \"periodPrice\", \"periodType\", \"purchaseOrderNumber\", \"status\", \"subscriptionName\", \"totalCost\", \"totalPrice\", \"vendorID\", \"userDefinedFields\"],\n \"survey_results\": [\"id\", \"companyID\", \"companyRating\", \"completeDate\", \"contactID\", \"contactRating\", \"resourceRating\", \"sendDate\", \"surveyID\", \"surveyRating\", \"ticketID\"],\n \"surveys\": [\"id\", \"description\", \"displayName\", \"name\"],\n \"tag_aliases\": [\"id\", \"alias\", \"tagID\", \"soapParentPropertyId\"],\n \"tag_groups\": [\"id\", \"displayColor\", \"isActive\", \"isSystem\", \"label\"],\n \"tags\": [\"id\", \"createDateTime\", \"isActive\", \"isExcludedFromAutomaticTagging\", \"isSystem\", \"label\", \"lastModifiedDateTime\", \"tagGroupID\"],\n \"task_secondary_resources\": [\"id\", \"resourceID\", \"roleID\", \"taskID\", \"soapParentPropertyId\"],\n \"tasks\": [\"id\", \"assignedResourceID\", \"assignedResourceRoleID\", \"billingCodeID\", \"canClientPortalUserCompleteTask\", \"companyLocationID\", \"completedByResourceID\", \"completedByType\", \"completedDateTime\", \"createDateTime\", \"creatorResourceID\", \"creatorType\", \"departmentID\", \"description\", \"endDateTime\", \"estimatedHours\", \"externalID\", \"hoursToBeScheduled\", \"isTaskBillable\", \"isVisibleInClientPortal\", \"lastActivityDateTime\", \"lastActivityPersonType\", \"lastActivityResourceID\", \"phaseID\", \"priority\", \"priorityLabel\", \"projectID\", \"purchaseOrderNumber\", \"remainingHours\", \"startDateTime\", \"status\", \"taskCategoryID\", \"taskNumber\", \"taskType\", \"title\", \"soapParentPropertyId\", \"userDefinedFields\"],\n \"ticket_additional_configuration_items\": [\"id\", \"configurationItemID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_additional_contacts\": [\"id\", \"contactID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentAttachmentID\", \"parentID\", \"publish\", \"ticketID\", \"ticketNoteID\", \"timeEntryID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"ticket_categories\": [\"id\", \"displayColorRGB\", \"isActive\", \"isApiOnly\", \"isGlobalDefault\", \"name\", \"nickname\"],\n \"ticket_category_field_defaults\": [\"id\", \"description\", \"estimatedHours\", \"issueTypeID\", \"organizationalLevelAssociationID\", \"priority\", \"purchaseOrderNumber\", \"queueID\", \"resolution\", \"serviceLevelAgreementID\", \"sourceID\", \"status\", \"subIssueTypeID\", \"ticketCategoryID\", \"ticketTypeID\", \"title\", \"workTypeID\", \"soapParentPropertyId\"],\n \"ticket_change_request_approvals\": [\"id\", \"approveRejectDateTime\", \"approveRejectNote\", \"contactID\", \"isApproved\", \"resourceID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_charges\": [\"id\", \"billableAmount\", \"billingCodeID\", \"chargeType\", \"contractServiceBundleID\", \"contractServiceID\", \"createDate\", \"creatorResourceID\", \"datePurchased\", \"description\", \"extendedCost\", \"internalCurrencyBillableAmount\", \"internalCurrencyUnitPrice\", \"internalPurchaseOrderNumber\", \"isBillableToCompany\", \"isBilled\", \"name\", \"notes\", \"organizationalLevelAssociationID\", \"productID\", \"purchaseOrderNumber\", \"status\", \"statusLastModifiedBy\", \"statusLastModifiedDate\", \"ticketID\", \"unitCost\", \"unitPrice\", \"unitQuantity\", \"soapParentPropertyId\"],\n \"ticket_checklist_items\": [\"id\", \"completedByResourceID\", \"completedDateTime\", \"isCompleted\", \"isImportant\", \"itemName\", \"knowledgebaseArticleID\", \"position\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_history\": [\"id\", \"action\", \"date\", \"detail\", \"resourceID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_note_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"ticketID\", \"ticketNoteID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"ticket_note_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"ticket_notes\": [\"id\", \"createDateTime\", \"createdByContactID\", \"creatorResourceID\", \"description\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"lastActivityDate\", \"noteType\", \"publish\", \"ticketID\", \"title\", \"soapParentPropertyId\"],\n \"ticket_secondary_resources\": [\"id\", \"resourceID\", \"roleID\", \"ticketID\", \"soapParentPropertyId\"],\n \"ticket_webhooks\": [\"id\", \"deactivationUrl\", \"isActive\", \"isReady\", \"isSubscribedToCreateEvents\", \"isSubscribedToDeleteEvents\", \"isSubscribedToUpdateEvents\", \"name\", \"notificationEmailAddress\", \"ownerResourceID\", \"secretKey\", \"sendThresholdExceededNotification\", \"webhookGUID\", \"webhookUrl\"],\n \"tickets\": [\"id\", \"apiVendorID\", \"assignedResourceID\", \"assignedResourceRoleID\", \"billingCodeID\", \"changeApprovalBoard\", \"changeApprovalStatus\", \"changeApprovalType\", \"changeInfoField1\", \"changeInfoField2\", \"changeInfoField3\", \"changeInfoField4\", \"changeInfoField5\", \"companyID\", \"companyLocationID\", \"completedByResourceID\", \"completedDate\", \"configurationItemID\", \"contactID\", \"contractID\", \"contractServiceBundleID\", \"contractServiceID\", \"createDate\", \"createdByContactID\", \"creatorResourceID\", \"creatorType\", \"currentServiceThermometerRating\", \"description\", \"dueDateTime\", \"estimatedHours\", \"externalID\", \"firstResponseAssignedResourceID\", \"firstResponseDateTime\", \"firstResponseDueDateTime\", \"firstResponseInitiatingResourceID\", \"hoursToBeScheduled\", \"impersonatorCreatorResourceID\", \"isAssignedToComanaged\", \"issueType\", \"isVisibleToComanaged\", \"lastActivityDate\", \"lastActivityPersonType\", \"lastActivityResourceID\", \"lastCustomerNotificationDateTime\", \"lastCustomerVisibleActivityDateTime\", \"lastTrackedModificationDateTime\", \"monitorID\", \"monitorTypeID\", \"opportunityID\", \"organizationalLevelAssociationID\", \"previousServiceThermometerRating\", \"priority\", \"problemTicketId\", \"projectID\", \"purchaseOrderNumber\", \"queueID\", \"resolution\", \"resolutionPlanDateTime\", \"resolutionPlanDueDateTime\", \"resolvedDateTime\", \"resolvedDueDateTime\", \"rmaStatus\", \"rmaType\", \"rmmAlertID\", \"serviceLevelAgreementHasBeenMet\", \"serviceLevelAgreementID\", \"serviceLevelAgreementPausedNextEventHours\", \"serviceThermometerTemperature\", \"source\", \"status\", \"subIssueType\", \"ticketCategory\", \"ticketNumber\", \"ticketType\", \"title\", \"userDefinedFields\"],\n \"time_entries\": [\"id\", \"billingApprovalDateTime\", \"billingApprovalLevelMostRecent\", \"billingApprovalResourceID\", \"billingCodeID\", \"contractID\", \"contractServiceBundleID\", \"contractServiceID\", \"createDateTime\", \"creatorUserID\", \"dateWorked\", \"endDateTime\", \"hoursToBill\", \"hoursWorked\", \"impersonatorCreatorResourceID\", \"impersonatorUpdaterResourceID\", \"internalBillingCodeID\", \"internalNotes\", \"isInternalNotesVisibleToComanaged\", \"isNonBillable\", \"lastModifiedDateTime\", \"lastModifiedUserID\", \"offsetHours\", \"resourceID\", \"roleID\", \"showOnInvoice\", \"startDateTime\", \"summaryNotes\", \"taskID\", \"ticketID\", \"timeEntryType\"],\n \"time_entry_attachments\": [\"id\", \"attachDate\", \"attachedByContactID\", \"attachedByResourceID\", \"attachmentType\", \"contentType\", \"creatorType\", \"fileSize\", \"fullPath\", \"impersonatorCreatorResourceID\", \"opportunityID\", \"parentID\", \"publish\", \"taskID\", \"ticketID\", \"timeEntryID\", \"title\", \"data\", \"parentType\", \"soapParentPropertyId\", \"isTaskAttachment\"],\n \"time_off_requests\": [\"id\", \"approvedDateTime\", \"approveRejectResourceID\", \"createdByResourceID\", \"createDateTime\", \"endTime\", \"hours\", \"impersonatorApproveRejectResourceID\", \"lastModifiedByResourceID\", \"lastModifiedDateTime\", \"lastApprovedLevel\", \"reason\", \"rejectReason\", \"requestDate\", \"resourceID\", \"startTime\", \"status\", \"timeOffRequestType\", \"soapParentPropertyId\"],\n};\n// [GENERATED:FIELDSETS:END]\n","/**\n * `operations.fetchMany` — the batch/fan-out read primitive (S12-B, run\n * mcp-fix-20261003; plan §2.2 pinned contract).\n *\n * One call fetches up to {@link FETCH_MANY_MAX_ITEMS} single records across\n * MIXED resources (sequential GETs — one per item; no in-SDK concurrency: the\n * vendor threshold + the throttle discipline argue against parallel fan-out,\n * and 20 × ~200 ms RTT ≈ 4 s worst case). The MCP server's worst cost\n * pattern today is N sequential `autotask_read` tool calls; this collapses\n * it to one.\n *\n * Pinned semantics:\n * - `fields` = client-side PROJECTION of the full-model GET response (the\n * vendor single-record GET has no includeFields — projection is post-fetch,\n * zero extra wire);\n * - ids are vendor numeric ids (safe integers) or their canonical integer\n * STRING form (ids above 2^53 — the same identifier contract as every\n * other read path: the exact digits travel to the item GET verbatim); a\n * NON-NUMERIC string identifier is `resolveAny`/`findBy*` territory —\n * refused PRE-REQUEST with a pointer at `autotask_resolve_any` (keeps the\n * per-item taxonomy small and deterministic);\n * - unknown field keys are refused PRE-REQUEST against the resource's\n * vendored-spec field set (src/field-sets.ts — generated, drift-guarded):\n * a hallucinated field is a shape error, not a silent projection-miss\n * (the F-A1 lesson applied to reads);\n * - partial failures are PER-ITEM typed (`NOT_FOUND` / `SERVER_ERROR` / the\n * fault's typed code), never all-or-nothing: an item's failure NEVER\n * aborts the remaining items;\n * - the op throws ONLY pre-request (`CONFIG_ERROR`: shape, limits, unknown\n * resource, unknown field key — all items validated up-front, the complete\n * problem list in one message, zero wire);\n * - it is a READ op: the governor appends no bag (no dry-run/confirm\n * interaction); the invoke path's declared `inputSchema` is\n * `{ items: { type: 'object[]', required: true } }` (the loose check\n * passes arrays through; the deep validation is this op's own).\n */\nimport { AutotaskConfigError, isAutotaskError, NotFoundError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport type { Identifier } from '../types/common.js';\nimport { camelKey, parseIdentifier } from '../utils/index.js';\nimport { MODEL_FIELD_SETS } from '../field-sets.js';\nimport { RELATIONSHIP_MAP } from '../relationships.js';\nimport type { FetchManyItem, FetchManyItemResult, FetchManyResult } from './types.js';\n\n/** The pinned per-call item cap (over → CONFIG_ERROR pre-request, zero wire). */\nexport const FETCH_MANY_MAX_ITEMS = 20;\n\nexport interface FetchManyOptions {\n /** May LOWER the {@link FETCH_MANY_MAX_ITEMS} cap (integer >= 1) — never raise it. */\n maxItems?: number;\n}\n\n/**\n * The pre-request validation (zero wire): one `CONFIG_ERROR` carries the\n * COMPLETE problem list for ALL items (shape, limits, unknown resource,\n * string id, unknown field key) — the caller fixes everything in one round.\n */\nexport function validateFetchManyItems(items: unknown, cap: number): void {\n if (!Array.isArray(items)) {\n throw new AutotaskConfigError(\n `fetchMany: items must be the items ARRAY — one positional arg, [{ resource: string, id: number, fields?: string[] }] (got ${Array.isArray(items) ? 'an array' : typeof items})`,\n {\n suggestedAction: 'Pass args = [[{ resource: \"tickets\", id: 123 }, { resource: \"projects\", id: 456 }]] — the items array is the single positional argument.',\n },\n );\n }\n if (items.length === 0) {\n throw new AutotaskConfigError('fetchMany: items must not be empty (a zero-item batch is a shape error, not a no-op)', {\n suggestedAction: 'Pass at least one { resource, id } item — or use the resource\\'s query op for a filtered read.',\n });\n }\n if (items.length > cap) {\n throw new AutotaskConfigError(\n `fetchMany: ${items.length} items over the ${cap}-item cap (FETCH_MANY_MAX_ITEMS = ${FETCH_MANY_MAX_ITEMS}) — zero items were fetched (pre-request)`,\n {\n suggestedAction: `Split the batch into groups of <= ${cap} items — or, for more than ${cap} records / a filtered set, use the resource's bounded query op (<resource>.query).`,\n },\n );\n }\n const problems: string[] = [];\n for (let i = 0; i < items.length; i += 1) {\n const it = items[i]!;\n const at = `items[${i}]`;\n if (typeof it !== 'object' || it === null || Array.isArray(it)) {\n problems.push(`${at}: must be an object { resource: string, id: number, fields?: string[] }`);\n continue;\n }\n const item = it as Record<string, unknown>;\n if (typeof item.resource !== 'string' || item.resource.trim() === '') {\n problems.push(`${at}.resource: required — the plan resource key (string, e.g. 'tickets'; see autotask_catalog)`);\n continue;\n }\n const resourceKey = item.resource;\n const fields = MODEL_FIELD_SETS[resourceKey];\n if (fields === undefined) {\n problems.push(\n `${at}.resource: \"${resourceKey}\" is not a single-record GETtable resource (${Object.keys(MODEL_FIELD_SETS).length} known) — see autotask_catalog for the exact plan keys`,\n );\n continue;\n }\n const rel = RELATIONSHIP_MAP[resourceKey];\n if (rel !== undefined && rel.parentScoped) {\n problems.push(\n `${at}.resource: \"${resourceKey}\" is a parent-scoped child — its get needs (parentId, id); fetchMany takes single numeric ids of TOP-LEVEL records (scoped reads: client.${camelKey(resourceKey)}.get(parentId, id))`,\n );\n continue;\n }\n // QA F3: the id rides the SDK's identifier contract (parseIdentifier):\n // safe integers pass as numbers; canonical integer strings (ids above\n // 2^53) pass with their exact digits; everything else is refused with a\n // shape-teaching pointer — numeric-string vs non-numeric-string vs other.\n try {\n parseIdentifier(item.id, `${at}.id`);\n } catch {\n if (typeof item.id === 'string') {\n problems.push(\n `${at}.id: \"${item.id}\" is not a vendor numeric id — non-numeric string identifiers are autotask_resolve_any territory (resolveAny / the resource's findBy* helpers)`,\n );\n } else if (typeof item.id === 'number') {\n problems.push(\n `${at}.id: ${item.id} is not a non-negative safe integer (a JS number this large is already corrupted — pass the canonical integer string form)`,\n );\n } else {\n problems.push(`${at}.id: required — the vendor numeric id (safe integer, or the canonical integer string for ids above 2^53)`);\n }\n continue;\n }\n if (item.fields !== undefined) {\n if (!Array.isArray(item.fields) || item.fields.some((f) => typeof f !== 'string')) {\n problems.push(`${at}.fields: must be an array of exact vendor field names (discover them via ${resourceKey}.getFieldInfo)`);\n continue;\n }\n for (const f of item.fields) {\n if (!fields.includes(f)) {\n problems.push(\n `${at}.fields: \"${f}\" is not a field of ${resourceKey} — a hallucinated field is a shape error, not a silent projection-miss (exact vendor field names via ${resourceKey}.getFieldInfo)`,\n );\n }\n }\n }\n }\n if (problems.length > 0) {\n throw new AutotaskConfigError(\n `fetchMany: ${problems.length} problem(s) found pre-request (zero wire was issued)\\n- ` + problems.join('\\n- '),\n { suggestedAction: 'Fix every item above and call again — validation covers the whole batch up-front (one round, zero wire).' },\n );\n }\n}\n\n/** Project a fetched record to the requested fields (best-effort: a vendor\n * partial record may omit a validated key; validated keys absent from the\n * record are simply not present in the projection). */\nfunction project(value: Record<string, unknown>, fields: readonly string[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const f of fields) {\n if (f in value) out[f] = value[f];\n }\n return out;\n}\n\n/**\n * Fetch up to 20 single records across mixed resources in ONE call\n * (sequential GETs; per-item typed partial failure; the op throws only\n * pre-request).\n *\n * ```ts\n * import { fetchMany } from 'node-autotask/operations';\n * const { results, ok, failed } = await fetchMany(client, [\n * { resource: 'tickets', id: 527119 },\n * { resource: 'tickets', id: 527118, fields: ['id', 'title', 'status'] },\n * { resource: 'projects', id: 693 },\n * ]);\n * ```\n */\nexport async function fetchMany(\n client: AutotaskClient,\n items: readonly FetchManyItem[],\n opts: FetchManyOptions = {},\n): Promise<FetchManyResult> {\n if (opts.maxItems !== undefined) {\n if (!Number.isInteger(opts.maxItems) || opts.maxItems < 1) {\n throw new AutotaskConfigError(`fetchMany: maxItems must be an integer >= 1 (got ${String(opts.maxItems)})`);\n }\n }\n const cap = Math.min(FETCH_MANY_MAX_ITEMS, opts.maxItems ?? FETCH_MANY_MAX_ITEMS);\n validateFetchManyItems(items, cap);\n\n const results: FetchManyItemResult[] = [];\n for (const item of items) {\n const key = item.resource;\n // Re-canonicalise (validation already proved it passes): the item result\n // reports the CANONICAL id (safe integer, or the exact-digit string).\n const id = parseIdentifier(item.id, `items[${results.length}].id`);\n const holder = (client as unknown as Record<string, { get: (id: Identifier) => Promise<Record<string, unknown>> } | undefined>)[camelKey(key)];\n if (holder === undefined) {\n // Unreachable after validation (the key was checked against MODEL_FIELD_SETS) — fail loudly anyway.\n throw new AutotaskConfigError(`fetchMany: the client exposes no accessor for resource \"${key}\"`, {\n suggestedAction: 'Rebuild the client from the SDK build that ships this registry (the resource set is pinned by the plan).',\n });\n }\n try {\n const value = (await holder.get(id)) as Record<string, unknown>;\n results.push({ resource: key, id, found: true, value: item.fields !== undefined ? project(value, item.fields) : value });\n } catch (err) {\n // A miss or a vendor fault is a PER-ITEM typed result — it never\n // aborts the remaining items (sequential, independent GETs).\n if (err instanceof NotFoundError) {\n results.push({ resource: key, id, found: false, value: null, error: { code: 'NOT_FOUND', message: err.message } });\n } else if (isAutotaskError(err) && err.code !== 'ABORTED') {\n const e: FetchManyItemResult['error'] = { code: err.code, message: err.message };\n if (err.httpStatus !== undefined) e.httpStatus = err.httpStatus;\n results.push({ resource: key, id, found: false, value: null, error: e });\n } else {\n // Not an item-level vendor outcome (an abort, or a non-SDK fault):\n // propagate — swallowing it would fake a partial result.\n throw err;\n }\n }\n }\n const ok = results.filter((r) => r.found).length;\n return { results, ok, failed: results.length - ok };\n}\n","/**\n * `operations.relationshipMap` — the served relationship artifact (S12-B,\n * run mcp-fix-20261003; plan §2.4 pinned shape).\n *\n * Serves the generated `src/relationships.ts` entry (the 5th generated\n * artifact, drift-guarded) for one plan resource: the resource, its parent,\n * its children (each with the scoped-op presence — which of create/query/\n * update/delete exist as registry ops — and its special ops), its natural\n * lookup keys (the searchCovers line + the findBy helpers), its pinned\n * blind-surface stamps, and the zone-verified create required sets + quirks.\n *\n * ZERO wire by construction: the data is the plan-pinned registry artifact —\n * \"what can I attach to a ticket?\" is answered from served data in one call\n * (today: catalog scan + 3-5 autotask_describe calls + relationship\n * re-derivation). The zone facts are zone-specific (the zone label travels\n * with them — never read across zones).\n *\n * The `client` parameter is part of the operations-layer call shape (every\n * helper takes the client first) — it is deliberately UNUSED: this op never\n * issues a request.\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { RELATIONSHIP_MAP, RELATIONSHIP_ZONE, type RelationshipResource } from '../relationships.js';\n\n/**\n * Serve one resource's relationship entry (zero wire).\n *\n * ```ts\n * import { relationshipMap } from 'node-autotask/operations';\n * const map = await relationshipMap(client, 'tickets');\n * // map.children — the scoped child resources with their scoped-op flags\n * // map.blindSurfaces — the pinned typed-sentinel stamps\n * // map.zoneFacts — the zone-verified required sets + quirks\n * ```\n *\n * @param client The wired client (unused — zero wire by construction).\n * @param resourceKey The plan resource key (e.g. `tickets`). Unknown keys\n * throw the typed `RESOURCE_UNKNOWN` (carries the resource\n * count + a pointer to `autotask_catalog` — never a\n * 128-key dump).\n */\nexport async function relationshipMap(client: AutotaskClient, resourceKey: string): Promise<RelationshipResource> {\n void client; // zero wire by construction — the served artifact needs no transport\n if (typeof resourceKey !== 'string' || resourceKey.trim() === '') {\n throw new AutotaskConfigError(\n `relationshipMap: resourceKey must be a non-empty plan resource key string (e.g. 'tickets'; got ${typeof resourceKey === 'string' ? 'a blank string' : typeof resourceKey})`,\n { suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. tickets, companies, configuration_items, ticket_notes.' },\n );\n }\n const key = resourceKey.trim();\n const entry = RELATIONSHIP_MAP[key];\n if (entry === undefined) {\n throw new AutotaskError(\n `relationshipMap: unknown resource \"${key}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${RELATIONSHIP_ZONE.label} (${RELATIONSHIP_ZONE.zone})-verified.`,\n },\n );\n }\n return entry;\n}\n","/**\n * `operations.blindSurfaces` — the served blind-surface inventory (issue\n * #11, wall QoL-01 / B1).\n *\n * Serves the generated `src/relationships.ts` inventory entry (the 116-\n * surface discovery artifact transfer — plan.reachability, drift-guarded by\n * scripts/check-capabilities.mjs clause 14) in ONE ZERO-wire call: per\n * resource the affected read ops, the blind class (the closed 4-set), the\n * unfiltered row count the ww29 discovery sweep observed, the authority op,\n * and the proof level — plus the data-full set, the artifact counts, and\n * the generic + per-resource remedies.\n *\n * The 6 pinned blindSurfaces stamps and their wording are UNCHANGED (the\n * pins stay byte-identical — the pinned trio rides the inventory with the\n * pin's own note text in remedies.byResource); this op is the WIDER\n * discovery set (69 blind / 46 data-full / 1 vendor-500 of the 116\n * query-able surfaces).\n *\n * ZERO wire by construction: the data is the plan-pinned discovery\n * artifact — \"can this user see this table at all?\" is answered from\n * served data (today: one more failed empty query per table).\n *\n * The `client` parameter is part of the operations-layer call shape (every\n * helper takes the client first) — it is deliberately UNUSED: this op never\n * issues a request.\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { BLIND_SURFACE_INVENTORY, RELATIONSHIP_MAP, type BlindSurfaceInventory, type BlindSurfaceRow } from '../relationships.js';\n\n/** The closed blind-class set (the gate clause 14 validates against this). */\nexport type BlindSurfaceKind = 'unowned-blind' | 'fully-blind' | 'unfiltered-blind' | 'unknown';\n\n/** The valid blind classes (served in the typed refusals — deterministic text). */\nexport const BLIND_SURFACE_KINDS: readonly BlindSurfaceKind[] = [\n 'unowned-blind',\n 'fully-blind',\n 'unfiltered-blind',\n 'unknown',\n];\n\n/** The optional filter bag for `operations.blindSurfaces`. */\nexport interface BlindSurfaceOptions {\n /** The plan resource key (e.g. `tickets`) — narrows the row set to that resource. Unknown keys throw the typed `RESOURCE_UNKNOWN`. */\n resource?: string;\n /** The blind class — narrows the row set to one class. Unknown kinds throw the typed `CONFIG_ERROR`. */\n kind?: BlindSurfaceKind;\n}\n\n/**\n * Serve the plan-pinned blind-surface inventory (ZERO wire).\n *\n * ```ts\n * import { blindSurfaces } from 'node-autotask/operations';\n * const inv = await blindSurfaces(client); // all 116 surfaces\n * const t = await blindSurfaces(client, { resource: 'tickets' }); // one resource\n * const b = await blindSurfaces(client, { kind: 'unfiltered-blind' }); // one class\n * // inv.counts — { total: 116, dataFull: 46, blind: 69, pinned: 6 } (always artifact-wide)\n * // inv.dataFull — the resources whose unfiltered reads are safe\n * // inv.remedies — the generic + per-resource (pinned trio) remedy text\n * ```\n *\n * The counts describe the WHOLE pinned artifact regardless of the filter —\n * only `surfaces` narrows (the counts are the drift-pinned discovery fact).\n *\n * @param client The wired client (unused — zero wire by construction).\n * @param opts The optional filter ({ resource?, kind? }).\n */\nexport async function blindSurfaces(client: AutotaskClient, opts?: BlindSurfaceOptions): Promise<BlindSurfaceInventory> {\n void client; // zero wire by construction — the served artifact needs no transport\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError('blindSurfaces: opts must be an object { resource?: string, kind?: BlindSurfaceKind }');\n }\n const inv = BLIND_SURFACE_INVENTORY;\n if (inv === null) {\n // Unreachable in the shipped artifact (the gate pins the block) — fail\n // closed with a deterministic message rather than serving nothing.\n throw new AutotaskConfigError('blindSurfaces: the reachability inventory is absent from the generated artifact — re-run the build');\n }\n let surfaces = inv.surfaces;\n if (opts?.resource !== undefined) {\n const key = typeof opts.resource === 'string' ? opts.resource.trim() : '';\n if (key === '') {\n throw new AutotaskConfigError(\n 'blindSurfaces: opts.resource must be a non-empty plan resource key string (e.g. \\'tickets\\')',\n { suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. tickets, companies, configuration_items.' },\n );\n }\n if (!inv.surfaces.some((row) => row.resource === key)) {\n throw new AutotaskError(\n `blindSurfaces: unknown resource \"${key}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: `Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items). Zone facts served are ${inv.label} (${inv.zone})-verified.`,\n },\n );\n }\n surfaces = surfaces.filter((row) => row.resource === key);\n }\n if (opts?.kind !== undefined) {\n if (!(BLIND_SURFACE_KINDS as readonly string[]).includes(opts.kind)) {\n throw new AutotaskConfigError(\n `blindSurfaces: unknown kind \"${String(opts.kind)}\" — the valid classes are: ${BLIND_SURFACE_KINDS.join(', ')}`,\n { suggestedAction: `Filter with one of: ${BLIND_SURFACE_KINDS.join(', ')} (or omit kind for the full 116-surface inventory).` },\n );\n }\n surfaces = surfaces.filter((row) => row.kind === opts.kind);\n }\n return { ...inv, surfaces };\n}\n\n\n/** Re-export the row type for consumers (the inventory's surface rows). */\nexport type { BlindSurfaceRow };\n","/**\n * `operations.probeReachability` — the bounded, caller-opted, read-only\n * reachability sweep (issue #11, wall QoL-01 / B1).\n *\n * Re-runs the blind-surface discovery live, on THIS tenant: ONE bounded\n * limit-N query per named surface (default 2 rows, 1-2 accepted), a hard\n * wire cap (default 40, REFUSED above 80), and an explicit `confirmProbe:\n * true` (mirroring the write governor's confirm discipline — the op\n * deliberately fans out reads across the tenant, so the act is the\n * caller's). Per-resource failures are recorded on the row (code +\n * message) and NEVER abort the sweep; the result reports `wireUsed` (≤ cap\n * by construction — over-cap requests are refused pre-request, never\n * truncated) and `truncated: false` (refuse-not-truncate is the contract).\n *\n * Read-only by construction: every probe is a bounded `queryBounded` read\n * (one vendor call per surface; no create/update/delete wire). The pinned\n * inventory (operations.blindSurfaces) stays the ww29 discovery artifact —\n * this op is how ANOTHER tenant gets its own answer.\n */\nimport { AutotaskConfigError, AutotaskError, isAutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { BLIND_SURFACE_INVENTORY, REACHABILITY_PROBE_DEFAULTS, type BlindSurfaceRow } from '../relationships.js';\nimport { camelKey } from '../utils/index.js';\n\n/** The optional sweep bag for `operations.probeReachability`. */\nexport interface ProbeReachabilityOptions {\n /** The plan resource keys to probe. Omitted → the 70 non-data-full pinned surfaces (the 69 blind + ticket_history); that set exceeds the default cap, so probing it requires an explicit `maxWireCalls` (≤ 80). */\n resources?: string[];\n /** Rows per surface (1-2; default 2). Out of range → CONFIG_ERROR. */\n limit?: number;\n /** The hard cap for this call (default 40) — it bounds the number of probed surfaces (one bounded read each); transport retries on a probe are not counted against it. Refused above 80; a requested set larger than the cap is refused pre-request (refused, never truncated). */\n maxWireCalls?: number;\n /** REQUIRED. Without it the op refuses with CONFIG_ERROR before any request (the deliberate act is the caller's). */\n confirmProbe?: true;\n}\n\n/**\n * One probe outcome (the pinned row + the live probe result). The pinned\n * fields reuse the GENERATED `BlindSurfaceRow` (the plan's ops/kind/proof\n * unions — a plan change re-derives them here; no hand-duplicated unions\n * that could drift, post-verification F4).\n */\nexport type ProbeSurfaceRow = Omit<BlindSurfaceRow, 'unfilteredRows'> & {\n /** The LIVE observed unfiltered row count (null when the probe failed). */\n unfilteredRows: number | null;\n /** The probe outcome for this surface. */\n probe: {\n ok: boolean;\n /** The bounded reads this probe issued (0 = refused pre-probe, 1 = one bounded read). */\n wire: number;\n /** The recorded failure (never thrown; the sweep keeps going). */\n error: { code: string; message: string } | null;\n };\n}\n\n/** The sweep result. */\nexport interface ProbeReachabilityResult {\n results: ProbeSurfaceRow[];\n /**\n * The bounded probe reads actually issued — one per probed surface, so it\n * can never exceed `cap` (the cap bounds the SURFACE SET; transport\n * retries inside a probe are additional wire and are not counted — the\n * raw wire total can therefore exceed `cap` slightly).\n */\n wireUsed: number;\n /** The wire cap the call ran under. */\n cap: number;\n /** Always false: over-cap requests REFUSE (CONFIG_ERROR) — they are never silently truncated. */\n truncated: boolean;\n}\n\n/**\n * Run the bounded reachability sweep (caller-opted, read-only).\n *\n * ```ts\n * import { probeReachability } from 'node-autotask/operations';\n * const res = await probeReachability(client, {\n * resources: ['contacts', 'resources', 'companies'],\n * limit: 2, // 1-2, default 2\n * maxWireCalls: 40, // default 40, refused above 80\n * confirmProbe: true, // REQUIRED\n * });\n * // res.wireUsed — the probes issued (≤ cap); res.results — one row per\n * // requested surface (probe.ok false + probe.error where one failed)\n * ```\n *\n * @param client The wired client (the probes issue bounded queryBounded reads).\n * @param opts The sweep bag ({ resources?, limit?, maxWireCalls?, confirmProbe? }).\n */\nexport async function probeReachability(\n client: AutotaskClient,\n opts?: ProbeReachabilityOptions,\n): Promise<ProbeReachabilityResult> {\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError('probeReachability: opts must be an object { resources?: string[], limit?: 1|2, maxWireCalls?: number, confirmProbe?: true }');\n }\n const defs = REACHABILITY_PROBE_DEFAULTS;\n // --- the deliberate act: confirmProbe is REQUIRED (pre-request, zero wire)\n if (opts?.confirmProbe !== true) {\n throw new AutotaskConfigError(\n 'probeReachability: confirmProbe: true is required — the op deliberately fans out read wire across the tenant (one bounded query per surface); pass confirmProbe: true to run it',\n { suggestedAction: `Re-call with { confirmProbe: true } (plus resources/limit/maxWireCalls as needed). For the ZERO-wire pinned inventory use operations.blindSurfaces.` },\n );\n }\n // --- the limit bounds (1-2; pre-request, zero wire)\n const limit = opts?.limit ?? defs.limitDefault;\n if (!Number.isInteger(limit) || limit < 1 || limit > defs.limitMax) {\n throw new AutotaskConfigError(\n `probeReachability: limit must be an integer 1..${defs.limitMax} (got ${String(limit)}) — the rows-per-surface bound for the discovery read`,\n );\n }\n // --- the wire cap (default 40; refused above the hard cap of 80)\n const cap = opts?.maxWireCalls ?? defs.defaultCap;\n if (!Number.isInteger(cap) || cap < 1) {\n throw new AutotaskConfigError(`probeReachability: maxWireCalls must be a positive integer (got ${String(cap)})`);\n }\n if (cap > defs.hardCap) {\n throw new AutotaskConfigError(\n `probeReachability: maxWireCalls ${cap} exceeds the hard wire cap of ${defs.hardCap} — the sweep is refused above it (never capped silently)`,\n { suggestedAction: `Pass maxWireCalls ≤ ${defs.hardCap} and a resources set no larger than the cap (the refused set is never truncated).` },\n );\n }\n // --- the target set (explicit resources, or the derived default set)\n const inv = BLIND_SURFACE_INVENTORY;\n if (inv === null) {\n throw new AutotaskConfigError('probeReachability: the reachability inventory is absent from the generated artifact — re-run the build');\n }\n let targets: string[];\n if (opts?.resources === undefined) {\n targets = [...defs.defaultTargets];\n } else {\n if (!Array.isArray(opts.resources) || opts.resources.length === 0) {\n throw new AutotaskConfigError('probeReachability: opts.resources must be a non-empty string[] of plan resource keys (or omit it for the default non-data-full set)');\n }\n const seen = new Set<string>();\n for (const r of opts.resources) {\n if (typeof r !== 'string' || r.trim() === '') {\n throw new AutotaskConfigError(`probeReachability: opts.resources must contain non-empty plan resource key strings (got ${typeof r === 'string' && r.trim() === '' ? 'a blank string' : typeof r})`);\n }\n const key = r.trim();\n if (!inv.surfaces.some((row) => row.resource === key)) {\n const surfaceCount = new Set(inv.surfaces.map((s) => s.resource)).size;\n throw new AutotaskError(\n `probeReachability: unknown resource \"${key}\" — the inventory has ${surfaceCount} surfaces`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items).',\n },\n );\n }\n seen.add(key);\n }\n targets = [...seen];\n }\n if (targets.length > cap) {\n throw new AutotaskConfigError(\n `probeReachability: ${targets.length} requested surface(s) exceed the wire cap of ${cap} — the sweep is refused above its cap (never truncated)`,\n { suggestedAction: `Raise maxWireCalls (≤ ${defs.hardCap}) to cover the set, or pass a smaller resources list.` },\n );\n }\n // --- the sweep (sequential bounded reads; per-surface failures recorded)\n const byResource = new Map(inv.surfaces.map((row) => [row.resource, row]));\n const results: ProbeSurfaceRow[] = [];\n for (const resource of targets.sort()) {\n const row = byResource.get(resource);\n if (row === undefined) continue; // unreachable: validated above\n const holder = (client as unknown as Record<string, unknown>)[camelKey(resource)] as\n | { queryBounded?: (params?: { filter?: unknown; limit?: number; includeFields?: string[] }) => Promise<{ items: unknown[] }> }\n | undefined;\n const probeFn = holder?.queryBounded;\n if (typeof probeFn !== 'function') {\n results.push({\n ...row,\n unfilteredRows: null,\n probe: { ok: false, wire: 0, error: { code: 'RESOURCE_NO_QUERY_OP', message: `no queryBounded read exists on the client accessor for \"${resource}\" — nothing was probed` } },\n });\n continue;\n }\n try {\n const res = await probeFn.call(holder, { limit });\n // The probe reads ONE page (limit ≤ 2): reachability is\n // items.length > 0 — `hasMore` is intentionally NOT followed (a probe\n // that walked pages would turn a bounded read into a sweep).\n const items = Array.isArray(res?.items) ? res.items : [];\n results.push({\n ...row,\n unfilteredRows: items.length,\n probe: { ok: true, wire: 1, error: null },\n });\n } catch (err) {\n const code = isAutotaskError(err) ? err.code : 'NETWORK_ERROR';\n const message = err instanceof Error ? err.message : String(err);\n results.push({\n ...row,\n unfilteredRows: null,\n probe: { ok: false, wire: 1, error: { code, message } },\n });\n }\n }\n // Single source (post-verification N1): the per-row wire counts ARE the\n // total (0 = refused pre-probe / no query op, 1 = one bounded read).\n const wireUsed = results.reduce((n, r) => n + r.probe.wire, 0);\n return { results, wireUsed, cap, truncated: false };\n}\n","/**\n * `operations.createGuidance` — the zone-fact create-guidance catalog\n * (issue #12, wall QoL-03).\n *\n * Serves the WIDENED zone facts ZERO-wire: the 92 campaign-decoded create\n * entities of the stage-11 apply-matrix (marker FULL100W-1791110339, ww29) —\n * per resource the correct create op, the live-proven required-field prefix\n * (vendor-demand order), whether the create still failed after it (unproven),\n * the structured blocker (the wall class + the remedy), the EXACT vendor\n * message text observed (never paraphrased), and the spec-derived delete\n * boundary (the W-A1 field on the same row). The discovery cost was already\n * paid by the write campaign (461 classified write requests); this op is how\n * a caller gets that answer without paying it again.\n *\n * The relationship map keeps serving its existing `zoneFacts` shape (the 11\n * hand-authored entries keep their createRequiredSet/quirks byte-for-byte) —\n * the per-resource `createGuidance` plan field is additive, and THIS op is\n * the wider served view (one row per plan create op).\n */\nimport { AutotaskConfigError, AutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport {\n CREATE_GUIDANCE,\n type CreateBlockerKind,\n type CreateGuidanceReport,\n type CreateGuidanceRow,\n} from '../relationships.js';\n\n/** The closed blocker-kind set (the gate re-derives it; unknown kind → CONFIG_ERROR). */\n/**\n * The closed blocker-kind set served by `operations.createGuidance`.\n * Superset of issue #12's 8-value enumeration: the campaign decode produced\n * 14 rows that matched no named blocker (wall-adjacent create shapes with\n * verbatim vendor evidence) — the closed set gained `'unknown'` (9 kinds)\n * rather than forcing those rows into a misfitting class.\n */\nexport const CREATE_BLOCKER_KINDS: readonly CreateBlockerKind[] = [\n 'ok',\n 'blind-reference',\n 'blind-parent',\n 'picklist-unexposed',\n 'undocumented-ladder',\n 'resource-role-pair',\n 'delete-absent',\n 'non-mutable',\n 'unknown',\n] as const;\n\n/** The optional filter bag for `operations.createGuidance`. */\nexport interface CreateGuidanceOptions {\n /** The plan resource keys — narrows the row set. Unknown key → typed RESOURCE_UNKNOWN (zero wire). */\n resources?: string[];\n /** Narrows to one blocker kind. Unknown kind → typed CONFIG_ERROR naming the valid kinds (zero wire). */\n kind?: CreateBlockerKind;\n}\n\n/**\n * Serve the zone-fact create-guidance catalog (zero wire).\n *\n * ```ts\n * import { createGuidance } from 'node-autotask/operations';\n * const rep = await createGuidance(client, { resources: ['tickets', 'projects'] });\n * // rep.rows — one row per named resource: the create op, the live-proven\n * // prefix, the blocker (wall class + remedy), the exact vendor text, the\n * // delete boundary. rep.counts describe the WHOLE pinned catalog.\n * ```\n *\n * @param client The wired client (unused — the served data is plan-pinned; the parameter exists so the op rides the invoke holder like every other operation).\n * @param opts The optional filter bag ({ resources?, kind? }).\n */\nexport async function createGuidance(\n client: AutotaskClient,\n opts?: CreateGuidanceOptions,\n): Promise<CreateGuidanceReport> {\n void client; // zero wire by construction — the data is the plan-pinned artifact\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError(\n 'createGuidance: opts must be an object { resources?: string[], kind?: CreateBlockerKind }',\n );\n }\n let rows: CreateGuidanceRow[] = CREATE_GUIDANCE.rows;\n // --- the resource filter (narrow only; unknown keys refuse zero-wire)\n if (opts?.resources !== undefined) {\n if (!Array.isArray(opts.resources) || opts.resources.length === 0) {\n throw new AutotaskConfigError('createGuidance: opts.resources must be a non-empty string[] of plan resource keys');\n }\n const wanted = new Set<string>();\n for (const r of opts.resources) {\n if (typeof r !== 'string' || r.trim() === '') {\n throw new AutotaskConfigError('createGuidance: opts.resources must contain non-empty plan resource key strings');\n }\n const key = r.trim();\n if (!CREATE_GUIDANCE.rows.some((row) => row.resource === key)) {\n throw new AutotaskError(\n `createGuidance: unknown resource \"${key}\" — the catalog has ${CREATE_GUIDANCE.rows.length} create entities`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, projects, opportunities).',\n },\n );\n }\n wanted.add(key);\n }\n rows = rows.filter((row) => wanted.has(row.resource));\n }\n // --- the kind filter (closed 9-set; unknown kinds refuse zero-wire)\n if (opts?.kind !== undefined) {\n if (!CREATE_BLOCKER_KINDS.includes(opts.kind)) {\n throw new AutotaskConfigError(\n `createGuidance: unknown kind \"${String(opts.kind)}\" — the valid kinds are: ${CREATE_BLOCKER_KINDS.join(', ')}`,\n );\n }\n rows = rows.filter((row) => row.blocker?.kind === opts.kind);\n }\n // the counts describe the WHOLE pinned catalog regardless of the filter\n return {\n zone: CREATE_GUIDANCE.zone,\n label: CREATE_GUIDANCE.label,\n verifiedAt: CREATE_GUIDANCE.verifiedAt,\n rows,\n counts: CREATE_GUIDANCE.counts,\n };\n}\n","/**\n * `operations.fieldCatalog` — the opt-in LIVE field-metadata channel\n * (issue #31).\n *\n * Fetches the vendor's field catalog on demand: one bounded\n * entityInformation GET per named resource × included kind (`fields` by\n * default), hard-capped (REFUSED, never truncated — the\n * `probeReachability` contract applied to a small fan-out), with\n * per-resource failure isolation (one vendor 500 is recorded on the row\n * and the sweep continues). With the opt-in `fieldCache` configured, the\n * reads go through the shared FieldCache (TTL + in-flight de-dup + drift\n * invalidation); without it the wire path is the plain uncached trio.\n *\n * Capability is PLAN-DERIVED, never hardcoded: which resources carry a\n * field catalog (`getFieldInfo` row existence), which are UDF-capable\n * (`getUdfInfo` row existence), and each resource's `apiEntity` (the\n * getFieldInfo endpoint segment) all come from the generated registry\n * (capabilities.ts, from capabilities.plan.json). The default resource\n * set is the FIVE workflow resources (WORKFLOW_RESOURCES) — never the\n * full 121: a default that fans out 121 wire calls is not \"on demand\".\n *\n * Honest scope (stated in the served text AND the result): the live\n * catalog reports a field's SHAPE (existence, requiredness, type,\n * maxLength, read-only, queryable, picklist-ness) and serves picklist\n * VALUES where the vendor exposes them. It CANNOT resolve a picklist\n * VALUE the vendor does not expose to this API user (the W-A4 wall) —\n * retrying the catalog will not surface a withheld value.\n *\n * Zero mutating wire by construction: every fetch is a GET on the\n * entityInformation trio.\n */\nimport { AutotaskConfigError, AutotaskError, isAutotaskError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { CAPABILITIES, type CapabilityRecord } from '../capabilities.js';\nimport { FIELD_CACHE_KINDS, type FieldCacheKind } from '../fieldCache.js';\nimport { camelKey } from '../utils/index.js';\nimport { WORKFLOW_RESOURCES } from './types.js';\n\n/** The pinned wire cap: `resources × include` above it is refused\n * pre-request (CONFIG_ERROR naming the computed cost and the cap) —\n * refused, never truncated. */\nexport const MAX_FIELD_CATALOG_WIRE = 60;\n\n/** The stable honesty sentence served in the result (W-A4: the live\n * catalog reports field SHAPE; it cannot resolve a picklist VALUE the\n * vendor does not expose to this API user — where values ARE exposed,\n * they are served). */\nexport const FIELD_CATALOG_HONESTY_NOTE =\n 'Live field metadata reports the SHAPE of a field (existence, requiredness, type, maxLength, read-only, queryable, picklist-ness) and serves picklist VALUES where the vendor exposes them. ' +\n 'It cannot resolve a picklist VALUE the vendor does not expose to this API user (the W-A4 wall — e.g. the attachments Type picklist): retrying the catalog will not surface a withheld value; that gap is vendor-side, not a client defect.';\n\n/** One projected field row (the stable, small served shape — not the raw\n * vendor blob; the raw one stays available through the resource's own\n * `getFieldInfo` / `getUdfInfo` op). */\nexport interface FieldCatalogFieldRow {\n /** The vendor field name. */\n name: string;\n /** The display label (UDF catalog rows only; vendor standard fields carry none). */\n label?: string;\n /** The vendor field type (`dataType` on standard fields, `type` on UDFs). */\n type: string;\n isRequired: boolean;\n isReadOnly: boolean;\n isQueryable: boolean;\n isPickList: boolean;\n /** The vendor `length` bound (null when the catalog names none). */\n maxLength: number | null;\n /** The referenced entity type for reference fields ('' when none). */\n referenceEntityType: string;\n}\n\n/** One per-resource fault (partial failures are typed PER ROW — never all-or-nothing). */\nexport interface FieldCatalogRowError {\n code: string;\n message: string;\n}\n\n/** One resource's catalog row. */\nexport interface FieldCatalogRow {\n /** The plan resource key. */\n resource: string;\n /** The vendor entity name (the path segment; plan-derived). */\n apiEntity: string;\n /** True when the plan carries a `getUdfInfo` row for the resource (the vendor defines a UDF catalog endpoint for every entity resource — the catalog may answer an empty list). */\n udfCapable: boolean;\n /** The entity information model (present exactly when `info` was included and fetched). */\n info?: Record<string, unknown> | null;\n /** The projected standard-field catalog (present exactly when `fields` was included and fetched). */\n fields?: FieldCatalogFieldRow[];\n /** The projected UDF catalog (present exactly when `udf` was included and fetched). */\n udf?: FieldCatalogFieldRow[] | null;\n /** `isRequired === true` names, in catalog order (the `fields` catalog). */\n required: string[];\n /** `isReadOnly === true` names, in catalog order. */\n readOnly: string[];\n /** `isQueryable === true` names, in catalog order. */\n queryable: string[];\n /** `isPickList === true` names, in catalog order — NAMES only (see `honesty`: the VALUES may be vendor-walled). */\n picklistFields: string[];\n /** The FieldCache state for this row: `hit` = every included kind was served from the cache (no wire for the row); `age` = the oldest entry's age in ms (null when `hit` is false). */\n cache: { hit: boolean; age: number | null };\n /** The metadata reads this row issued (0 = fully cached; one per included kind otherwise — in-flight de-dup may make the actual wire smaller than this). */\n wire: number;\n /** The first per-kind failure (code + message); the sweep keeps going. */\n error: FieldCatalogRowError | null;\n}\n\n/** The sweep result. */\nexport interface FieldCatalogResult {\n /** The resolved client zone ('unknown' for a bare explicit baseUrl). */\n zone: string;\n /** The zone label (a live op has no plan-pinned tenant label — it mirrors `zone`). */\n label: string;\n /** Whether a FieldCache was configured at all. */\n cached: boolean;\n /** The configured TTL (null when no cache). */\n ttlMs: number | null;\n /** The call instant (ISO). */\n fetchedAt: string;\n /** One row per requested resource, in request order. */\n rows: FieldCatalogRow[];\n /** The metadata reads actually issued across the call (≤ `cap` by construction). */\n wireUsed: number;\n /** The wire cap the call ran under. */\n cap: number;\n /** Always false: over-cap requests REFUSE (CONFIG_ERROR) — they are never silently truncated. */\n truncated: false;\n counts: {\n /** The requested (deduplicated) resource count. */\n resources: number;\n /** The plan's `getFieldInfo`-bearing resource count (the field-capable set). */\n fieldCapableResources: number;\n /** The plan's `getUdfInfo`-bearing resource count (the vendor defines a UDF catalog endpoint for these; the narrower plan `udfCapable` flag — entities that actually carry UDFs — is a subset). */\n udfCapableResources: number;\n /** The rows served fully from the cache. */\n cached: number;\n };\n /** The honest scope: what the live catalog can and cannot report. */\n honesty: {\n /** 'partial' when any served row carries picklist VALUES the vendor exposed; 'unexposed' otherwise. */\n picklistValues: 'unexposed' | 'partial';\n note: string;\n };\n}\n\n/** The optional call bag for `operations.fieldCatalog` (closed: unknown keys refuse). */\nexport interface FieldCatalogOptions {\n /** The plan resource keys to read. Omitted → the five workflow resources (never the full set — an on-demand op must not fan out 121 wire calls by default). */\n resources?: string[];\n /** What to fetch per resource (closed set `info` | `fields` | `udf`; default `['fields']`). */\n include?: FieldCacheKind[];\n /** Bypass the fieldCache for this call (fetch live, refresh the entries). Default false. */\n fresh?: boolean;\n}\n\nconst FIELD_CATALOG_OPT_KEYS: readonly string[] = ['resources', 'include', 'fresh'];\n\n/** Project one raw vendor field entry (standard `FieldInformationModel`\n * or UDF `Field`) to the stable served shape. */\nfunction projectFieldRow(raw: unknown): FieldCatalogFieldRow {\n const r = (typeof raw === 'object' && raw !== null ? raw : {}) as Record<string, unknown>;\n const name = typeof r.name === 'string' ? r.name : '';\n const type = typeof r.dataType === 'string' ? r.dataType : typeof r.type === 'string' ? r.type : '';\n return {\n name,\n ...(typeof r.label === 'string' && r.label !== '' ? { label: r.label } : {}),\n type,\n isRequired: r.isRequired === true,\n isReadOnly: r.isReadOnly === true,\n isQueryable: r.isQueryable === true,\n isPickList: r.isPickList === true,\n maxLength: typeof r.length === 'number' ? r.length : null,\n referenceEntityType: typeof r.referenceEntityType === 'string' ? r.referenceEntityType : '',\n };\n}\n\n/** True when the raw vendor row carries picklist VALUES the vendor exposed. */\nfunction exposesPicklistValues(raw: unknown): boolean {\n const r = (typeof raw === 'object' && raw !== null ? raw : {}) as Record<string, unknown>;\n return Array.isArray(r.picklistValues) && r.picklistValues.length > 0;\n}\n\n/**\n * The plan-derived capability set (never hardcoded): the\n * `getFieldInfo` / `getUdfInfo` registry rows are the capability\n * evidence; the getFieldInfo endpoint segment is the vendor `apiEntity`.\n */\nfunction capabilitySets() {\n const fieldOps = new Map<string, CapabilityRecord>();\n const udfOps = new Map<string, CapabilityRecord>();\n const resources = new Set<string>();\n for (const rec of CAPABILITIES) {\n if (rec.resource === 'operations') continue;\n resources.add(rec.resource);\n if (rec.operation === 'getFieldInfo') fieldOps.set(rec.resource, rec);\n if (rec.operation === 'getUdfInfo') udfOps.set(rec.resource, rec);\n }\n return { fieldOps, udfOps, resources };\n}\n\n/** The vendor `apiEntity` (the `/V1.0/<E>/entityInformation/fields` segment), plan-derived. */\nfunction apiEntityFor(rec: CapabilityRecord): string {\n const m = /^GET \\/V1\\.0\\/([^/]+)\\/entityInformation\\/fields$/.exec(rec.endpoint ?? '');\n if (m === null) {\n throw new AutotaskConfigError(\n `fieldCatalog: the plan's getFieldInfo endpoint for \"${rec.resource}\" has no /V1.0/<Entity>/entityInformation/fields shape (${rec.endpoint}) — plan defect`,\n { operation: 'operations.fieldCatalog' },\n );\n }\n return m[1]!;\n}\n\n/**\n * Run the bounded live field-metadata sweep.\n *\n * ```ts\n * import { fieldCatalog } from 'node-autotask/operations';\n * const res = await fieldCatalog(client); // the 5 workflow resources, fields only\n * const fresh = await fieldCatalog(client, { resources: ['tickets'], include: ['fields', 'udf'], fresh: true });\n * ```\n *\n * @param client The wired client (the reads issue entityInformation GETs).\n * @param opts The call bag ({ resources?, include?, fresh? }).\n */\nexport async function fieldCatalog(\n client: AutotaskClient,\n opts?: FieldCatalogOptions,\n): Promise<FieldCatalogResult> {\n if (opts !== undefined && (typeof opts !== 'object' || opts === null || Array.isArray(opts))) {\n throw new AutotaskConfigError(\n 'fieldCatalog: opts must be an object { resources?: string[], include?: (info|fields|udf)[], fresh?: boolean }',\n );\n }\n for (const key of Object.keys(opts ?? {})) {\n if (!FIELD_CATALOG_OPT_KEYS.includes(key)) {\n throw new AutotaskConfigError(\n `fieldCatalog: unknown opts key \"${key}\" — the bag is closed: ${FIELD_CATALOG_OPT_KEYS.join(', ')}`,\n { suggestedAction: 'Drop the unknown key (autotask_describe(operations.fieldCatalog) shows the exact bag).' },\n );\n }\n }\n\n const { fieldOps, udfOps, resources: allResources } = capabilitySets();\n\n // --- include: the closed kind set (pre-request, zero wire)\n const includeRaw = opts?.include ?? ['fields'];\n if (!Array.isArray(includeRaw) || includeRaw.length === 0) {\n throw new AutotaskConfigError('fieldCatalog: opts.include must be a non-empty array of (info|fields|udf)');\n }\n const include: FieldCacheKind[] = [];\n for (const kind of includeRaw) {\n if (typeof kind !== 'string' || !FIELD_CACHE_KINDS.includes(kind as FieldCacheKind)) {\n throw new AutotaskConfigError(\n `fieldCatalog: unknown include kind \"${String(kind)}\" — the valid kinds are: ${FIELD_CACHE_KINDS.join(', ')}`,\n { suggestedAction: `Filter with one or more of: ${FIELD_CACHE_KINDS.join(', ')} (default ['fields']).` },\n );\n }\n if (!include.includes(kind as FieldCacheKind)) include.push(kind as FieldCacheKind);\n }\n\n // --- resources: default the five workflow resources (never the full set)\n const resourcesRaw = opts?.resources ?? WORKFLOW_RESOURCES;\n if (!Array.isArray(resourcesRaw) || resourcesRaw.length === 0) {\n throw new AutotaskConfigError('fieldCatalog: opts.resources must be a non-empty array of plan resource keys');\n }\n const targets: string[] = [];\n for (const r of resourcesRaw) {\n if (typeof r !== 'string' || r.trim() === '') {\n throw new AutotaskConfigError(\n `fieldCatalog: opts.resources must contain non-empty plan resource key strings (got ${typeof r === 'string' && r.trim() === '' ? 'a blank string' : typeof r})`,\n );\n }\n const key = r.trim();\n const fieldOp = fieldOps.get(key);\n if (fieldOp === undefined) {\n if (allResources.has(key)) {\n // a known plan resource without a field catalog (the integration\n // singletons) — fail closed, name the boundary\n throw new AutotaskConfigError(\n `fieldCatalog: resource \"${key}\" has no field catalog — the vendor defines the entityInformation trio for the ${fieldOps.size} plan entity resources only`,\n { suggestedAction: `Pass one of the ${fieldOps.size} field-capable plan keys (list them with autotask_catalog).` },\n );\n }\n throw new AutotaskError(\n `fieldCatalog: unknown resource \"${key}\" — the plan has ${fieldOps.size} field-capable resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n suggestedAction: 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items).',\n },\n );\n }\n if (!targets.includes(key)) targets.push(key);\n }\n\n // --- the cap: refused, never truncated (pre-request, zero wire)\n const cost = targets.length * include.length;\n if (cost > MAX_FIELD_CATALOG_WIRE) {\n throw new AutotaskConfigError(\n `fieldCatalog: ${targets.length} resource(s) × ${include.length} kind(s) = ${cost} metadata reads exceed the wire cap of ${MAX_FIELD_CATALOG_WIRE} — the call is refused above its cap (never truncated)`,\n { suggestedAction: `Pass a smaller resources list or a narrower include set so the product stays ≤ ${MAX_FIELD_CATALOG_WIRE}.` },\n );\n }\n\n const cache = client.http.fieldCache;\n const fresh = opts?.fresh === true;\n const zone = client.config.zone ?? 'unknown';\n const rows: FieldCatalogRow[] = [];\n let wireUsed = 0;\n let anyPicklistValues = false;\n\n // The sweep (sequential bounded reads; per-kind failures recorded —\n // one entity's vendor 500 never aborts the call, the probeReachability\n // contract).\n for (const resource of targets) {\n const fieldOp = fieldOps.get(resource);\n if (fieldOp === undefined) continue; // unreachable: validated above\n const apiEntity = apiEntityFor(fieldOp);\n const holder = (client as unknown as Record<string, unknown>)[camelKey(resource)] as\n | {\n getEntityInfo?: () => Promise<unknown>;\n getFieldInfo?: () => Promise<unknown>;\n getUdfInfo?: () => Promise<unknown>;\n }\n | undefined;\n const row: FieldCatalogRow = {\n resource,\n apiEntity,\n udfCapable: udfOps.has(resource),\n required: [],\n readOnly: [],\n queryable: [],\n picklistFields: [],\n cache: { hit: false, age: null },\n wire: 0,\n error: null,\n };\n\n const fetches: Record<FieldCacheKind, () => Promise<unknown>> = {\n info: () => holder?.getEntityInfo?.() ?? Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getEntityInfo read for \"${resource}\"`, { code: 'INVALID_RESPONSE', category: 'server' })),\n fields: () => holder?.getFieldInfo?.() ?? Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getFieldInfo read for \"${resource}\"`, { code: 'INVALID_RESPONSE', category: 'server' })),\n udf: () => (holder?.getUdfInfo?.() ?? Promise.reject(new AutotaskError(`fieldCatalog: the client exposes no getUdfInfo read for \"${resource}\"`, { code: 'INVALID_RESPONSE', category: 'server' }))),\n };\n\n // fresh: the caller's act — drop the entity's entries (and any in-flight\n // request) BEFORE the sweep, so every included kind fetches live and\n // refreshes its entry. The trio methods keep their no-arg surface; the\n // bypass rides the cache's first-class invalidate API.\n if (fresh) cache?.invalidate(resource);\n\n let allCached = true;\n const ages: number[] = [];\n for (const kind of include) {\n // The cache state (pre-fetch): a full hit skips the wire entirely.\n const peek = cache !== undefined && !fresh ? cache.peek(resource, kind) : { hit: false, age: null };\n if (peek.hit !== true) allCached = false;\n if (peek.hit === true && cache !== undefined) {\n const value = cache.get(resource, kind);\n if (kind === 'info') row.info = (value ?? null) as Record<string, unknown> | null;\n else {\n const list = Array.isArray(value) ? value : [];\n const projected = list.map((f) => projectFieldRow(f));\n if (kind === 'fields') row.fields = projected;\n else row.udf = projected;\n for (const f of list) if (exposesPicklistValues(f)) anyPicklistValues = true;\n if (kind === 'fields') {\n row.required = projected.filter((f) => f.isRequired).map((f) => f.name);\n row.readOnly = projected.filter((f) => f.isReadOnly).map((f) => f.name);\n row.queryable = projected.filter((f) => f.isQueryable).map((f) => f.name);\n row.picklistFields = projected.filter((f) => f.isPickList).map((f) => f.name);\n }\n }\n if (peek.age !== null) ages.push(peek.age);\n continue;\n }\n // A wire read (one per included kind); a failure lands on the row.\n let value: unknown;\n try {\n value = await fetches[kind]();\n } catch (err) {\n wireUsed += 1;\n row.wire += 1;\n if (row.error === null) {\n const code = isAutotaskError(err) ? err.code : 'NETWORK_ERROR';\n const message = err instanceof Error ? err.message : String(err);\n row.error = { code, message };\n }\n continue;\n }\n wireUsed += 1;\n row.wire += 1;\n if (kind === 'info') {\n row.info = (value ?? null) as Record<string, unknown> | null;\n } else {\n const list = Array.isArray(value) ? value : [];\n const projected = list.map((f) => projectFieldRow(f));\n if (kind === 'fields') row.fields = projected;\n else row.udf = projected;\n for (const f of list) if (exposesPicklistValues(f)) anyPicklistValues = true;\n if (kind === 'fields') {\n row.required = projected.filter((f) => f.isRequired).map((f) => f.name);\n row.readOnly = projected.filter((f) => f.isReadOnly).map((f) => f.name);\n row.queryable = projected.filter((f) => f.isQueryable).map((f) => f.name);\n row.picklistFields = projected.filter((f) => f.isPickList).map((f) => f.name);\n }\n }\n }\n row.cache = allCached ? { hit: true, age: ages.length > 0 ? Math.max(...ages) : 0 } : { hit: false, age: null };\n rows.push(row);\n }\n\n return {\n zone,\n label: zone,\n cached: cache !== undefined,\n ttlMs: cache?.ttlMs ?? null,\n fetchedAt: new Date().toISOString(),\n rows,\n wireUsed,\n cap: MAX_FIELD_CATALOG_WIRE,\n truncated: false,\n counts: {\n resources: targets.length,\n fieldCapableResources: fieldOps.size,\n udfCapableResources: udfOps.size,\n cached: rows.filter((r) => r.cache.hit === true).length,\n },\n honesty: {\n picklistValues: anyPicklistValues ? 'partial' : 'unexposed',\n note: FIELD_CATALOG_HONESTY_NOTE,\n },\n };\n}\n","/**\n * `operations.recovery` — the one-call recovery/cleanup op (issue #9, wall\n * W-A1 / P1).\n *\n * The delete-boundary reality (the spec-derived audit in\n * scripts/lib/delete-boundary.mjs, plan.deleteBoundaries): the vendored spec\n * defines NO DELETE on many entity paths — most of them the campaign's own\n * resources. A `create` that cannot be undone through the API leaves the\n * created record as permanent residue once its id is lost. This op is the\n * typed one-call path out:\n *\n * - `find` (the default — a READ): ONE bounded marker-filtered query\n * (server-side pagination, zero mutating wire) returns the matched\n * records' ids + the delete-boundary fact + the UI-only cleanup note.\n * - `delete` (destructive, dry-run-first): the dry run performs the search\n * and reports the match set with ZERO DELETE wire; the apply requires the\n * exact confirm string (`RECOVERY_CONFIRM`) and issues one DELETE per\n * safe match id + one verification read per id.\n *\n * Pinned semantics (the P1 discipline — never a silent failure mode):\n * - the boundary is KNOWN LOCALLY (the spec audit): a delete on a\n * delete-less resource refuses PRE-SEARCH with the typed `DELETE_BOUNDARY`\n * (zero wire) — never a raw vendor 405;\n * - a match whose id is NOT representable as a safe JS integer (beyond\n * Number.MAX_SAFE_INTEGER) is NEVER a silent skip: `delete` refuses with\n * the typed `MARKER_UNSAFE_ID` (zero DELETE wire); `find` marks the match\n * `id: null` + `unsafeId: true` so the caller sees the unaddressable\n * record (and the UI-only cleanup note);\n * - a bounded search that TRIPS the match cap (more matches than `limit`)\n * refuses with the typed `RECOVERY_TRUNCATED` — never a silent\n * truncation, never a silent empty;\n * - an unknown `resource` refuses PRE-REQUEST with the typed\n * `RESOURCE_UNKNOWN` (the same code `operations.relationshipMap` uses:\n * carries the resource count + the `autotask_catalog` pointer — never a\n * 128-key dump).\n *\n * The marker search is a `contains` filter on the name-like field the write\n * stamped (default: the plan's `markerField` for the resource — the\n * spec-derived deterministic priority over the vendored model's field set;\n * pass `field` to override, or it is required when the resource has no\n * markerField). The search itself is a plain bounded query on the resource's\n * own surface (the governor's bounded-scan discipline applies — the walk\n * stops at `limit`, never scans unbounded).\n */\nimport {\n AutotaskConfigError,\n AutotaskError,\n ConfirmationRequiredError,\n DeleteBoundaryError,\n isAutotaskError,\n MarkerUnsafeIdError,\n NotFoundError,\n RecoveryTruncatedError,\n} from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey, isRecord } from '../utils/index.js';\nimport { DELETE_BOUNDARY_NOTES, MARKER_FIELDS, RELATIONSHIP_MAP } from '../relationships.js';\nimport type { FilterCondition } from '../types/common.js';\n\n/** The exact confirmation string the destructive apply requires (R4 style: the op key). */\nexport const RECOVERY_CONFIRM = 'operations.recovery';\n\n/** The default TOTAL match cap of the marker search. */\nexport const RECOVERY_DEFAULT_LIMIT = 25;\n\n/** The hard TOTAL match cap (a CONFIG_ERROR above it — pre-request, zero wire). */\nexport const RECOVERY_MAX_LIMIT = 100;\n\n/** The one-call recovery/cleanup input (all validation is pre-request, zero wire). */\nexport interface RecoveryInput {\n /** The plan resource key (e.g. 'companies'). Unknown → typed RESOURCE_UNKNOWN. */\n resource: string;\n /** The marker the write stamped into a name-like field (searched with `contains`). */\n marker: string;\n /**\n * The name-like vendor field to filter on (API casing). Default: the\n * plan's markerField for the resource; REQUIRED when the resource has no\n * markerField (a CONFIG_ERROR names the model's fields as the candidates).\n */\n field?: string;\n /** Parent scope (parent-scoped child resources only — narrows the search on the parent FK). */\n parentId?: number;\n /** Extra leaf filter conditions narrowing the search (e.g. `{ field: 'status', op: 'eq', value: 'open' }`). */\n filter?: FilterCondition[];\n /** The TOTAL match cap (default 25, max 100). */\n limit?: number;\n /** 'find' (default — a read) | 'delete' (destructive — dry-run-first, confirm-gated apply). */\n action?: 'find' | 'delete';\n /**\n * The apply confirmation for `action: 'delete'` (the exact op key —\n * `operations.recovery`). Accepted on the INPUT as well as in\n * {@link RecoveryOptions.confirm} so the MCP tool path can apply a delete:\n * the tool bag has no confirm slot, so the input object rides it (the SDK\n * options path stays the canonical form; the two are equivalent).\n */\n confirm?: string;\n}\n\n/** One matched record (the id is null when unrepresentable — see unsafeId). */\nexport interface RecoveryMatch {\n /** The record's id (null when beyond Number.MAX_SAFE_INTEGER — never a silent skip). */\n id: number | null;\n /** The marker field's value in the matched record. */\n value: string | number | boolean | null;\n}\n\n/** The delete-boundary fact carried in every recovery result. */\nexport interface RecoveryDeleteBoundary {\n /** False when the vendor defines no DELETE for the resource (cleanup is UI-only). */\n available: boolean;\n /** The spec-derived boundary note (available=false) — null when the boundary is available. */\n reason: string | null;\n /** The authority op that answers for the record (null — the boundary is spec-derived). */\n authority: string | null;\n}\n\n/** The one-call recovery/cleanup result (issue #9). */\nexport interface RecoveryResult {\n /** The resource key the op ran against. */\n resource: string;\n /** The marker searched. */\n marker: string;\n /** The field the marker was searched on. */\n field: string;\n /** The action that ran ('find' | 'delete'). */\n action: 'find' | 'delete';\n /** The matched records (empty = the marker matched nothing in the bounded scan). */\n matches: RecoveryMatch[];\n /** Records returned by the single bounded query. */\n scanned: number;\n /**\n * Always false in a returned result: a cap-tripped search REFUSES with\n * RECOVERY_TRUNCATED before any result exists (never a silent truncation).\n */\n truncated: boolean;\n /** The spec-derived delete boundary (zero wire — the plan audit). */\n delete: RecoveryDeleteBoundary;\n /** True when ANY match's id is unrepresentable (beyond Number.MAX_SAFE_INTEGER — P1). */\n unsafeId: boolean;\n /** The manual cleanup note (delete-less resources) — null when the boundary is available. */\n cleanup: { manual: boolean; note: string } | null;\n /** Delete apply only: the per-id outcome (code = the typed code of a failed per-id DELETE). */\n deleted?: Array<{ id: number; verified: boolean; code?: string }>;\n /** Delete dry run only: the envelope marker (the apply path omits it). */\n simulated?: boolean;\n /** The dry-run flag the op ran under (the governor appends dry-run-first). */\n dryRun?: boolean;\n}\n\n/** The op options (the governor's trailing bag lands here). */\nexport interface RecoveryOptions {\n /** Simulate (default true — dry-run-first; the governor appends the governed flag). */\n dryRun?: boolean;\n /** The exact confirmation string for the delete apply (RECOVERY_CONFIRM). */\n confirm?: string;\n}\n\n/** The structural slice of the resource surface the op needs (typed loosely — the holder is a client accessor). */\ninterface RecoveryHolder {\n queryBounded: (params?: { filter?: FilterCondition[]; limit?: number }) => Promise<{\n items: Array<Record<string, unknown>>;\n fetched: number;\n hasMore: boolean;\n pagesWalked: number;\n }>;\n get: (...ids: number[]) => Promise<Record<string, unknown>>;\n delete?: (...ids: number[]) => Promise<unknown>;\n}\n\nfunction configError(message: string, operation: string, suggestedAction: string): never {\n throw new AutotaskConfigError(message, { operation, suggestedAction });\n}\n\n/** Parse a vendor record id into a safe JS integer (null + unsafe when unrepresentable — P1). */\nfunction parseMatchId(record: Record<string, unknown>): { id: number | null; unsafe: boolean } {\n const raw = record.id;\n if (typeof raw === 'number') {\n if (Number.isInteger(raw) && raw >= 0 && raw <= Number.MAX_SAFE_INTEGER) return { id: raw, unsafe: false };\n return { id: null, unsafe: true };\n }\n if (typeof raw === 'string' && /^\\d+$/.test(raw.trim())) {\n const n = Number(raw.trim());\n if (Number.isSafeInteger(n)) return { id: n, unsafe: false };\n return { id: null, unsafe: true };\n }\n return { id: null, unsafe: true };\n}\n\n/**\n * Run the one-call recovery/cleanup op.\n *\n * ```ts\n * import { recovery } from 'node-autotask/operations';\n * // Find the scratch record the write just created (one bounded query, zero mutating wire):\n * const r = await recovery(client, { resource: 'companies', marker: 'FULL100W-1791110339' });\n * // r.delete.available === false + r.cleanup.note — the spec says the vendor has no DELETE.\n *\n * // Where the vendor DOES allow it (delete available):\n * const dry = await recovery(client, { resource: 'configuration_item_dns_records', marker: 'm', parentId: 42 }, { dryRun: true });\n * const applied = await recovery(client, { resource: 'configuration_item_dns_records', marker: 'm', parentId: 42, action: 'delete' }, { dryRun: false, confirm: 'operations.recovery' });\n * ```\n *\n * @param client The wired client (the op runs against the resource's own bounded-query surface).\n * @param input The recovery input (see {@link RecoveryInput}).\n * @param opts The op options (dryRun / confirm — the governor appends the governed bag).\n */\nexport async function recovery(\n client: AutotaskClient,\n input: RecoveryInput,\n opts: RecoveryOptions = {},\n): Promise<RecoveryResult> {\n const operation = RECOVERY_CONFIRM;\n\n // ---- input validation (pre-request, zero wire) --------------------------\n if (!isRecord(input)) {\n configError(\n `recovery: input must be an object { resource, marker, ... } (got ${typeof input})`,\n operation,\n \"Pass { resource: '<plan key>', marker: '<the marker the write stamped>' } — e.g. { resource: 'companies', marker: 'FULL100W-1791110339' }.\",\n );\n }\n const resource = typeof input.resource === 'string' ? input.resource.trim() : '';\n if (resource === '') {\n configError(\n `recovery: input.resource must be a non-empty plan resource key string (e.g. 'companies')`,\n operation,\n 'Pass the exact plan resource key (snake_case) from autotask_catalog — e.g. companies, tickets, configuration_items.',\n );\n }\n const marker = typeof input.marker === 'string' ? input.marker : '';\n if (marker.trim() === '') {\n configError(\n 'recovery: input.marker must be a non-empty string — the marker the write stamped into a name-like field',\n operation,\n \"Stamp a deterministic marker into the record at create time (e.g. `FULL100W-${Date.now()}`) and pass it here; a guess is not a marker.\",\n );\n }\n const action: 'find' | 'delete' = input.action ?? 'find';\n if (action !== 'find' && action !== 'delete') {\n configError(\n `recovery: input.action must be 'find' (default) or 'delete' (got ${JSON.stringify(String(input.action))})`,\n operation,\n \"Pass action: 'delete' for the destructive path (dry-run-first; the apply requires the confirm string).\",\n );\n }\n\n // ---- resource resolution (the typed RESOURCE_UNKNOWN — zero wire) -------\n const entry = RELATIONSHIP_MAP[resource];\n if (entry === undefined) {\n throw new AutotaskError(\n `recovery: unknown resource \"${resource}\" — the plan has ${Object.keys(RELATIONSHIP_MAP).length} resources`,\n {\n code: 'RESOURCE_UNKNOWN',\n category: 'validation',\n operation,\n suggestedAction:\n 'Pass the exact plan resource key (snake_case) from autotask_catalog (e.g. tickets, companies, configuration_items).',\n },\n );\n }\n const holder = (client as unknown as Record<string, unknown>)[camelKey(resource)] as RecoveryHolder | undefined;\n if (!holder || typeof holder.queryBounded !== 'function') {\n configError(\n `recovery: ${resource} exposes no bounded query surface — the marker search cannot run`,\n operation,\n 'Use a resource with a query surface, or address the record by id directly (get/fetchMany).',\n );\n }\n\n // ---- the marker field (the plan's markerField default) -------------------\n const field = input.field !== undefined ? String(input.field) : MARKER_FIELDS[resource];\n if (typeof field !== 'string' || field.trim() === '') {\n configError(\n `recovery: ${resource} has no plan markerField and no input.field was passed — the marker search needs a name-like field to filter on`,\n operation,\n 'Pass input.field — a name-like vendor field the marker was stamped into (see the resource model in autotask_describe / autotask_catalog).',\n );\n }\n\n // ---- the parent scope (parent-scoped child resources only) ---------------\n let parentId: number | undefined;\n if (input.parentId !== undefined) {\n if (!Number.isInteger(input.parentId) || input.parentId < 0) {\n configError(\n `recovery: input.parentId must be a non-negative integer (got ${String(input.parentId)})`,\n operation,\n 'Pass the parent record id (e.g. the ticket id for a ticket note).',\n );\n }\n parentId = input.parentId;\n if (entry.parent === null || entry.parent.field === null) {\n configError(\n `recovery: ${resource} is not a parent-scoped child resource — input.parentId does not apply`,\n operation,\n `Drop input.parentId (the search runs unscoped), or pass the child resource that IS scoped under ${resource}.`,\n );\n }\n }\n\n // ---- the extra filter (leaf conditions only) ------------------------------\n const extra: FilterCondition[] = [];\n if (input.filter !== undefined) {\n if (!Array.isArray(input.filter)) {\n configError(\n `recovery: input.filter must be an array of leaf filter conditions (got ${typeof input.filter})`,\n operation,\n 'Pass e.g. [{ field: \\'status\\', op: \\'eq\\', value: \\'open\\' }] — leaf conditions only.',\n );\n }\n for (const c of input.filter) {\n if (!isRecord(c) || typeof c.op !== 'string' || c.op === 'and' || c.op === 'or') {\n configError(\n 'recovery: input.filter accepts only plain leaf conditions ({ field, op, value }) — no grouping',\n operation,\n 'Pass flat leaf conditions; grouping operators are not supported here.',\n );\n }\n extra.push(c as FilterCondition);\n }\n }\n\n // ---- the match cap --------------------------------------------------------\n let limit = RECOVERY_DEFAULT_LIMIT;\n if (input.limit !== undefined) {\n if (!Number.isInteger(input.limit) || input.limit < 1 || input.limit > RECOVERY_MAX_LIMIT) {\n configError(\n `recovery: input.limit must be an integer 1..${RECOVERY_MAX_LIMIT} (got ${String(input.limit)})`,\n operation,\n `Raise the marker precision instead of the cap, or pass limit up to ${RECOVERY_MAX_LIMIT}.`,\n );\n }\n limit = input.limit;\n }\n\n // ---- the spec-derived delete boundary (zero wire — the plan audit) --------\n const boundaryNote = DELETE_BOUNDARY_NOTES[resource];\n const boundary: RecoveryDeleteBoundary = {\n available: boundaryNote === undefined,\n reason: boundaryNote ?? null,\n authority: null,\n };\n const cleanup =\n boundaryNote === undefined\n ? null\n : {\n manual: true,\n note: `the vendor defines no DELETE for ${resource} — remove the record(s) in the Autotask UI (UI-only cleanup; the API 405s the method). ${boundaryNote}`,\n };\n\n const isDelete = action === 'delete';\n\n // ---- delete: the PRE-SEARCH boundary refusal (zero wire) ------------------\n if (isDelete && boundaryNote !== undefined) {\n throw new DeleteBoundaryError(\n `recovery: the vendor defines no DELETE for ${resource} — the delete cannot be issued through the API (zero wire was issued)`,\n {\n operation,\n suggestedAction: cleanup!.note,\n details: { resource, note: boundaryNote },\n },\n );\n }\n\n // ---- delete: the confirm gate (dry-run-first; apply is deliberate) --------\n const dryRun = opts?.dryRun !== false;\n // The confirm is read from the options bag (the SDK canonical path, the\n // governor forwards it) OR the input object (the MCP tool path — the tool\n // bag has no confirm slot; post-verification F2).\n const confirm = opts?.confirm ?? input.confirm;\n if (isDelete && !dryRun && confirm !== RECOVERY_CONFIRM) {\n throw new ConfirmationRequiredError(\n `recovery: action 'delete' apply is destructive and requires its confirmation flag: pass confirm: \"${RECOVERY_CONFIRM}\"`,\n {\n operation: RECOVERY_CONFIRM,\n suggestedAction:\n 'Pass confirm equal to the operation key to acknowledge the deliberate act — or keep the dry run (omit dryRun: false) and read the match set first.',\n },\n );\n }\n\n // ---- ONE bounded query (the marker search — a read) -----------------------\n const conditions: FilterCondition[] = [\n { field, op: 'contains', value: marker },\n ...(parentId !== undefined && entry.parent !== null && entry.parent.field !== null\n ? [{ field: entry.parent.field, op: 'eq' as const, value: parentId } as FilterCondition]\n : []),\n ...extra,\n ];\n const query = await holder.queryBounded({ filter: conditions, limit });\n\n // ---- the cap-tripped refusal (never a silent truncation / silent empty) ---\n if (query.hasMore) {\n const wire = isDelete ? 'DELETE wire' : 'mutating wire';\n throw new RecoveryTruncatedError(\n `recovery: the marker search on ${resource} TRIPPED its match cap (${limit}) — more matches exist than were returned (zero ${wire} was issued)`,\n {\n operation,\n suggestedAction: `Narrow the search (a more precise marker, an input.filter condition, input.parentId) or pass a higher limit (max ${RECOVERY_MAX_LIMIT}).`,\n details: { resource, scanned: query.fetched, limit },\n },\n );\n }\n\n // ---- the matches (ids parsed into safe integers — never a silent skip) ----\n const matches: RecoveryMatch[] = [];\n const unsafeIds: number[] = [];\n query.items.forEach((record, idx) => {\n const parsed = parseMatchId(record);\n if (parsed.unsafe) unsafeIds.push(idx);\n const value = record[field];\n matches.push({\n id: parsed.id,\n value: typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' ? value : null,\n });\n });\n const unsafeId = unsafeIds.length > 0;\n\n const base: RecoveryResult = {\n resource,\n marker,\n field,\n action,\n matches,\n scanned: query.fetched,\n truncated: false,\n delete: boundary,\n unsafeId,\n cleanup,\n dryRun: undefined,\n };\n\n // ---- find: return (zero mutating wire) ------------------------------------\n if (!isDelete) return base;\n\n // ---- delete dry run: the match set + the boundary, ZERO DELETE wire -------\n if (dryRun) {\n // The dry run performs the search (above) and reports; the unsafe-id\n // refusal applies to the APPLY, but the dry run still surfaces it (the\n // caller must see the unaddressable match before confirming the apply).\n return { ...base, simulated: true, dryRun: true };\n }\n\n // ---- delete apply: one DELETE per safe match id + one verification read --\n if (unsafeId) {\n throw new MarkerUnsafeIdError(\n `recovery: ${unsafeIds.length} of ${matches.length} match(es) on ${resource} have ids beyond Number.MAX_SAFE_INTEGER — they CANNOT be addressed through the SDK's typed delete surface (zero DELETE wire was issued)`,\n {\n operation,\n suggestedAction: cleanup\n ? cleanup.note\n : 'Remove the unaddressable record(s) in the Autotask UI, then re-run the recovery (the safe matches are addressed one by one).',\n details: { resource, unsafeMatches: unsafeIds.length, totalMatches: matches.length },\n },\n );\n }\n\n const deleteMethod = holder.delete;\n if (deleteMethod === undefined) {\n // The plan says the boundary is available (a DELETE exists in the spec)\n // but the client exposes no delete method — a registry/spec mismatch.\n throw new DeleteBoundaryError(\n `recovery: ${resource} has no delete method on the client — the boundary is marked available in the plan but the typed delete surface is missing`,\n {\n operation,\n suggestedAction: 'Report the registry drift (plan says deletable, client exposes no delete) — or clean up via the Autotask UI.',\n details: { resource },\n },\n );\n }\n\n const deleted: Array<{ id: number; verified: boolean; code?: string }> = [];\n for (const match of matches) {\n const id = match.id as number;\n let verify: 'not-found' | 'still-present' | 'error' = 'error';\n let code: string | undefined;\n try {\n if (parentId !== undefined) {\n await (deleteMethod as (p: number, i: number, o?: unknown) => Promise<unknown>).call(holder, parentId, id, { dryRun: false });\n } else {\n await (deleteMethod as (i: number, o?: unknown) => Promise<unknown>).call(holder, id, { dryRun: false });\n }\n try {\n if (parentId !== undefined) {\n await (holder.get as (p: number, i: number) => Promise<unknown>).call(holder, parentId, id);\n verify = 'still-present';\n } else {\n await (holder.get as (i: number) => Promise<unknown>).call(holder, id);\n verify = 'still-present';\n }\n } catch (err) {\n if (err instanceof NotFoundError) verify = 'not-found';\n else {\n verify = 'error';\n code = isAutotaskError(err) ? err.code : 'SERVER_ERROR';\n }\n }\n } catch (err) {\n // Per-item typed partial failure (the SDK house style — fetchMany):\n // a failed DELETE never aborts the remaining ids.\n code = isAutotaskError(err) ? err.code : 'SERVER_ERROR';\n }\n deleted.push({ id, verified: verify === 'not-found', code });\n }\n\n return { ...base, deleted, dryRun: false };\n}\n","/**\n * `operations.invoke` — the registry-driven call path with the WRITE\n * GOVERNOR (ARCHITECTURE section 19.5 R2–R4).\n *\n * The generated registry lists EVERY implemented operation; this module is\n * the deterministic call path for ones that are not a typed convenience of\n * their own. The MCP mode tools (`autotask_read` / `autotask_write` /\n * `autotask_delete`) dispatch through the same router with the mode pinned;\n * `invoke()` itself stays the programmatic escape hatch — its mode is derived\n * from the record, so it can never be cross-mode-refused.\n * It is deliberately MCP-independent — plain SDK code, no MCP import.\n *\n * ```ts\n * import { invoke } from 'node-autotask/operations';\n *\n * await invoke(client, 'companies.get', [3]); // read: one request\n * await invoke(client, 'companies.update', [3, { companyName: 'A' }]); // write: DRY RUN by default\n * await invoke(client, 'companies.update', [3, { companyName: 'A' }], { dryRun: false }); // apply\n * await invoke(client, 'companies.delete', [3], { dryRun: false, confirm: 'companies.delete' }); // destructive\n * ```\n *\n * Governor rules (pinned):\n * - the operation key must EXACTLY match a registry record (unknown keys\n * refuse before any request);\n * - a mode-pinned call (the mode tools) REFUSES a cross-mode op before any\n * request (the mode is the registry `effect`: read → `read`, write →\n * `write`, destructive → `delete`; the refusal message carries the op key\n * + the effect + the correct target tool — zero wire, it throws before\n * holder/method resolution);\n * - a read REFUSES `dryRun: true` (a read has no dry run to run);\n * - a write is DRY-RUN-FIRST: unless the caller passes `dryRun: false`, the\n * call travels with `dryRun: true` and the real mutating request is never\n * issued (the result is the pinned `DryRunResult`, `simulated: true`);\n * - a destructive or approval-gated operation (registry `effect` +\n * `flags`) REFUSES without its confirmation flag: `confirm` must equal the\n * operation key exactly (no booleans, no fuzzy matching) — in BOTH dry-run\n * and apply mode (the deliberate act is the call, not the write);\n * - query operations (`<resource>.query`) are routed to the resource's\n * `queryBounded` (server-side pagination): ONE invoke call returns a\n * bounded, complete-enough result — the vendor cursor walk happens inside\n * the SDK; the caller passes `limit` as the TOTAL cap (default 500, max\n * 2500) and never owns a stream. `queryAll` keeps its raw behavior (the\n * unbounded walk; the catalog text steers the caller away for normal work);\n * - the governor OPTIONS object is closed: an unknown option key (a typo of\n * `dryRun` / `confirm` / `lastModifiedDate`) is refused pre-request (the\n * key is named + the valid keys listed — never the values);\n * - the query-family params bag (`args[0]` for `query` / `queryAll` /\n * `count`) is CLOSED at its top level: the valid key set is per-verb\n * (PARAMS_BAG_KEYS — for `query` routed to `queryBounded`:\n * filter / limit / includeFields / via) and an unknown key (`filters`,\n * `lmit`, `pageSize`, `cursor`, …) is refused pre-request with a typed\n * error naming the key + the valid keys + a did-you-mean; entity bodies,\n * UDF maps and the filter tree stay open (strictness applies to tool\n * arguments, not vendor payloads);\n * - the caller's `args` are validated against the record's declared\n * `inputSchema` BEFORE the method is applied (pre-request, zero wire):\n * MORE args than the declared positional list are REFUSED, FEWER than the\n * required count are REFUSED, and scalar-typed args (number/string) are\n * loosely type-checked — each refusal is a shape-teaching message naming\n * the operation, the declared arg list (names + types) and the count\n * passed (never the values — redaction discipline). v0.2.0 behavior\n * change: extra args were SILENTLY DROPPED (the JS call ignores them);\n * v0.3.0 refuses them, so a wrong-arity call can never shadow the\n * governed trailing bag or land in the wrong positional slot. The\n * governed `{ dryRun, lastModifiedDate? }` bag is NOT a declared arg —\n * it travels through the invoke options and is appended by the router.\n *\n * Dispatch calls the SAME typed method the SDK publishes, with the caller's\n * `args` in the method's positional order; for writes the governed\n * `{ dryRun, lastModifiedDate? }` bag is appended as the method's final\n * `MutationOpts` argument. Every guard that path already has (bounded scans,\n * the stale check, the dry-run envelope) is that path's, not a second\n * implementation.\n */\nimport { CAPABILITIES, type CapabilityRecord } from '../capabilities.js';\nimport { AutotaskConfigError, ConfirmationRequiredError } from '../errors.js';\nimport type { AutotaskClient } from '../client.js';\nimport { camelKey, isRecord } from '../utils/index.js';\nimport type { InvokeOptions, ResolveAnyOptions, SearchAcrossResourcesOptions, FetchManyItem } from './types.js';\nimport { resolveAny } from './resolveAny.js';\nimport { searchAcrossResources } from './searchAcrossResources.js';\nimport { fetchMany, type FetchManyOptions } from './fetchMany.js';\nimport { relationshipMap } from './relationshipMap.js';\nimport { blindSurfaces } from './blindSurfaces.js';\nimport type { BlindSurfaceOptions } from './blindSurfaces.js';\nimport { probeReachability } from './probeReachability.js';\nimport type { ProbeReachabilityOptions } from './probeReachability.js';\nimport { createGuidance } from './createGuidance.js';\nimport type { CreateGuidanceOptions } from './createGuidance.js';\nimport { fieldCatalog } from './fieldCatalog.js';\nimport type { FieldCatalogOptions } from './fieldCatalog.js';\nimport { recovery, type RecoveryInput, type RecoveryOptions } from './recovery.js';\n\nconst RECORDS: readonly CapabilityRecord[] = CAPABILITIES;\nconst byId = new Map<string, CapabilityRecord>(RECORDS.map((r) => [r.id, r]));\n\n/** True for an operation that needs a deliberate act before it runs (R4). */\nexport function needsConfirmation(record: CapabilityRecord): boolean {\n return record.effect === 'destructive' || (record.flags ?? []).includes('requiresApproval');\n}\n\nfunction refuse(message: string, operation: string, suggestedAction?: string): never {\n throw new ConfirmationRequiredError(message, { operation, suggestedAction });\n}\n\n/**\n * The mode the operation's registry `effect` belongs to — the A2 predicate,\n * verified one-to-one over all registry records.\n */\nexport type InvokeMode = 'read' | 'write' | 'delete';\n\nconst MODE_BY_EFFECT: Record<CapabilityRecord['effect'], InvokeMode> = {\n read: 'read',\n write: 'write',\n destructive: 'delete',\n};\n\n/** The MCP tool (and SDK wrapper) that owns each mode. */\nconst MODE_TOOL: Record<InvokeMode, string> = {\n read: 'autotask_read',\n write: 'autotask_write',\n delete: 'autotask_delete',\n};\n\nconst MODE_SDK: Record<InvokeMode, string> = {\n read: 'invokeRead',\n write: 'invokeWrite',\n delete: 'invokeDelete',\n};\n\n/** The effect label each mode's tool routes (the refusal message wording). */\nconst MODE_EFFECT: Record<InvokeMode, string> = {\n read: 'read',\n write: 'write',\n delete: 'destructive',\n};\n\n/**\n * The cross-mode refusal (pre-request, zero wire): the op key + the actual\n * effect + the correct target tool — shape-teaching, consistent with the\n * existing refusal style.\n */\nfunction crossModeRefusal(operation: string, effect: CapabilityRecord['effect'], mode: InvokeMode): string {\n const actual = MODE_BY_EFFECT[effect];\n const subject = effect === 'write' ? 'a write' : effect === 'destructive' ? 'destructive' : 'a read';\n const target =\n actual === 'read'\n ? `Route it through the read mode (${MODE_SDK[actual]} / ${MODE_TOOL[actual]}).`\n : actual === 'write'\n ? `Route it through the write mode (${MODE_SDK[actual]} / ${MODE_TOOL[actual]} — dry-run first).`\n : `Deletes have their own tool (${MODE_TOOL[actual]}) and require confirm: \"${operation}\".`;\n return `invoke: \"${operation}\" is ${subject} (effect=${effect}) — refused on the ${mode} path (${MODE_TOOL[mode]} routes effect=${MODE_EFFECT[mode]} operations only). ${target}`;\n}\n\nfunction isSafeNonNegativeInteger(value: unknown): boolean {\n return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;\n}\n\n/** The audited arg types the loose typeof check understands (the rest pass\n * through to the method's own validation). */\nfunction looseTypeOk(type: string, value: unknown): boolean {\n switch (type) {\n case 'number':\n // Every audited 'number' arg is an integer (picklist / year). Issue #54:\n // a float, negative or unsafe number is refused pre-request; numeric\n // strings pass (parseIdentifier accepts them and v0.2.0 forwarded them).\n return isSafeNonNegativeInteger(value) || (typeof value === 'string' && /^\\d+$/.test(value));\n case 'string':\n return typeof value === 'string';\n case 'string | number':\n // The number branch is always an id (issue #54): safe non-negative integers only.\n return typeof value === 'string' || isSafeNonNegativeInteger(value);\n case 'number[]':\n return Array.isArray(value);\n case 'string[]':\n return Array.isArray(value) && value.every((v) => typeof v === 'string');\n case 'object':\n return isRecord(value);\n default:\n // The descriptors are signature-audited and pinned by the registry\n // tests; an unknown one passes and the method's own validation catches\n // a real mismatch (never a silent forward of an undeclared arg — that\n // is refused above, pre-request).\n return true;\n }\n}\n\n/** The declared arg list rendered for refusal messages (names + types, in\n * declaration order — never values: redaction discipline). */\nfunction declaredArgList(record: CapabilityRecord): string {\n const schema = record.inputSchema ?? {};\n const names = Object.keys(schema);\n if (names.length === 0) return 'no positional args';\n return names.map((n) => `${n}: ${schema[n]!.type}`).join(', ');\n}\n\n/**\n * Validate the caller's positional args against the record's declared\n * `inputSchema` (A-F2). Refusals are pre-request (zero wire) and shape-\n * teaching: they name the operation, the declared arg list (names + types)\n * and the count passed — never the values.\n *\n * Rules (the v0.2.0 → v0.3.0 tightening):\n * - MORE args than the declared positional list → REFUSED (v0.2.0 silently\n * dropped them);\n * - FEWER args than the required count → REFUSED (they would have landed in\n * the wrong positional slot — a bare scalar where an object belongs);\n * - scalar-typed args (number/string/number[]/object) get a loose typeof\n * check on the value actually passed.\n * Query-family ops (`query`/`queryAll`/`count`) validate against the real\n * `queryBounded`/`count` signature: at most ONE optional params object — a\n * bare conditions array is refused here, not after the walk has started.\n */\nexport function validateDispatchArgs(record: CapabilityRecord, argsIn: readonly unknown[] | null | undefined): void {\n const args = argsIn ?? [];\n const operation = record.id;\n const schema = record.inputSchema ?? {};\n const names = Object.keys(schema);\n if (args.length > names.length) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" declares ${names.length} positional arg(s) (${declaredArgList(record)}) but ${args.length} were passed — extra args are refused, not dropped (v0.2.0 silently dropped them)`,\n {\n operation,\n suggestedAction: `Pass exactly the declared args in order (${declaredArgList(record)}); dryRun/confirm/lastModifiedDate travel through the invoke options, never the args.`,\n },\n );\n }\n const required = names.filter((n) => schema[n]!.required);\n if (args.length < required.length) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" requires ${required.length} positional arg(s) (${required\n .map((n) => `${n}: ${schema[n]!.type}`)\n .join(', ')}) but only ${args.length} were passed — declared args: ${declaredArgList(record)}`,\n { operation },\n );\n }\n for (let i = 0; i < args.length; i += 1) {\n const value = args[i]!;\n if (value === undefined) continue;\n const name = names[i]!;\n const spec = schema[name]!; // within bounds: args.length <= names.length (refused above)\n if (!looseTypeOk(spec.type, value)) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" arg ${i + 1} is declared ${name}: ${spec.type} — the value has the wrong type (pass a ${spec.type} value)`,\n { operation },\n );\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Closed input sets (issue #3) — the params bag and the governor options.\n// Strictness applies to TOOL ARGUMENTS, never to vendor payloads: entity\n// bodies for create/update, UDF maps and the filter tree stay open (or\n// schema-driven). The key sets mirror the generated docs\n// (scripts/lib/args-derive.mjs PARAMS_OBJECT_SHAPES — the same closed sets\n// the registry's inputSchema descriptions state) and are driven by the\n// record's `inputSchemaStrict` flag (the plan channel, always true).\n// ---------------------------------------------------------------------------\n\n/** The CLOSED params-bag key set per query-family verb (`args[0]`).\n * `query` routes to `queryBounded`, whose method reads only\n * filter / limit / includeFields / via — `maxRecords` is ignored by it\n * (the vendor page size is derived from `limit`), so it is refused with a\n * suggestion for `limit`; the raw `queryAll` walk keeps the full\n * `QueryParams` set. */\nexport const PARAMS_BAG_KEYS: Readonly<Record<string, readonly string[]>> = {\n query: ['filter', 'limit', 'includeFields', 'via'],\n queryAll: ['filter', 'maxRecords', 'includeFields', 'maxTotalRecords', 'via'],\n count: ['filter'],\n};\n\n/** Known wrong-key synonyms (the issue's typo classes) — consulted before\n * the Levenshtein fallback, and honoured only when the target is in the\n * verb's valid set (e.g. `cursor` → `limit` on `query`, not on `count`). */\nconst BAG_KEY_SYNONYMS: Readonly<Record<string, string>> = {\n filters: 'filter',\n lmit: 'limit',\n page: 'limit',\n pageSize: 'limit',\n cursor: 'limit',\n maxrecords: 'maxRecords',\n};\n\n/** Minimal Levenshtein (the SDK stays dependency-free). */\nfunction levenshtein(a: string, b: string): number {\n if (a === b) return 0;\n const prev = new Array<number>(b.length + 1);\n const cur = new Array<number>(b.length + 1);\n for (let j = 0; j <= b.length; j += 1) prev[j] = j;\n for (let i = 1; i <= a.length; i += 1) {\n cur[0] = i;\n for (let j = 1; j <= b.length; j += 1) {\n cur[j] = Math.min((prev[j] ?? 0) + 1, (cur[j - 1] ?? 0) + 1, prev[j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n for (let j = 0; j <= b.length; j += 1) prev[j] = cur[j]!;\n }\n return prev[b.length] ?? 0;\n}\n\n/** The did-you-mean for one unknown key (synonym first, then the nearest\n * valid key within edit distance 3; null when no candidate is close). */\nfunction suggestForKey(key: string, valid: readonly string[]): string | null {\n const synonym = BAG_KEY_SYNONYMS[key.toLowerCase()];\n if (synonym !== undefined && valid.includes(synonym)) return synonym;\n let best: { key: string; dist: number } | null = null;\n for (const v of valid) {\n const dist = levenshtein(key.toLowerCase(), v.toLowerCase());\n if (best === null || dist < best.dist) best = { key: v, dist };\n }\n if (best !== null && best.dist <= 3) return best.key;\n return null;\n}\n\n/**\n * Refuse unknown params-bag keys (issue #3). `args[0]` of the query-family\n * verbs (`query` / `queryAll` / `count`) is the params object; its top level\n * is CLOSED per verb (PARAMS_BAG_KEYS). Refusals are pre-request (zero\n * wire) and name the unknown key(s) + the valid keys + a did-you-mean —\n * never the values (redaction discipline). Records with\n * `inputSchemaStrict` not true (the plan channel; always true today) skip\n * the check — the strictness is emitted per record by the generator.\n */\nexport function validateParamsBag(record: CapabilityRecord, args: readonly unknown[] | null | undefined): void {\n if (record.inputSchemaStrict !== true) return;\n const valid = PARAMS_BAG_KEYS[record.operation];\n if (valid === undefined) return; // only the query-family verbs take a params bag\n const bag = args?.[0];\n if (bag === undefined || bag === null || !isRecord(bag)) return; // non-objects refuse in validateDispatchArgs\n const unknown = Object.keys(bag).filter((k) => !valid.includes(k));\n if (unknown.length === 0) return;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, valid)] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n throw new AutotaskConfigError(\n `invoke: \"${record.id}\" params bag has unknown key(s) ${unknown.map((k) => `\"${k}\"`).join(', ')} — the bag is closed (valid keys: ${valid.join(', ')})`,\n {\n operation: record.id,\n suggestedAction: suggestions.length > 0\n ? `Fix the key name (${suggestions.join(', ')}); the full bag contract is in the operation's inputSchema (autotask_describe).`\n : `Pass only the valid keys (${valid.join(', ')}); the full bag contract is in the operation's inputSchema (autotask_describe).`,\n },\n );\n}\n\n/** The CLOSED governor-option key set (public keys; `mode` is the internal\n * mode-tool pin the wrappers pass — it is allowed but never suggested). */\nexport const INVOKE_OPTION_KEYS: readonly string[] = ['dryRun', 'confirm', 'lastModifiedDate', 'mode'];\n\n/**\n * Refuse unknown governor-option keys (issue #3): the `opts` object of\n * `invoke` / the mode wrappers is closed — a typo of `dryRun` / `confirm` /\n * `lastModifiedDate` is refused pre-request (zero wire), naming the key +\n * the valid keys. Refusals use the existing validation error code\n * (CONFIG_ERROR) + `suggestedAction`; values are never echoed.\n */\nexport function validateInvokeOptions(opts: Record<string, unknown> | undefined, operation: string): void {\n if (opts === undefined || opts === null) return;\n const unknown = Object.keys(opts).filter((k) => !INVOKE_OPTION_KEYS.includes(k));\n if (unknown.length === 0) return;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, ['dryRun', 'confirm', 'lastModifiedDate'])] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" has unknown option key(s) ${unknown.map((k) => `\"${k}\"`).join(', ')} — the options set is closed (valid: dryRun, confirm, lastModifiedDate)`,\n {\n operation,\n suggestedAction: suggestions.length > 0\n ? `Fix the option name (${suggestions.join(', ')}).`\n : `Pass only dryRun / confirm / lastModifiedDate.`,\n },\n );\n}\n\n/**\n * The typed refusal for UNKNOWN TOP-LEVEL KEYS (issue #3) — the shared\n * message contract of the closed input sets: the MCP reference servers run\n * it on every tool's top-level argument object (the closed wire surface),\n * and it is the shape the params-bag / governor-option refusals follow.\n * Names the unknown key(s) + the valid keys + a did-you-mean — NEVER a\n * value (redaction discipline). Returns null when every key is known.\n */\nexport function unknownKeysRefusal(\n raw: unknown,\n validKeys: readonly string[],\n subject: string,\n operation?: string,\n): AutotaskConfigError | null {\n if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return null; // non-objects are a shape error — refused by the caller's own check\n const unknown = Object.keys(raw).filter((k) => !validKeys.includes(k));\n if (unknown.length === 0) return null;\n const suggestions = unknown\n .map((k) => [k, suggestForKey(k, [...validKeys])] as const)\n .filter((pair): pair is readonly [string, string] => pair[1] !== null)\n .map(([k, s]) => `\"${k}\" → \"${s}\"`);\n return new AutotaskConfigError(\n `unknown ${subject} ${unknown.map((k) => `\"${k}\"`).join(', ')} — the ${subject} set is closed (valid keys: ${validKeys.join(', ')})`,\n {\n ...(operation !== undefined ? { operation } : {}),\n suggestedAction: suggestions.length > 0\n ? `Fix the ${subject} name (${suggestions.join(', ')}); the full contract is in the tool's inputSchema (autotask_describe).`\n : `Pass only the valid keys (${validKeys.join(', ')}).`,\n },\n );\n}\n\n/**\n * Invoke one registry operation through its typed SDK method — the shared\n * router behind `invoke` and the three mode-guarded wrappers.\n *\n * @param client The wired `AutotaskClient`.\n * @param operation The registry key, e.g. `companies.update`.\n * @param args The method's positional arguments, in order\n * (e.g. `[id, data]` for `update`, `[parentId, id, data]`\n * for a parent-scoped `update`).\n * @param opts The governor options (`dryRun`, `confirm`, `lastModifiedDate`)\n * + `mode` for the mode tools (pre-request cross-mode check;\n * unset for the legacy `invoke` path).\n */\nexport async function invokeMode(\n client: AutotaskClient,\n operation: string,\n argsIn: readonly unknown[] | null = [],\n opts: InvokeOptions & { mode?: InvokeMode } = {},\n): Promise<unknown> {\n const args = argsIn ?? [];\n const record = byId.get(operation);\n if (record === undefined) {\n throw new AutotaskConfigError(\n `invoke: unknown operation \"${operation}\" — it is not in the capability registry`,\n { operation, suggestedAction: 'List the registry (the ./capabilities subpath) for the exact operation key.' },\n );\n }\n // Closed governor options (issue #3, PRE-REQUEST — zero wire): an unknown\n // option key (a typo of dryRun/confirm/lastModifiedDate) is refused up\n // front, so a flag the caller believed they set is never silently ignored.\n validateInvokeOptions(opts as Record<string, unknown>, operation);\n // Cross-mode check (PRE-REQUEST, before any holder/method resolution —\n // zero wire): fires only when the caller pinned the mode (the mode tools);\n // the legacy path passes no mode and can never be refused here.\n const mode = opts.mode;\n if (mode !== undefined && MODE_BY_EFFECT[record.effect] !== mode) {\n throw new AutotaskConfigError(crossModeRefusal(operation, record.effect, mode), { operation });\n }\n // dryRun is a safety flag: anything but a real boolean is refused up\n // front (zero wire). A truthy string like 'true' must never fall through\n // a strict `=== true` check inside a method and become a live write.\n if (opts.dryRun !== undefined && typeof opts.dryRun !== 'boolean') {\n throw new AutotaskConfigError(\n `invoke: dryRun must be a boolean (got ${typeof opts.dryRun}) — \"${operation}\" was not issued`,\n { operation, suggestedAction: 'Pass dryRun: true (simulate) or dryRun: false (apply) as a real boolean.' },\n );\n }\n const isWrite = record.effect !== 'read';\n if (!isWrite && opts.dryRun === true) {\n throw new AutotaskConfigError(\n `invoke: \"${operation}\" is a read — dryRun is not applicable (reads issue their request as-is)`,\n { operation },\n );\n }\n if (needsConfirmation(record) && opts.confirm !== operation) {\n refuse(\n `invoke: \"${operation}\" is ${record.effect}${(record.flags ?? []).includes('requiresApproval') ? ' approval-gated' : ''} and requires its confirmation flag: pass confirm: \"${operation}\"`,\n operation,\n 'Pass confirm equal to the operation key to acknowledge the deliberate act.',\n );\n }\n // Dispatch validation (A-F2, v0.3.0): the caller's args are checked\n // against the record's declared inputSchema BEFORE the method is applied\n // (pre-request, zero wire) — extra args are refused, not dropped.\n validateDispatchArgs(record, args);\n // Closed params bag (issue #3): the query-family `args[0]` object's top\n // level is closed per verb (validateParamsBag) — an unknown key is\n // refused pre-request, never silently dropped.\n validateParamsBag(record, args);\n // Query ops route to queryBounded (server-side pagination): one invoke\n // call = one bounded result; the caller never owns the cursor walk.\n const boundedQuery = record.kind === 'primitive' && record.operation === 'query';\n let holder = (client as unknown as Record<string, unknown>)[camelKey(record.resource)];\n if (holder === undefined && record.resource === 'operations') {\n // S12-B (run mcp-fix-20261003): the virtual \"operations\" resource — the\n // cross-resource helpers are module functions (src/operations/), not\n // client accessors, so the router materialises the holder: the same\n // typed functions the `./operations` subpath exports, bound to THIS\n // client. This is what makes `invokeRead(client, 'operations.fetchMany',\n // [items])` (and `autotask_read` for the operations-layer ops) dispatch\n // through the governed path; pre-request validation stays the op's own.\n holder = {\n resolveAny: (identifier: unknown, opts?: unknown) => resolveAny(client, identifier as number | string, opts as ResolveAnyOptions | undefined),\n searchAcrossResources: (query: unknown, opts?: unknown) => searchAcrossResources(client, query as string, opts as SearchAcrossResourcesOptions | undefined),\n fetchMany: (items: unknown, opts?: unknown) => fetchMany(client, items as readonly FetchManyItem[], opts as FetchManyOptions | undefined),\n relationshipMap: (resourceKey: unknown) => relationshipMap(client, resourceKey as string),\n // Issue #11: the served blind-surface inventory (zero wire) + the\n // bounded caller-opted reachability sweep (read-only, confirmProbe-\n // required — the op's own pre-request gates keep it deliberate).\n blindSurfaces: (opts?: unknown) => blindSurfaces(client, opts as BlindSurfaceOptions | undefined),\n probeReachability: (opts?: unknown) => probeReachability(client, opts as ProbeReachabilityOptions | undefined),\n // Issue #12: the served zone-fact create-guidance catalog (zero wire).\n createGuidance: (opts?: unknown) => createGuidance(client, opts as CreateGuidanceOptions | undefined),\n // Issue #31: the opt-in live field-metadata channel — N bounded\n // entityInformation GETs (the op's own cap refuses over-cap fan-outs\n // pre-request; per-resource failures are recorded on the row and\n // never abort the call).\n fieldCatalog: (opts?: unknown) => fieldCatalog(client, opts as FieldCatalogOptions | undefined),\n // Issue #9: the one-call recovery/cleanup op — effect write in the\n // registry (the governor's dry-run-first applies to it); the op's own\n // confirm gate makes the destructive action deliberate (the governor\n // forwards the caller's confirm through the trailing bag below).\n recovery: (input: unknown, opts?: unknown) => recovery(client, input as RecoveryInput, opts as RecoveryOptions | undefined),\n };\n }\n if (holder === undefined) {\n throw new AutotaskConfigError(\n `invoke: the client exposes no accessor for resource \"${record.resource}\"`,\n { operation },\n );\n }\n const methodName = boundedQuery ? 'queryBounded' : record.operation;\n const method = (holder as Record<string, unknown>)[methodName];\n if (typeof method !== 'function') {\n throw new AutotaskConfigError(\n `invoke: \"${record.resource}.${methodName}\" is not a callable method on the client`,\n { operation },\n );\n }\n // Writes travel with the governed dry-run flag (and the optional\n // caller-observed lastModifiedDate) as the method's trailing MutationOpts.\n const dryRun = isWrite ? opts.dryRun !== false : false;\n const mutationOpts: Record<string, unknown> = { dryRun };\n if (isWrite && opts.lastModifiedDate !== undefined) {\n mutationOpts.lastModifiedDate = opts.lastModifiedDate;\n }\n // Issue #9: the caller's confirm flag rides the trailing bag too. The\n // governor's own confirm gate covers effect=destructive records; an op\n // that is a write record but carries an action-scoped destructive sub-op\n // (operations.recovery's `action: 'delete'`) enforces ITS confirm\n // (confirm === 'operations.recovery') inside the op — without the ride\n // the governed path could never reach the apply branch. Base methods\n // ignore the extra key (MutationOpts is read, not validated, at runtime).\n if (isWrite && opts.confirm !== undefined) {\n mutationOpts.confirm = opts.confirm;\n }\n // Bag-riding declared args: the governor FOLDS them into the trailing\n // MutationOpts instead of passing them positionally (the method takes them\n // inside its options object, beside dryRun/lastModifiedDate):\n // createIfNotExists.dedupFields (base.ts unified overload) and\n // moveConfigurationItem.destinationCompanyId (D2: the required domain field\n // of MoveConfigurationItemOptions — without the fold the invoke path could\n // never supply it and the method threw CONFIG_ERROR pre-wire). The runtime\n // mirror of scripts/lib/args-derive.mjs BAG_RIDING_ARGS (kept in lockstep;\n // the g11e tripwire + the invoke dispatch tests pin both sides).\n const BAG_RIDING_ARGS: Readonly<Record<string, readonly string[]>> = {\n createIfNotExists: ['dedupFields'],\n moveConfigurationItem: ['destinationCompanyId'],\n };\n const declaredNames = Object.keys(record.inputSchema ?? {});\n const bagRiding = new Set(BAG_RIDING_ARGS[record.operation] ?? []);\n let positional = args;\n for (const argName of BAG_RIDING_ARGS[record.operation] ?? []) {\n const at = declaredNames.indexOf(argName);\n if (at >= 0 && args.length > at) {\n mutationOpts[argName] = args[at];\n positional = positional.slice(0, at);\n }\n }\n const callArgs: unknown[] = [...positional];\n if (isWrite) {\n // The trailing bag must land in the method's LAST parameter (the governed\n // options bag). Omitted intermediate OPTIONAL declared args are padded\n // with undefined — an un-padded bag shadows the omitted slot (the v0.8.0\n // composition ops' `extra` / `fields` / `assign` parameter), the method\n // silently receives `opts = {}`, dryRun is lost and the APPLY path runs\n // under the dry-run flag (FULL100 D1: a contact created on ww29).\n const declaredPositional = declaredNames.filter((n) => !bagRiding.has(n));\n while (callArgs.length < declaredPositional.length) callArgs.push(undefined);\n callArgs.push(mutationOpts);\n }\n const result = await (method as (...call: unknown[]) => unknown).apply(holder, callArgs);\n return Buffer.isBuffer(result) ? bufferResult(result) : result;\n}\n\n/** Largest attachment body `invoke` inlines (base64) into a result. */\nexport const INVOKE_MAX_INLINE_BYTES = 1024 * 1024;\n\n/**\n * A `download` yields a raw Buffer, which JSON-serialises as\n * `{\"type\":\"Buffer\",\"data\":[...]}` (~4x the bytes) — useless to an agent and\n * unbounded. The governed path returns a self-describing, bounded shape: the\n * base64 body up to {@link INVOKE_MAX_INLINE_BYTES}, metadata only above it.\n * Programmatic callers that need the Buffer call `client.<resource>.download`.\n */\nfunction bufferResult(buf: Buffer): Record<string, unknown> {\n if (buf.byteLength <= INVOKE_MAX_INLINE_BYTES) {\n return { encoding: 'base64', byteLength: buf.byteLength, truncated: false, data: buf.toString('base64') };\n }\n return {\n encoding: 'base64',\n byteLength: buf.byteLength,\n truncated: true,\n note: `Body exceeds the ${INVOKE_MAX_INLINE_BYTES}-byte inline limit and was not returned; call the resource's download method directly.`,\n };\n}\n\n/**\n * Invoke one registry operation through its typed SDK method — the legacy\n * path (programmatic escape hatch). The mode is derived from the registry\n * record, so the cross-mode check never fires: the behavior is exactly the\n * pre-split governor (dry-run-first + confirm), bit-for-bit.\n */\nexport async function invoke(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: undefined });\n}\n\n/**\n * `autotask_read` (SDK form): route an `effect=read` operation. A write or\n * destructive op refuses PRE-REQUEST (zero wire); a read with `dryRun: true`\n * refuses (reads have no dry run).\n */\nexport async function invokeRead(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: 'read' });\n}\n\n/**\n * `autotask_write` (SDK form): route an `effect=write` operation, dry-run-\n * first (the governed `dryRun ?? true`). A read or destructive op refuses\n * PRE-REQUEST; the 3 approval-gated writes additionally need\n * `confirm === operation`.\n */\nexport async function invokeWrite(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: 'write' });\n}\n\n/**\n * `autotask_delete` (SDK form): route an `effect=destructive` operation.\n * `confirm === operation` is REQUIRED for every delete (in BOTH dry-run and\n * apply mode); a read or write op refuses PRE-REQUEST.\n */\nexport async function invokeDelete(\n client: AutotaskClient,\n operation: string,\n args: readonly unknown[] = [],\n opts: InvokeOptions = {},\n): Promise<unknown> {\n return invokeMode(client, operation, args, { ...opts, mode: 'delete' });\n}\n"]}