@cursor/july 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channels/slack/channel-watch.d.ts +19 -3
- package/dist/channels/slack/channel-watch.d.ts.map +1 -1
- package/dist/channels/slack/channel-watch.js +48 -9
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +4 -4
- package/dist/channels/slack/types.d.ts +11 -12
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.9eAtsjAM.js → app.D23Y-7Tp.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.CzCCM7N8.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.C9s69nxj.js → VPLocalSearchBox.CWBeTFRZ.js} +1 -1
- package/dist/docs/assets/chunks/{arc.DmWDRaF-.js → arc.DSF2O3pm.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.BE1Wj4f3.js → architectureDiagram-Q4EWVU46.J52Wzbkg.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.pmEZGnWu.js → baseUniq.CQS3LPCt.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.D6mM-5XN.js → blockDiagram-DXYQGD6D.Dw339Gr5.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.ZQYTPC1b.js → c4Diagram-AHTNJAMY.BUdtOaRZ.js} +1 -1
- package/dist/docs/assets/chunks/channel.Bfu4df88.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CKJ7gaK8.js → chunk-4BX2VUAB.CuOrkEqk.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.CL61HnvB.js → chunk-4TB4RGXK.BJNBcY7U.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.DsA4XA1m.js → chunk-55IACEB6.VJK5LAm_.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BODHCHFW.js → chunk-EDXVE4YY.BYYLihvj.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.D6NBaZTa.js → chunk-FMBD7UC4.CmoW8BXP.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.BLPuqFXg.js → chunk-OYMX7WX6.DTGY4C-M.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BFs_ML8Z.js → chunk-QZHKN3VN.Cg5n67vl.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BDjuFyZv.js → chunk-YZCP3GAM.C3GR_ia5.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DdfgtaWs.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DdfgtaWs.js +1 -0
- package/dist/docs/assets/chunks/clone.rkmfti6d.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.D85HNEsi.js → cose-bilkent-S5V4N54A.BTRG8N3b.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.V463KlSF.js → dagre-KV5264BT.Bob_bp_p.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DhBDu1ab.js → diagram-5BDNPKRD.ggPcs9uO.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.v6sC68zl.js → diagram-G4DWMVQ6.BP0qyJkp.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.DhHsdXYv.js → diagram-MMDJMWI5.B0X24UKr.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.BPWNSFZc.js → diagram-TYMM5635.B4rXHFVt.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.Cq0wTMPL.js → erDiagram-SMLLAGMA._55Rt9oX.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.MveMtucC.js → flowDiagram-DWJPFMVM.DGP4XvR5.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.BzKfGUSf.js → ganttDiagram-T4ZO3ILL.BtXtkL4E.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.OToXTSW_.js → gitGraphDiagram-UUTBAWPF.B9cPWblK.js} +1 -1
- package/dist/docs/assets/chunks/{graph.D82tam-l.js → graph.D8HzNexS.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DzFlRmcE.js → infoDiagram-42DDH7IO.Bw7CQUpi.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.CVPRJiKe.js → ishikawaDiagram-UXIWVN3A.MwkzF6nQ.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CQvNTfQC.js → journeyDiagram-VCZTEJTY.DIGFF-3C.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.BwywywUl.js → kanban-definition-6JOO6SKY.DhYef2BN.js} +1 -1
- package/dist/docs/assets/chunks/{layout.C4BkPPba.js → layout.C0XUxuPi.js} +1 -1
- package/dist/docs/assets/chunks/{linear.FoSfGKD4.js → linear.BwNPpZex.js} +1 -1
- package/dist/docs/assets/chunks/{min.yLh8jqfl.js → min.CwAQdL7z.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.C9Dq2_CN.js → mindmap-definition-QFDTVHPH.pWsSVLsP.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.CiGyBcES.js → pieDiagram-DEJITSTG.BDJ3FbBy.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.1FWea9nj.js → quadrantDiagram-34T5L4WZ.Co80izyB.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.B1q7ntiV.js → requirementDiagram-MS252O5E.JveKw4yx.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.Cpr4oU_k.js → sankeyDiagram-XADWPNL6.B0A7adPi.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.CUK68STn.js → sequenceDiagram-FGHM5R23.d6JZ5Hre.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.zU0yL2m4.js → stateDiagram-FHFEXIEX.DWnL0NQl.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.ZEetPk0E.js +1 -0
- package/dist/docs/assets/chunks/{theme.DhnKd0CD.js → theme.MJTLx0hh.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.CNYoXo3F.js → timeline-definition-GMOUNBTQ.CFS7Ai4c.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DFWH3G9s.js → vennDiagram-DHZGUBPP.CwSlnjCf.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.3gurI8YA.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.7WLkqM7s.js → wardleyDiagram-NUSXRM2D.B_8mvtjh.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.-SyUNgWw.js → xychartDiagram-5P7HB3ND.DtjU5H85.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.DVjNyqq5.js → guides_slack.md.Bjw2r2gL.js} +4 -4
- package/dist/docs/assets/{guides_slack.md.DVjNyqq5.lean.js → guides_slack.md.Bjw2r2gL.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +39 -39
- package/dist/docs/guides/slack.md +15 -7
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +15 -7
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +35 -35
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/pr-autofixer.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/files-backends/cursor-hosted.d.ts +11 -17
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +13 -41
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/artifacts-store.d.ts +11 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -1
- package/dist/internal/artifacts-store.js +113 -18
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +44 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +21 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +26 -0
- package/dist/internal/cursor/store-api-client.d.ts +82 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +227 -0
- package/dist/internal/deploy-manifest.d.ts +8 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +7 -1
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +13 -4
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +13 -15
- package/dist/internal/store-api-protocol.d.ts +134 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +126 -0
- package/dist/memory.d.ts +49 -14
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +193 -74
- package/dist/playground/assets/{index-CX6oTKwz.js → index-Cs0MKsv4.js} +30 -30
- package/dist/playground/index.html +1 -1
- package/dist/reminders.d.ts +1 -1
- package/dist/reminders.d.ts.map +1 -1
- package/dist/types.d.ts +28 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/guides/slack.md +15 -7
- package/package.json +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/channels/slack/channel-watch.ts +57 -8
- package/src/channels/slack/slack-channel.ts +4 -3
- package/src/channels/slack/types.ts +11 -12
- package/src/files-backends/cursor-hosted.ts +31 -68
- package/src/index.ts +1 -0
- package/src/internal/artifacts-store.ts +131 -25
- package/src/internal/cursor/cursor-api-transport.ts +73 -0
- package/src/internal/cursor/hosted-store-secrets.ts +35 -0
- package/src/internal/cursor/store-api-client.ts +360 -0
- package/src/internal/deploy-manifest.ts +15 -0
- package/src/internal/reminder-runner.ts +30 -5
- package/src/internal/session-engine.ts +17 -22
- package/src/internal/store-api-protocol.ts +222 -0
- package/src/memory.ts +240 -93
- package/src/reminders.ts +1 -0
- package/src/types.ts +31 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DjNBgxTF.js +0 -1
- package/dist/docs/assets/chunks/channel.BNF8VK-B.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.iViHzfrK.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.iViHzfrK.js +0 -1
- package/dist/docs/assets/chunks/clone.CJoR2BBM.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.nV8Nl-td.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.Do4PwzeN.js +0 -162
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export { agentStoreMemoryBackend, fileMemoryBackend, memoryHook, } from "./memor
|
|
|
37
37
|
export type { OtelConfig, OtelDefinition, OtelExporterConfig } from "./otel.js";
|
|
38
38
|
export type { PromptTag } from "./prompt.js";
|
|
39
39
|
export { prompt } from "./prompt.js";
|
|
40
|
-
export type { ReminderBusyPolicy, ReminderCreateInput, ReminderDefinition, ReminderFireContext, ReminderFireResult, ReminderHandlerConfig, ReminderHostApi, ReminderInfo, ReminderReschedule, ReminderScheduleKind, ReminderStatus, ReminderTarget, ReminderUntilContext, } from "./reminders.js";
|
|
40
|
+
export type { ReminderBusyPolicy, ReminderCreateInput, ReminderDefinition, ReminderFireContext, ReminderFireResult, ReminderFollowupOptions, ReminderHandlerConfig, ReminderHostApi, ReminderInfo, ReminderReschedule, ReminderScheduleKind, ReminderStatus, ReminderTarget, ReminderUntilContext, } from "./reminders.js";
|
|
41
41
|
export { defineReminder } from "./reminders.js";
|
|
42
42
|
export { defineResult } from "./result.js";
|
|
43
43
|
export { defineSchedule } from "./schedules.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,GAAG,EACH,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,GAAG,EACH,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,OAAO,EACP,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EACN,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB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,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,gBAAgB,CAAC,CAqB3B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,GAAG,EACH,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,GAAG,EACH,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,OAAO,EACP,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EACN,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,sBAAsB,EACtB,MAAM,E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BAAuB,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtB,GACL,OAAO,CAAC,gBAAgB,CAAC,CAqB3B"}
|
|
@@ -46,7 +46,18 @@ export declare class ArtifactsStore {
|
|
|
46
46
|
* parsed output — defaults and coercions applied — is what gets stored.
|
|
47
47
|
*/
|
|
48
48
|
private resolveKindAndData;
|
|
49
|
+
/**
|
|
50
|
+
* Trim to the retention cap from listing metadata alone. Past the cap
|
|
51
|
+
* this runs on every new-row insert, so it must not hydrate row bodies:
|
|
52
|
+
* on the Agent Store that is one read per row (~`max` reads per insert,
|
|
53
|
+
* forever, since eviction trims right back to the cap) — the 2026-09-18
|
|
54
|
+
* read storm on the security-reviewer deployment. The store listing
|
|
55
|
+
* carries last-modified metadata, and a row is rewritten on every upsert,
|
|
56
|
+
* so listing mtime orders rows the same way their `updatedAt` does.
|
|
57
|
+
*/
|
|
49
58
|
private evictPastCap;
|
|
59
|
+
/** The `excess` oldest row ids, cheapest available ordering first. */
|
|
60
|
+
private oldestRowIds;
|
|
50
61
|
}
|
|
51
62
|
/** Deterministic id for a keyed tag (same key ⇒ same id ⇒ upsert). */
|
|
52
63
|
export declare function artifactIdForKey(key: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts-store.d.ts","sourceRoot":"","sources":["../../src/internal/artifacts-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,EAEjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"artifacts-store.d.ts","sourceRoot":"","sources":["../../src/internal/artifacts-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5D,OA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|
|
|
22
22
|
import { resolveArtifactsMax } from "../artifacts.js";
|
|
23
23
|
import { agentStoreKeys } from "../files.js";
|
|
24
24
|
import { cursorHostedFiles, isCursorHostedFilesAvailable, } from "../files-backends/cursor-hosted.js";
|
|
25
|
+
import { mapBounded } from "./bounded.js";
|
|
26
|
+
/**
|
|
27
|
+
* Row-body hydration fan-out cap. `list()` fetches one object per row; on
|
|
28
|
+
* the Agent Store each fetch is a control-plane request, and an unbounded
|
|
29
|
+
* `Promise.all` over ~1k rows is a fleet-visible read burst (the 2026-09-18
|
|
30
|
+
* Agent Store read storm was this exact fan-out, run once per insert by the
|
|
31
|
+
* pre-metadata eviction path).
|
|
32
|
+
*/
|
|
33
|
+
const ROW_HYDRATION_CONCURRENCY = 8;
|
|
25
34
|
/** Kind used by freeform tags when no kinds are declared. */
|
|
26
35
|
export const ARTIFACT_DEFAULT_KIND = "artifact";
|
|
27
36
|
/**
|
|
@@ -148,22 +157,53 @@ export class ArtifactsStore {
|
|
|
148
157
|
}
|
|
149
158
|
return { kind, data: input.data };
|
|
150
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Trim to the retention cap from listing metadata alone. Past the cap
|
|
162
|
+
* this runs on every new-row insert, so it must not hydrate row bodies:
|
|
163
|
+
* on the Agent Store that is one read per row (~`max` reads per insert,
|
|
164
|
+
* forever, since eviction trims right back to the cap) — the 2026-09-18
|
|
165
|
+
* read storm on the security-reviewer deployment. The store listing
|
|
166
|
+
* carries last-modified metadata, and a row is rewritten on every upsert,
|
|
167
|
+
* so listing mtime orders rows the same way their `updatedAt` does.
|
|
168
|
+
*/
|
|
151
169
|
evictPastCap() {
|
|
152
170
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
-
|
|
171
|
+
const metas = yield this.rows.listMeta();
|
|
172
|
+
const excess = metas.length - this.max;
|
|
173
|
+
if (excess <= 0) {
|
|
154
174
|
return;
|
|
155
175
|
}
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
176
|
+
for (const id of yield this.oldestRowIds(metas, excess)) {
|
|
177
|
+
yield this.rows.delete(id);
|
|
178
|
+
// Without the row body there is no `content` flag to consult; delete
|
|
179
|
+
// the payload unconditionally — absent payloads delete as a no-op.
|
|
180
|
+
yield this.content.delete(id);
|
|
159
181
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** The `excess` oldest row ids, cheapest available ordering first. */
|
|
185
|
+
oldestRowIds(metas, excess) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
if (metas.some(meta => meta.mtimeMs !== undefined)) {
|
|
188
|
+
// A store that tracks mtimes must never regress to per-insert
|
|
189
|
+
// hydration. The rare entry missing one (anomalous on such a store)
|
|
190
|
+
// sorts oldest via the comparator's `?? 0` and gets evicted first —
|
|
191
|
+
// evicting an anomaly beats re-reading every row on every insert.
|
|
192
|
+
return metas
|
|
193
|
+
.sort(byOldestModified)
|
|
194
|
+
.slice(0, excess)
|
|
195
|
+
.map(meta => meta.id);
|
|
166
196
|
}
|
|
197
|
+
// A store that tracks no modification times at all (the local
|
|
198
|
+
// filesystem store, deliberately) leaves only the rows' own
|
|
199
|
+
// `updatedAt`: hydrate — bounded — and order exactly. Corrupt rows
|
|
200
|
+
// drop out of `list()`, so recompute the excess against the rows that
|
|
201
|
+
// actually parsed.
|
|
202
|
+
const records = yield this.rows.list();
|
|
203
|
+
return records
|
|
204
|
+
.sort((a, b) => byNewestUpdated(b, a))
|
|
205
|
+
.slice(0, Math.max(0, records.length - this.max))
|
|
206
|
+
.map(record => record.id);
|
|
167
207
|
});
|
|
168
208
|
}
|
|
169
209
|
}
|
|
@@ -174,6 +214,18 @@ export function artifactIdForKey(key) {
|
|
|
174
214
|
}
|
|
175
215
|
return `art_${createHash("sha256").update(key, "utf8").digest("hex").slice(0, 32)}`;
|
|
176
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Oldest-modified first. Store mtimes can be coarse (S3 rounds to the
|
|
219
|
+
* second), so equal stamps tie-break by id — deterministic, and within a
|
|
220
|
+
* same-stamp cohort any victim is equally past the retention cap.
|
|
221
|
+
*/
|
|
222
|
+
function byOldestModified(a, b) {
|
|
223
|
+
var _a, _b;
|
|
224
|
+
if (a.mtimeMs !== b.mtimeMs) {
|
|
225
|
+
return ((_a = a.mtimeMs) !== null && _a !== void 0 ? _a : 0) - ((_b = b.mtimeMs) !== null && _b !== void 0 ? _b : 0);
|
|
226
|
+
}
|
|
227
|
+
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
228
|
+
}
|
|
177
229
|
function byNewestUpdated(a, b) {
|
|
178
230
|
if (a.updatedAt !== b.updatedAt) {
|
|
179
231
|
return a.updatedAt < b.updatedAt ? 1 : -1;
|
|
@@ -245,7 +297,7 @@ function createSinkRowStore(sink, agentName) {
|
|
|
245
297
|
list() {
|
|
246
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
247
299
|
const entries = yield sink.list(agentStoreKeys.artifactRowPrefix(agentName));
|
|
248
|
-
const bodies = yield
|
|
300
|
+
const bodies = yield mapBounded(entries, ROW_HYDRATION_CONCURRENCY, entry => sink.get(entry.key));
|
|
249
301
|
const records = [];
|
|
250
302
|
for (const body of bodies) {
|
|
251
303
|
const record = parseRecordBytes(sinkBody(body));
|
|
@@ -256,14 +308,43 @@ function createSinkRowStore(sink, agentName) {
|
|
|
256
308
|
return records;
|
|
257
309
|
});
|
|
258
310
|
},
|
|
259
|
-
|
|
311
|
+
listMeta() {
|
|
260
312
|
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
-
const
|
|
262
|
-
|
|
313
|
+
const prefix = agentStoreKeys.artifactRowPrefix(agentName);
|
|
314
|
+
const metas = [];
|
|
315
|
+
for (const entry of yield sink.list(prefix)) {
|
|
316
|
+
const id = rowIdFromName(entry.key.slice(prefix.length));
|
|
317
|
+
if (id !== undefined) {
|
|
318
|
+
metas.push({ id, mtimeMs: entry.mtimeMs });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return metas;
|
|
263
322
|
});
|
|
264
323
|
},
|
|
265
324
|
};
|
|
266
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Invert the row naming scheme (`encodeURIComponent(id) + ".json"`).
|
|
328
|
+
* Foreign keys under the prefix — no `.json` suffix, malformed escapes,
|
|
329
|
+
* non-canonical encodings — read as absent rather than throwing. The
|
|
330
|
+
* round-trip check matters for eviction: a name that decodes but does not
|
|
331
|
+
* re-encode to itself (`a+b.json`, `foo bar.json`) would count toward the
|
|
332
|
+
* cap yet be undeletable through `key(id)`, leaving a phantom victim that
|
|
333
|
+
* every subsequent insert re-selects and fails to remove.
|
|
334
|
+
*/
|
|
335
|
+
function rowIdFromName(name) {
|
|
336
|
+
if (!name.endsWith(".json") || name.includes("/")) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
const encoded = name.slice(0, -".json".length);
|
|
340
|
+
try {
|
|
341
|
+
const id = decodeURIComponent(encoded);
|
|
342
|
+
return encodeURIComponent(id) === encoded ? id : undefined;
|
|
343
|
+
}
|
|
344
|
+
catch (_a) {
|
|
345
|
+
return undefined;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
267
348
|
function createSinkContentStore(sink, agentName) {
|
|
268
349
|
const key = (id) => agentStoreKeys.artifactContent(agentName, id);
|
|
269
350
|
return {
|
|
@@ -344,18 +425,32 @@ function createFilesystemRowStore(stateRoot) {
|
|
|
344
425
|
return records;
|
|
345
426
|
});
|
|
346
427
|
},
|
|
347
|
-
|
|
428
|
+
listMeta() {
|
|
348
429
|
return __awaiter(this, void 0, void 0, function* () {
|
|
430
|
+
// No mtimes on purpose: local rows are cheap to hydrate, and the
|
|
431
|
+
// rows' own `updatedAt` orders eviction exactly, immune to coarse
|
|
432
|
+
// filesystem timestamp granularity.
|
|
433
|
+
let names;
|
|
349
434
|
try {
|
|
350
|
-
|
|
351
|
-
return names.filter(name => !name.startsWith(".") && name.endsWith(".json")).length;
|
|
435
|
+
names = yield readdir(dir);
|
|
352
436
|
}
|
|
353
437
|
catch (error) {
|
|
354
438
|
if (error.code === "ENOENT") {
|
|
355
|
-
return
|
|
439
|
+
return [];
|
|
356
440
|
}
|
|
357
441
|
throw error;
|
|
358
442
|
}
|
|
443
|
+
const metas = [];
|
|
444
|
+
for (const name of names) {
|
|
445
|
+
if (name.startsWith(".")) {
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
448
|
+
const id = rowIdFromName(name);
|
|
449
|
+
if (id !== undefined) {
|
|
450
|
+
metas.push({ id });
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return metas;
|
|
359
454
|
});
|
|
360
455
|
},
|
|
361
456
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one resolution of "which Cursor control plane, as whom" for hosted
|
|
3
|
+
* transports. The verb-lane files sink (`files-backends/cursor-hosted.ts`)
|
|
4
|
+
* and the domain-lane store API client (`store-api-client.ts`) both build on
|
|
5
|
+
* these, so the pod credential and base URL resolve identically on every
|
|
6
|
+
* wire — one place to change, no drift between lanes.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Same default as the hosted storage backend, inlined so these entrypoints
|
|
10
|
+
* do not import CLI code.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
13
|
+
export interface CursorApiTransportOptions {
|
|
14
|
+
/** Control-plane base URL (default: `CURSOR_API_BASE_URL`, else api.cursor.com). */
|
|
15
|
+
baseUrl?: string;
|
|
16
|
+
/** Bearer credential (default: `CURSOR_API_KEY`). */
|
|
17
|
+
apiKey?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Lazy credential, re-resolved on every call and preferred over
|
|
20
|
+
* {@link apiKey} — hosted freeze snapshots listen unsigned and bind the
|
|
21
|
+
* key file after serve start. Kept separate so `apiKey` stays a plain
|
|
22
|
+
* string.
|
|
23
|
+
*/
|
|
24
|
+
resolveApiKey?: () => string | undefined;
|
|
25
|
+
/** Test seam; defaults to global fetch. */
|
|
26
|
+
fetch?: typeof fetch;
|
|
27
|
+
}
|
|
28
|
+
export declare function resolveCursorApiBaseUrl(options: CursorApiTransportOptions): string;
|
|
29
|
+
/**
|
|
30
|
+
* The pod credential is the whole authorization on every hosted wire: the
|
|
31
|
+
* API resolves the caller's deployment from it, so there is no second,
|
|
32
|
+
* narrower credential to manage. Fails loudly rather than defaulting —
|
|
33
|
+
* calling the control plane as nobody is worse than not calling.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveCursorApiKey(options: CursorApiTransportOptions): string;
|
|
36
|
+
export declare function resolveCursorApiFetch(options: CursorApiTransportOptions): typeof fetch;
|
|
37
|
+
//# sourceMappingURL=cursor-api-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-api-transport.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/cursor-api-transport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,2BAA2B,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACzC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAOD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,GACjC,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,yBAAyB,GACjC,MAAM,CASR;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,yBAAyB,GACjC,OAAO,KAAK,CAMd"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one resolution of "which Cursor control plane, as whom" for hosted
|
|
3
|
+
* transports. The verb-lane files sink (`files-backends/cursor-hosted.ts`)
|
|
4
|
+
* and the domain-lane store API client (`store-api-client.ts`) both build on
|
|
5
|
+
* these, so the pod credential and base URL resolve identically on every
|
|
6
|
+
* wire — one place to change, no drift between lanes.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Same default as the hosted storage backend, inlined so these entrypoints
|
|
10
|
+
* do not import CLI code.
|
|
11
|
+
*/
|
|
12
|
+
export const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
13
|
+
function trimTrailingSlash(raw) {
|
|
14
|
+
const trimmed = raw.trim();
|
|
15
|
+
return trimmed.endsWith("/") ? trimmed.slice(0, -1) : trimmed;
|
|
16
|
+
}
|
|
17
|
+
export function resolveCursorApiBaseUrl(options) {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return trimTrailingSlash((_b = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : process.env.CURSOR_API_BASE_URL) !== null && _b !== void 0 ? _b : DEFAULT_CURSOR_EXTERNAL_API_URL);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The pod credential is the whole authorization on every hosted wire: the
|
|
23
|
+
* API resolves the caller's deployment from it, so there is no second,
|
|
24
|
+
* narrower credential to manage. Fails loudly rather than defaulting —
|
|
25
|
+
* calling the control plane as nobody is worse than not calling.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveCursorApiKey(options) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
var _c;
|
|
30
|
+
const configured = (_c = (_a = options.resolveApiKey) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _c !== void 0 ? _c : options.apiKey;
|
|
31
|
+
const key = (_b = (configured !== null && configured !== void 0 ? configured : process.env.CURSOR_API_KEY)) === null || _b === void 0 ? void 0 : _b.trim();
|
|
32
|
+
if (key === undefined || key === "") {
|
|
33
|
+
throw new Error("Cursor hosted transport requires CURSOR_API_KEY (deployment pod credential on Cursor hosting)");
|
|
34
|
+
}
|
|
35
|
+
return key;
|
|
36
|
+
}
|
|
37
|
+
export function resolveCursorApiFetch(options) {
|
|
38
|
+
var _a;
|
|
39
|
+
const impl = (_a = options.fetch) !== null && _a !== void 0 ? _a : globalThis.fetch;
|
|
40
|
+
if (typeof impl !== "function") {
|
|
41
|
+
throw new Error("Cursor hosted transport requires fetch");
|
|
42
|
+
}
|
|
43
|
+
return impl;
|
|
44
|
+
}
|
|
@@ -16,6 +16,27 @@ export declare const DEFAULT_AGENT_SERVE_STORE_PROTOCOL_FILE = "/run/cursor/secr
|
|
|
16
16
|
* directions.
|
|
17
17
|
*/
|
|
18
18
|
export declare const AGENT_SERVE_FACTORY_FLUSH_PROTOCOL = "factory-flush-v1";
|
|
19
|
+
/**
|
|
20
|
+
* Pin value additionally enabling the domain-call lane
|
|
21
|
+
* (`POST /internal/agentsdk/store/api/<call>`), where the server owns the
|
|
22
|
+
* storage pattern for framework state — starting with `memory.append`. A
|
|
23
|
+
* strict superset of {@link AGENT_SERVE_FACTORY_FLUSH_PROTOCOL}: verbs keep
|
|
24
|
+
* riding the factory flush wire under this pin too. The same fail-safe
|
|
25
|
+
* applies in both directions — an unknown value keeps today's behavior, and
|
|
26
|
+
* re-pinning to `factory-flush-v1` turns the domain lane back off without a
|
|
27
|
+
* client change.
|
|
28
|
+
*/
|
|
29
|
+
export declare const AGENT_SERVE_FACTORY_API_PROTOCOL = "factory-api-v1";
|
|
30
|
+
/**
|
|
31
|
+
* Does this pin select the factory flush wire for the store verbs? True for
|
|
32
|
+
* the flush pin and for the domain-API superset pin.
|
|
33
|
+
*/
|
|
34
|
+
export declare function storeProtocolEnablesFactoryFlush(protocol: string | undefined): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Does this pin enable the domain-call lane (server-owned storage patterns)?
|
|
37
|
+
* Only its exact value does; everything else keeps the client-side patterns.
|
|
38
|
+
*/
|
|
39
|
+
export declare function storeProtocolEnablesStoreApi(protocol: string | undefined): boolean;
|
|
19
40
|
/** Deployment user-land store: env, then task-bind file. */
|
|
20
41
|
export declare function resolveDeploymentStoreSourceIdSync(env?: NodeJS.ProcessEnv): string | undefined;
|
|
21
42
|
/** Engine framework store: env, then task-bind file. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AAE9D,eAAO,MAAM,uCAAuC,mDACF,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"hosted-store-secrets.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/hosted-store-secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,wCAAwC,oDACF,CAAC;AAEpD,eAAO,MAAM,kDAAkD,8DACF,CAAC;AAE9D,eAAO,MAAM,uCAAuC,mDACF,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,qBAAqB,CAAC;AAErE;;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC,mBAAmB,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAKT;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,OAAO,CAET;AA8BD,4DAA4D;AAC5D,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,wDAAwD;AACxD,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAUpB;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,uBAAuB,CAYzB"}
|
|
@@ -17,6 +17,32 @@ export const DEFAULT_AGENT_SERVE_STORE_PROTOCOL_FILE = "/run/cursor/secrets/AGEN
|
|
|
17
17
|
* directions.
|
|
18
18
|
*/
|
|
19
19
|
export const AGENT_SERVE_FACTORY_FLUSH_PROTOCOL = "factory-flush-v1";
|
|
20
|
+
/**
|
|
21
|
+
* Pin value additionally enabling the domain-call lane
|
|
22
|
+
* (`POST /internal/agentsdk/store/api/<call>`), where the server owns the
|
|
23
|
+
* storage pattern for framework state — starting with `memory.append`. A
|
|
24
|
+
* strict superset of {@link AGENT_SERVE_FACTORY_FLUSH_PROTOCOL}: verbs keep
|
|
25
|
+
* riding the factory flush wire under this pin too. The same fail-safe
|
|
26
|
+
* applies in both directions — an unknown value keeps today's behavior, and
|
|
27
|
+
* re-pinning to `factory-flush-v1` turns the domain lane back off without a
|
|
28
|
+
* client change.
|
|
29
|
+
*/
|
|
30
|
+
export const AGENT_SERVE_FACTORY_API_PROTOCOL = "factory-api-v1";
|
|
31
|
+
/**
|
|
32
|
+
* Does this pin select the factory flush wire for the store verbs? True for
|
|
33
|
+
* the flush pin and for the domain-API superset pin.
|
|
34
|
+
*/
|
|
35
|
+
export function storeProtocolEnablesFactoryFlush(protocol) {
|
|
36
|
+
return (protocol === AGENT_SERVE_FACTORY_FLUSH_PROTOCOL ||
|
|
37
|
+
protocol === AGENT_SERVE_FACTORY_API_PROTOCOL);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Does this pin enable the domain-call lane (server-owned storage patterns)?
|
|
41
|
+
* Only its exact value does; everything else keeps the client-side patterns.
|
|
42
|
+
*/
|
|
43
|
+
export function storeProtocolEnablesStoreApi(protocol) {
|
|
44
|
+
return protocol === AGENT_SERVE_FACTORY_API_PROTOCOL;
|
|
45
|
+
}
|
|
20
46
|
const STORE_SOURCE_ID_ENV = "AGENT_SERVE_STORE_SOURCE_ID";
|
|
21
47
|
const FRAMEWORK_STORE_SOURCE_ID_ENV = "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
|
|
22
48
|
const STORE_SOURCE_ID_FILE_ENV = "AGENT_SERVE_STORE_SOURCE_ID_FILE";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The store API client: July's one gateway to the factory domain-call lane,
|
|
3
|
+
* `POST /internal/agentsdk/store/api/<call>`. This module owns the whole
|
|
4
|
+
* transport — base URL and deployment credential (the same resolution the
|
|
5
|
+
* files sink uses, via `cursor-api-transport.ts`), envelope encoding,
|
|
6
|
+
* response validation, typed error mapping, and the bounded backoff policy.
|
|
7
|
+
* Feature modules (`memory.ts`, later `session-run-log.ts`, …) call typed
|
|
8
|
+
* methods like {@link StoreApiClient.memoryAppend} and never hand-roll
|
|
9
|
+
* fetch; future domain calls (`sessionRun.report`, `startLog.flush`, …) are
|
|
10
|
+
* added here as new methods on this one client.
|
|
11
|
+
*
|
|
12
|
+
* The lane is selected per pod by the task-bound store protocol pin:
|
|
13
|
+
* {@link isStoreApiLaneEnabled} is true only under the exact
|
|
14
|
+
* `factory-api-v1` pin AND with a provisioned deployment store. The
|
|
15
|
+
* availability check is not redundant: the pin file is written by the hosted
|
|
16
|
+
* task bind, but a local-dev env var could name the pin without any store to
|
|
17
|
+
* serve reads — appending into the void. Both resolve lazily per call, so a
|
|
18
|
+
* pin bound after serve start takes effect without a restart.
|
|
19
|
+
*/
|
|
20
|
+
import { type CursorApiTransportOptions } from "./cursor-api-transport.js";
|
|
21
|
+
export interface StoreApiClientOptions extends CursorApiTransportOptions {
|
|
22
|
+
/** Deployment store source id override (lane availability check). */
|
|
23
|
+
storeSourceId?: string;
|
|
24
|
+
/** Lazy store source id, preferred over {@link storeSourceId}. */
|
|
25
|
+
resolveStoreSourceId?: () => string | undefined;
|
|
26
|
+
/** Lazy store protocol pin (default: env, then the task-bound file). */
|
|
27
|
+
resolveStoreProtocol?: () => string | undefined;
|
|
28
|
+
/** Backoff sleep override (tests). */
|
|
29
|
+
sleep?: (ms: number) => Promise<void>;
|
|
30
|
+
/** Jitter source override (tests). Returns [0, 1). */
|
|
31
|
+
random?: () => number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* How one domain call failed, after the client's bounded retries:
|
|
35
|
+
*
|
|
36
|
+
* - `rejected` — the server (or the client's own pre-check) refused the
|
|
37
|
+
* payload with a typed 4xx. Deterministic; never retried.
|
|
38
|
+
* - `shed` — 429 from the per-deployment limiter or kill switch. Retried
|
|
39
|
+
* only within the small Retry-After bound below; retrying harder against
|
|
40
|
+
* a shed is exactly the stampede the domain lane exists to prevent.
|
|
41
|
+
* - `unavailable` — 5xx or a network failure, retried up to the attempt
|
|
42
|
+
* bound.
|
|
43
|
+
* - `bad_response` — a 2xx whose body failed the response schema; a
|
|
44
|
+
* contract break, not a transient, so never retried.
|
|
45
|
+
*/
|
|
46
|
+
export type StoreApiFailureKind = "rejected" | "shed" | "unavailable" | "bad_response";
|
|
47
|
+
export declare class StoreApiCallError extends Error {
|
|
48
|
+
readonly kind: StoreApiFailureKind;
|
|
49
|
+
readonly status?: number | undefined;
|
|
50
|
+
constructor(kind: StoreApiFailureKind, message: string, status?: number | undefined);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Is the domain-call lane on for this pod? Exact pin match plus a
|
|
54
|
+
* provisioned deployment store; anything else keeps the client-side
|
|
55
|
+
* patterns, fail-safe in both directions like the flush pin itself.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isStoreApiLaneEnabled(options?: StoreApiClientOptions): boolean;
|
|
58
|
+
export type StoreApiClient = {
|
|
59
|
+
/**
|
|
60
|
+
* One `memory.append` domain call: the server appends the record to a
|
|
61
|
+
* server-owned journal shard. Resolves on success; throws
|
|
62
|
+
* {@link StoreApiCallError} after the bounded retries. The caller owns the
|
|
63
|
+
* failure policy (memory drops the record — appending is advisory).
|
|
64
|
+
*/
|
|
65
|
+
memoryAppend(payload: {
|
|
66
|
+
agent: string;
|
|
67
|
+
record: Record<string, unknown>;
|
|
68
|
+
}): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* One `memory.read` domain call plus the presigned byte fetch: the server
|
|
71
|
+
* flushes the agent's pending append buffer (best-effort) and presigns
|
|
72
|
+
* the canonical journal; this method then downloads it. Undefined while
|
|
73
|
+
* the agent has no journal. Throws {@link StoreApiCallError} after the
|
|
74
|
+
* bounded retries — the caller owns the failure policy (hydration keeps
|
|
75
|
+
* the existing mirror).
|
|
76
|
+
*/
|
|
77
|
+
memoryReadContent(payload: {
|
|
78
|
+
agent: string;
|
|
79
|
+
}): Promise<Uint8Array | undefined>;
|
|
80
|
+
};
|
|
81
|
+
export declare function createStoreApiClient(options?: StoreApiClientOptions): StoreApiClient;
|
|
82
|
+
//# sourceMappingURL=store-api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-api-client.d.ts","sourceRoot":"","sources":["../../../src/internal/cursor/store-api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,OAAO,EACL,KAAK,yBAAyB,EAI/B,MAAM,2BAA2B,CAAC;AAOnC,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,oBAAoB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAChD,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