@cursor/july 0.1.108 → 0.1.109
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/AGENTS.md +2 -6
- package/README.md +3 -6
- package/dist/channels/bitbucket/api.d.ts +41 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -1
- package/dist/channels/bitbucket/api.js +260 -0
- package/dist/channels/bitbucket/binding.d.ts +4 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -1
- package/dist/channels/bitbucket/binding.js +16 -0
- package/dist/channels/bitbucket/index.d.ts +1 -1
- package/dist/channels/bitbucket/index.d.ts.map +1 -1
- package/dist/channels/bitbucket/index.js +1 -1
- package/dist/channels/gitlab/api.d.ts +27 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -1
- package/dist/channels/gitlab/api.js +88 -0
- package/dist/channels/gitlab/binding.d.ts +5 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -1
- package/dist/channels/gitlab/binding.js +10 -0
- package/dist/channels/gitlab/index.d.ts +1 -1
- package/dist/channels/gitlab/index.d.ts.map +1 -1
- package/dist/channels/gitlab/index.js +1 -1
- package/dist/channels/slack/dispatch.d.ts +10 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +20 -3
- package/dist/channels/slack/slack-channel.d.ts +12 -5
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +59 -8
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.BASKM3M4.js → app.Cr-wVbnB.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.js → building-with-agents.md.D0KbSkJn.js} +2 -2
- package/dist/docs/assets/{building-with-agents.md.CUSWxlP_.lean.js → building-with-agents.md.D0KbSkJn.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CFVQ4S17.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BOKxlYGP.js → VPLocalSearchBox.CVQERt56.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DbDZW-zb.js → theme.Dnsd3XOn.js} +2 -2
- package/dist/docs/assets/concepts.md.B4o63Gul.js +1 -0
- package/dist/docs/assets/evals.md.C7JLjoEP.js +211 -0
- package/dist/docs/assets/evals.md.C7JLjoEP.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.js +10 -0
- package/dist/docs/assets/guides_bitbucket.md.DZPzmUjU.lean.js +1 -0
- package/dist/docs/assets/{guides_github.md.BH33UEBJ.js → guides_github.md.TZaTZlfz.js} +13 -3
- package/dist/docs/assets/{guides_github.md.BH33UEBJ.lean.js → guides_github.md.TZaTZlfz.lean.js} +1 -1
- package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.js +14 -0
- package/dist/docs/assets/guides_gitlab.md.BmqwQfdG.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.js → guides_webhooks.md.CJK484ex.js} +2 -2
- package/dist/docs/assets/{hillclimbing.md.CpTGTCle.js → hillclimbing.md.BOiVo1tf.js} +1 -1
- package/dist/docs/assets/index.md.DD9Q2XuJ.js +5 -0
- package/dist/docs/assets/{index.md.BjH1w2ZW.lean.js → index.md.DD9Q2XuJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_channels.md.D-qTqwcq.js → reference_channels.md.CAo-iK4j.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.D-qTqwcq.lean.js → reference_channels.md.CAo-iK4j.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Ca26u0Es.js → reference_cli.md.Deg7849l.js} +1 -1
- package/dist/docs/assets/{reference_extensions.md.CPWt00ds.js → reference_extensions.md.ZAVUyuEX.js} +2 -2
- package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.js → reference_hooks.md.BlM_bOg6.js} +3 -3
- package/dist/docs/assets/{reference_hooks.md.Ddt5DdgJ.lean.js → reference_hooks.md.BlM_bOg6.lean.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.oySXBO8o.js → reference_http-api.md.BwaCo-VO.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.4myJPxrf.js → reference_playground.md.DLnoaczX.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.4myJPxrf.lean.js → reference_playground.md.DLnoaczX.lean.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.js → reference_project-layout.md.BEU8MtQV.js} +3 -3
- package/dist/docs/assets/{reference_project-layout.md.DuBu9a96.lean.js → reference_project-layout.md.BEU8MtQV.lean.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.CyXV1MUw.js +1 -0
- package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.js +35 -0
- package/dist/docs/assets/skills_deploy.md.CWqi_ZxW.lean.js +1 -0
- package/dist/docs/assets/{skills_evals.md.BhovOvrl.js → skills_evals.md.DFxYPErF.js} +3 -3
- package/dist/docs/assets/skills_evals.md.DFxYPErF.lean.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.D-tFZhFS.js → skills_framework-map.md.BxLSOhSY.js} +1 -1
- package/dist/docs/assets/skills_index.md.DL7EHaQ-.js +1 -0
- package/dist/docs/assets/skills_index.md.DL7EHaQ-.lean.js +1 -0
- package/dist/docs/assets/{storage.md.BOHeqk2M.js → storage.md.BUrhJ-Zz.js} +4 -4
- package/dist/docs/assets/{storage.md.BOHeqk2M.lean.js → storage.md.BUrhJ-Zz.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +5 -5
- package/dist/docs/building-with-agents.md +3 -2
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +2 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +161 -35
- package/dist/docs/evals.md +612 -297
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/bitbucket.html +36 -0
- package/dist/docs/guides/bitbucket.md +84 -0
- package/dist/docs/guides/cloud-agents.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +17 -7
- package/dist/docs/guides/github.md +31 -0
- package/dist/docs/guides/gitlab.html +40 -0
- package/dist/docs/guides/gitlab.md +92 -0
- package/dist/docs/guides/grokbot-agents.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/improve.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +5 -5
- package/dist/docs/guides/webhooks.html +6 -6
- package/dist/docs/guides/webhooks.md +4 -2
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +2 -2
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +10 -6
- package/dist/docs/llms-full.txt +1113 -778
- package/dist/docs/llms.txt +6 -5
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +16 -3
- package/dist/docs/reference/cli.html +6 -6
- package/dist/docs/reference/cli.md +6 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +7 -7
- package/dist/docs/reference/extensions.md +0 -3
- package/dist/docs/reference/hooks.html +7 -7
- package/dist/docs/reference/hooks.md +9 -12
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +2 -3
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +0 -4
- package/dist/docs/reference/project-layout.html +7 -7
- package/dist/docs/reference/project-layout.md +1 -8
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +1 -2
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/deploy.html +61 -0
- package/dist/docs/skills/deploy.md +161 -0
- package/dist/docs/skills/evals.html +8 -8
- package/dist/docs/skills/evals.md +44 -6
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +1 -2
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +6 -6
- package/dist/docs/skills/index.md +1 -1
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +4 -4
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +8 -8
- package/dist/docs/storage.md +15 -24
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/grokbot-agents.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/extensions.d.ts +2 -3
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +2 -5
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/internal/authored-alias-hooks.d.ts +5 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +17 -0
- package/dist/internal/authored-loaders.d.ts +4 -0
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +21 -2
- package/dist/internal/cli-ax.d.ts +1 -2
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +1 -2
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +2 -2
- package/dist/internal/continuation-identity.js +8 -3
- package/dist/internal/discovery/agent.d.ts +1 -1
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +0 -5
- package/dist/internal/discovery/extension-overlay.d.ts +1 -2
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -1
- package/dist/internal/discovery/extension-overlay.js +0 -14
- package/dist/internal/discovery/extensions.d.ts +1 -2
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +4 -22
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +42 -24
- package/dist/internal/discovery/modules.js +0 -1
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +0 -16
- package/dist/internal/eval-runner.js +0 -1
- package/dist/internal/framework-file-storage.d.ts +4 -5
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +4 -5
- package/dist/internal/framework-storage-selection.d.ts +2 -2
- package/dist/internal/framework-storage-selection.js +2 -2
- package/dist/internal/init-scaffold.d.ts.map +1 -1
- package/dist/internal/init-scaffold.js +1 -2
- package/dist/internal/install-cursor-skills.d.ts +5 -2
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +25 -5
- package/dist/internal/run-client.d.ts +1 -1
- package/dist/internal/sdk-runner.js +1 -1
- package/dist/internal/server.js +0 -14
- package/dist/internal/session-engine.d.ts +5 -35
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +17 -162
- package/dist/internal/storage-coordinator.d.ts +5 -19
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +3 -62
- package/dist/internal/storage-roles.d.ts +4 -9
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/storage-roles.js +2 -2
- package/dist/playground/assets/index-Bhxzrcf6.css +1 -0
- package/dist/playground/assets/index-CqLX5uF3.js +67 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +4 -5
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted-v2.js +4 -5
- package/dist/storage-backends/cursor-hosted.d.ts +1 -2
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +0 -30
- package/dist/storage-backends/file-kv.d.ts +9 -12
- package/dist/storage-backends/file-kv.d.ts.map +1 -1
- package/dist/storage-backends/file-kv.js +11 -47
- package/dist/storage-protocol.d.ts +3 -11
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +3 -11
- package/dist/storage.d.ts +8 -36
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +8 -44
- package/dist/types.d.ts +20 -57
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +10 -6
- package/docs/building-with-agents.md +3 -2
- package/docs/concepts.md +2 -4
- package/docs/evals.md +613 -298
- package/docs/guides/bitbucket.md +89 -0
- package/docs/guides/github.md +31 -0
- package/docs/guides/gitlab.md +97 -0
- package/docs/guides/webhooks.md +4 -2
- package/docs/hillclimbing.md +2 -2
- package/docs/reference/channels.md +16 -3
- package/docs/reference/cli.md +6 -4
- package/docs/reference/extensions.md +0 -3
- package/docs/reference/hooks.md +9 -12
- package/docs/reference/http-api.md +2 -3
- package/docs/reference/playground.md +0 -4
- package/docs/reference/project-layout.md +1 -8
- package/docs/reference/sessions.md +1 -2
- package/docs/skills/index.md +2 -2
- package/docs/storage.md +15 -24
- package/package.json +1 -7
- package/skills/deploy/SKILL.md +169 -0
- package/skills/evals/SKILL.md +45 -8
- package/skills/framework-map/SKILL.md +1 -2
- package/src/channels/bitbucket/api.ts +341 -0
- package/src/channels/bitbucket/binding.ts +25 -0
- package/src/channels/bitbucket/index.ts +2 -0
- package/src/channels/gitlab/api.ts +123 -0
- package/src/channels/gitlab/binding.ts +12 -0
- package/src/channels/gitlab/index.ts +1 -0
- package/src/channels/slack/dispatch.ts +30 -0
- package/src/channels/slack/slack-channel.ts +69 -7
- package/src/extensions.ts +2 -6
- package/src/index.ts +0 -3
- package/src/internal/authored-alias-hooks.ts +32 -0
- package/src/internal/authored-loaders.ts +26 -2
- package/src/internal/cli-ax.ts +1 -2
- package/src/internal/continuation-channel.ts +2 -1
- package/src/internal/continuation-identity.ts +10 -2
- package/src/internal/discovery/agent.ts +1 -7
- package/src/internal/discovery/extension-overlay.ts +0 -18
- package/src/internal/discovery/extensions.ts +2 -26
- package/src/internal/discovery/info.ts +3 -13
- package/src/internal/discovery/modules.ts +0 -1
- package/src/internal/discovery/project.ts +0 -16
- package/src/internal/eval-runner.ts +0 -1
- package/src/internal/framework-file-storage.ts +4 -5
- package/src/internal/framework-storage-selection.ts +2 -2
- package/src/internal/init-scaffold.ts +1 -2
- package/src/internal/install-cursor-skills.ts +38 -5
- package/src/internal/run-client.ts +1 -1
- package/src/internal/sdk-runner.ts +1 -1
- package/src/internal/server.ts +0 -16
- package/src/internal/session-engine.ts +14 -202
- package/src/internal/storage-coordinator.ts +5 -76
- package/src/internal/storage-roles.ts +4 -9
- package/src/storage-backends/cursor-hosted-v2.ts +4 -7
- package/src/storage-backends/cursor-hosted.ts +0 -37
- package/src/storage-backends/file-kv.ts +10 -51
- package/src/storage-protocol.ts +3 -17
- package/src/storage.ts +10 -101
- package/src/types.ts +19 -56
- package/templates/demo/README.md +10 -6
- package/templates/demo/agent/channels/github.ts +2 -0
- package/templates/demo/agent/channels/queue.ts +6 -2
- package/templates/demo/agent/lib/repos.ts +5 -0
- package/templates/demo/init.json +25 -0
- package/dist/ab.d.ts +0 -209
- package/dist/ab.d.ts.map +0 -1
- package/dist/ab.js +0 -246
- package/dist/docs/ab.html +0 -80
- package/dist/docs/ab.md +0 -332
- package/dist/docs/assets/ab.md.mlVgqvSk.js +0 -54
- package/dist/docs/assets/ab.md.mlVgqvSk.lean.js +0 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BHZYsNVi.js +0 -1
- package/dist/docs/assets/concepts.md.DgEcZOfT.js +0 -1
- package/dist/docs/assets/evals.md.C1ekS3k2.js +0 -85
- package/dist/docs/assets/evals.md.C1ekS3k2.lean.js +0 -1
- package/dist/docs/assets/index.md.BjH1w2ZW.js +0 -5
- package/dist/docs/assets/reference_sessions.md.CueyOHSL.js +0 -1
- package/dist/docs/assets/skills_ab.md.CsFNatVx.js +0 -26
- package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +0 -1
- package/dist/docs/assets/skills_evals.md.BhovOvrl.lean.js +0 -1
- package/dist/docs/assets/skills_index.md.DKwIxzGg.js +0 -1
- package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +0 -1
- package/dist/docs/skills/ab.html +0 -52
- package/dist/docs/skills/ab.md +0 -50
- package/dist/internal/ab-collector.d.ts +0 -44
- package/dist/internal/ab-collector.d.ts.map +0 -1
- package/dist/internal/ab-collector.js +0 -142
- package/dist/internal/ab-fold.d.ts +0 -36
- package/dist/internal/ab-fold.d.ts.map +0 -1
- package/dist/internal/ab-fold.js +0 -175
- package/dist/internal/ab-snapshot.d.ts +0 -68
- package/dist/internal/ab-snapshot.d.ts.map +0 -1
- package/dist/internal/ab-snapshot.js +0 -208
- package/dist/internal/discovery/ab.d.ts +0 -9
- package/dist/internal/discovery/ab.d.ts.map +0 -1
- package/dist/internal/discovery/ab.js +0 -113
- package/dist/playground/assets/index-BMDqAeXu.js +0 -67
- package/dist/playground/assets/index-LUgJoWdL.css +0 -1
- package/docs/ab.md +0 -337
- package/skills/ab/SKILL.md +0 -58
- package/src/ab.ts +0 -430
- package/src/internal/ab-collector.ts +0 -200
- package/src/internal/ab-fold.ts +0 -232
- package/src/internal/ab-snapshot.ts +0 -331
- package/src/internal/discovery/ab.ts +0 -131
- /package/dist/docs/assets/{concepts.md.DgEcZOfT.lean.js → concepts.md.B4o63Gul.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.DKdA43Qm.lean.js → guides_webhooks.md.CJK484ex.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.CpTGTCle.lean.js → hillclimbing.md.BOiVo1tf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.Ca26u0Es.lean.js → reference_cli.md.Deg7849l.lean.js} +0 -0
- /package/dist/docs/assets/{reference_extensions.md.CPWt00ds.lean.js → reference_extensions.md.ZAVUyuEX.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.oySXBO8o.lean.js → reference_http-api.md.BwaCo-VO.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.CueyOHSL.lean.js → reference_sessions.md.CyXV1MUw.lean.js} +0 -0
- /package/dist/docs/assets/{skills_framework-map.md.D-tFZhFS.lean.js → skills_framework-map.md.BxLSOhSY.lean.js} +0 -0
|
@@ -92,6 +92,35 @@ export interface GitLabClient {
|
|
|
92
92
|
request<T = unknown>(input: GitLabRequestInput): Promise<T>;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export interface GitLabApiMergeRequest {
|
|
96
|
+
iid: number;
|
|
97
|
+
title?: string;
|
|
98
|
+
description?: string;
|
|
99
|
+
state?: string;
|
|
100
|
+
draft?: boolean;
|
|
101
|
+
webUrl?: string;
|
|
102
|
+
headSha?: string;
|
|
103
|
+
sourceBranch?: string;
|
|
104
|
+
targetBranch?: string;
|
|
105
|
+
authorUsername?: string;
|
|
106
|
+
baseSha?: string;
|
|
107
|
+
changedFilesCount?: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface GitLabApiMergeRequestDiff {
|
|
111
|
+
oldPath: string;
|
|
112
|
+
newPath: string;
|
|
113
|
+
patch?: string;
|
|
114
|
+
status: "added" | "modified" | "removed" | "renamed";
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Project-bound merge-request reads shared by GitLab agents. */
|
|
118
|
+
export interface GitLabApi {
|
|
119
|
+
getMergeRequest(iid: number): Promise<GitLabApiMergeRequest>;
|
|
120
|
+
getMergeBaseSha(base: string, headSha: string): Promise<string | undefined>;
|
|
121
|
+
listMergeRequestDiffs(iid: number): Promise<GitLabApiMergeRequestDiff[]>;
|
|
122
|
+
}
|
|
123
|
+
|
|
95
124
|
function envValue(value: string | undefined): string | undefined {
|
|
96
125
|
const trimmed = value?.trim();
|
|
97
126
|
return trimmed === undefined || trimmed === "" ? undefined : trimmed;
|
|
@@ -136,6 +165,100 @@ export function gitlabProjectPathSegment(project: number | string): string {
|
|
|
136
165
|
: encodeURIComponent(project.replace(/^\/+|\/+$/g, ""));
|
|
137
166
|
}
|
|
138
167
|
|
|
168
|
+
function asRecord(value: unknown): Record<string, unknown> | undefined {
|
|
169
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
170
|
+
? (value as Record<string, unknown>)
|
|
171
|
+
: undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function nonEmptyString(value: unknown): string | undefined {
|
|
175
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const GITLAB_DIFFS_PER_PAGE = 100;
|
|
179
|
+
|
|
180
|
+
export function createGitLabApi(
|
|
181
|
+
client: Pick<GitLabClient, "request">,
|
|
182
|
+
project: number | string
|
|
183
|
+
): GitLabApi {
|
|
184
|
+
const projectPath = `/projects/${gitlabProjectPathSegment(project)}`;
|
|
185
|
+
return {
|
|
186
|
+
async getMergeRequest(iid) {
|
|
187
|
+
const raw = await client.request<Record<string, unknown>>({
|
|
188
|
+
method: "GET",
|
|
189
|
+
path: `${projectPath}/merge_requests/${iid}`,
|
|
190
|
+
});
|
|
191
|
+
const diffRefs = asRecord(raw.diff_refs);
|
|
192
|
+
const changesCount = nonEmptyString(raw.changes_count);
|
|
193
|
+
return {
|
|
194
|
+
iid: (raw.iid as number | null | undefined) ?? iid,
|
|
195
|
+
title: raw.title as string | undefined,
|
|
196
|
+
description:
|
|
197
|
+
raw.description === null
|
|
198
|
+
? undefined
|
|
199
|
+
: (raw.description as string | undefined),
|
|
200
|
+
state: raw.state as string | undefined,
|
|
201
|
+
draft:
|
|
202
|
+
typeof raw.draft === "boolean"
|
|
203
|
+
? raw.draft
|
|
204
|
+
: typeof raw.work_in_progress === "boolean"
|
|
205
|
+
? raw.work_in_progress
|
|
206
|
+
: undefined,
|
|
207
|
+
webUrl: raw.web_url as string | undefined,
|
|
208
|
+
headSha:
|
|
209
|
+
(raw.sha as string | null | undefined) ??
|
|
210
|
+
(diffRefs?.head_sha as string | undefined),
|
|
211
|
+
sourceBranch: raw.source_branch as string | undefined,
|
|
212
|
+
targetBranch: raw.target_branch as string | undefined,
|
|
213
|
+
authorUsername: asRecord(raw.author)?.username as string | undefined,
|
|
214
|
+
baseSha: nonEmptyString(diffRefs?.base_sha),
|
|
215
|
+
changedFilesCount:
|
|
216
|
+
changesCount !== undefined && /^\d+$/.test(changesCount)
|
|
217
|
+
? Number(changesCount)
|
|
218
|
+
: undefined,
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
async getMergeBaseSha(base, headSha) {
|
|
222
|
+
const data = await client.request<{ id?: string }>({
|
|
223
|
+
method: "GET",
|
|
224
|
+
path: `${projectPath}/repository/merge_base?refs[]=${encodeURIComponent(base)}&refs[]=${encodeURIComponent(headSha)}`,
|
|
225
|
+
});
|
|
226
|
+
return nonEmptyString(data.id);
|
|
227
|
+
},
|
|
228
|
+
async listMergeRequestDiffs(iid) {
|
|
229
|
+
const files: GitLabApiMergeRequestDiff[] = [];
|
|
230
|
+
for (let page = 1; ; page += 1) {
|
|
231
|
+
const diffs = await client.request<Record<string, unknown>[]>({
|
|
232
|
+
method: "GET",
|
|
233
|
+
path: `${projectPath}/merge_requests/${iid}/diffs`,
|
|
234
|
+
query: { page, per_page: GITLAB_DIFFS_PER_PAGE },
|
|
235
|
+
});
|
|
236
|
+
for (const diff of diffs) {
|
|
237
|
+
const status =
|
|
238
|
+
diff.new_file === true
|
|
239
|
+
? "added"
|
|
240
|
+
: diff.deleted_file === true
|
|
241
|
+
? "removed"
|
|
242
|
+
: diff.renamed_file === true
|
|
243
|
+
? "renamed"
|
|
244
|
+
: "modified";
|
|
245
|
+
const rawPatch =
|
|
246
|
+
typeof diff.diff === "string" ? diff.diff : undefined;
|
|
247
|
+
files.push({
|
|
248
|
+
oldPath: diff.old_path as string,
|
|
249
|
+
newPath: diff.new_path as string,
|
|
250
|
+
status,
|
|
251
|
+
patch: rawPatch?.replace(/\n$/, ""),
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (diffs.length < GITLAB_DIFFS_PER_PAGE) {
|
|
255
|
+
return files;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
139
262
|
function buildQuery(query: GitLabRequestInput["query"]): string {
|
|
140
263
|
if (query === undefined) {
|
|
141
264
|
return "";
|
|
@@ -176,6 +176,18 @@ export function gitlabMergeRequestUrl(
|
|
|
176
176
|
return explicit ?? `${project.webUrl}/-/merge_requests/${iid}`;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Whether an `update` payload marks a draft merge request ready. GitLab uses
|
|
181
|
+
* either `changes.draft` or the legacy `changes.work_in_progress` shape.
|
|
182
|
+
*/
|
|
183
|
+
export function gitlabDraftMarkedReady(
|
|
184
|
+
payload: Record<string, unknown>
|
|
185
|
+
): boolean {
|
|
186
|
+
const changes = asRecord(payload.changes);
|
|
187
|
+
const draft = asRecord(changes?.draft ?? changes?.work_in_progress);
|
|
188
|
+
return draft?.current === false && draft.previous !== false;
|
|
189
|
+
}
|
|
190
|
+
|
|
179
191
|
/** Normalize a merge-request record (`object_attributes` or `merge_request`). */
|
|
180
192
|
export function gitlabMergeRequestFromRecord(
|
|
181
193
|
project: GitLabProjectRef,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type MailboxContinuation,
|
|
9
9
|
normalizeIdentity,
|
|
10
10
|
} from "../../internal/continuation-identity.js";
|
|
11
|
+
import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
|
|
11
12
|
import { routeLocalIngressContinuation } from "../../internal/local-ingress.js";
|
|
12
13
|
import { steeringEnabled } from "../../internal/steering.js";
|
|
13
14
|
import type {
|
|
@@ -189,6 +190,14 @@ export interface SlackInboundDispatchDeps extends SlackContinuationProbes {
|
|
|
189
190
|
*/
|
|
190
191
|
suggestedPrompts?: SlackSuggestedPrompt[];
|
|
191
192
|
suggestedPromptsTitle?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Rethrow handler failures out of the dispatch promise instead of
|
|
195
|
+
* swallowing them after the error log. Hosted admission sets this so a
|
|
196
|
+
* throwing handler rejects `waitUntil` and surfaces as a retryable 503
|
|
197
|
+
* to the control plane (matching the GitHub/Origin adapters); the
|
|
198
|
+
* long-lived Socket Mode loop keeps the swallow-and-log default.
|
|
199
|
+
*/
|
|
200
|
+
propagateHandlerErrors?: boolean;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
function triggeringMergeMessage(
|
|
@@ -267,6 +276,8 @@ export async function dispatchInboundMessage(args: {
|
|
|
267
276
|
followUpStatus?: boolean;
|
|
268
277
|
blockExternals?: boolean;
|
|
269
278
|
continuation?: ContinuationIdentity;
|
|
279
|
+
/** See {@link SlackInboundDispatchDeps.propagateHandlerErrors}. */
|
|
280
|
+
propagateHandlerErrors?: boolean;
|
|
270
281
|
}): Promise<void> {
|
|
271
282
|
const { message, kind } = args;
|
|
272
283
|
const log = args.log ?? defaultSlackLog;
|
|
@@ -399,6 +410,9 @@ export async function dispatchInboundMessage(args: {
|
|
|
399
410
|
thread_ts: message.threadTs,
|
|
400
411
|
event_id: args.eventId,
|
|
401
412
|
});
|
|
413
|
+
if (args.propagateHandlerErrors === true) {
|
|
414
|
+
throw error;
|
|
415
|
+
}
|
|
402
416
|
return;
|
|
403
417
|
}
|
|
404
418
|
if (decision === null || decision === undefined) {
|
|
@@ -527,6 +541,19 @@ export async function dispatchInboundMessage(args: {
|
|
|
527
541
|
|
|
528
542
|
try {
|
|
529
543
|
const session = await args.send(prompt, sendOptions);
|
|
544
|
+
if (isDeferredChannelSession(session)) {
|
|
545
|
+
// Hosted admission captured the send; the control plane allocates
|
|
546
|
+
// the session and runs the turn only after this delivery is
|
|
547
|
+
// acknowledged, so there is nothing to observe or coalesce yet.
|
|
548
|
+
log.info("session send captured (hosted admission)", {
|
|
549
|
+
kind,
|
|
550
|
+
continuation,
|
|
551
|
+
channel: message.channelId,
|
|
552
|
+
thread_ts: message.threadTs,
|
|
553
|
+
event_id: args.eventId,
|
|
554
|
+
});
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
530
557
|
log.info(
|
|
531
558
|
session.coalesced === true ? "session coalesced" : "session start",
|
|
532
559
|
{
|
|
@@ -659,6 +686,7 @@ export function dispatchInboundFromEventBody(
|
|
|
659
686
|
kind: "app_mention",
|
|
660
687
|
message: mention,
|
|
661
688
|
handler: deps.onAppMention,
|
|
689
|
+
propagateHandlerErrors: deps.propagateHandlerErrors,
|
|
662
690
|
send: deps.send,
|
|
663
691
|
credentials: deps.credentials,
|
|
664
692
|
host: deps.host,
|
|
@@ -702,6 +730,7 @@ export function dispatchInboundFromEventBody(
|
|
|
702
730
|
kind: "direct_message",
|
|
703
731
|
message: dm,
|
|
704
732
|
handler: deps.onDirectMessage,
|
|
733
|
+
propagateHandlerErrors: deps.propagateHandlerErrors,
|
|
705
734
|
send: deps.send,
|
|
706
735
|
credentials: deps.credentials,
|
|
707
736
|
host: deps.host,
|
|
@@ -739,6 +768,7 @@ export function dispatchInboundFromEventBody(
|
|
|
739
768
|
kind: "reaction_added",
|
|
740
769
|
message: reaction,
|
|
741
770
|
handler: deps.onReactionAdded,
|
|
771
|
+
propagateHandlerErrors: deps.propagateHandlerErrors,
|
|
742
772
|
send: deps.send,
|
|
743
773
|
credentials: deps.credentials,
|
|
744
774
|
host: deps.host,
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `slackChannel()` — platform channel pack for Slack
|
|
2
|
+
* `slackChannel()` — platform channel pack for Slack.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Request URL or Events HTTP
|
|
6
|
-
* is enabled, Approve/Deny buttons
|
|
7
|
-
* envelopes.
|
|
4
|
+
* Local / self-hosted transport is Socket Mode: inbound events arrive over
|
|
5
|
+
* a WebSocket (`SLACK_APP_TOKEN`); no public Request URL or Events HTTP
|
|
6
|
+
* route is required. When `toolApprovals` is enabled, Approve/Deny buttons
|
|
7
|
+
* arrive as Socket Mode `interactive` envelopes.
|
|
8
|
+
*
|
|
9
|
+
* Hosted v2 transport is the control plane's Events API ingest: the CP
|
|
10
|
+
* verifies the managed app's signature, fans out on the declared
|
|
11
|
+
* `slackEventTypes` (`app_mention`, `message`), and delivers the full
|
|
12
|
+
* `event_callback` body through hosted admission — the attached adapter
|
|
13
|
+
* routes it through the same inbound dispatch as Socket Mode. Without an
|
|
14
|
+
* app token the socket transport idles, so a hosted pod never needs one.
|
|
8
15
|
*/
|
|
9
16
|
|
|
10
17
|
import { allowAll, defineChannel } from "../../channels.js";
|
|
18
|
+
import {
|
|
19
|
+
skipped,
|
|
20
|
+
withPropagatingBackgroundErrors,
|
|
21
|
+
} from "../../internal/channel-dispatch.js";
|
|
11
22
|
import {
|
|
12
23
|
continuationSource,
|
|
13
24
|
normalizeIdentity,
|
|
14
25
|
} from "../../internal/continuation-identity.js";
|
|
26
|
+
import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
|
|
15
27
|
import type {
|
|
16
28
|
ArtifactsApi,
|
|
17
29
|
ChannelDefinition,
|
|
@@ -51,7 +63,7 @@ import {
|
|
|
51
63
|
emptySlackChannelState,
|
|
52
64
|
type SlackInboundDispatchDeps,
|
|
53
65
|
} from "./dispatch.js";
|
|
54
|
-
import { createEventIdDedupe } from "./event-id-dedupe.js";
|
|
66
|
+
import { createEventIdDedupe, type EventIdDedupe } from "./event-id-dedupe.js";
|
|
55
67
|
import {
|
|
56
68
|
dispatchBlockAction,
|
|
57
69
|
dispatchInteractiveFromPayload,
|
|
@@ -159,6 +171,18 @@ export function slackChannel(
|
|
|
159
171
|
normalizeBotMentionAllowlist(botMentions.allowFrom);
|
|
160
172
|
}
|
|
161
173
|
const eventIds = createEventIdDedupe();
|
|
174
|
+
// Hosted v2 event capability, matching what the engagement flags can
|
|
175
|
+
// dispatch: mentions ride `app_mention`; DMs and watched channel posts
|
|
176
|
+
// both arrive as `message`. Membership of `slack.thread/v2` admits
|
|
177
|
+
// exactly these two, so `reaction_added` (hosted follow-up only inside
|
|
178
|
+
// an existing thread) is deliberately not declared.
|
|
179
|
+
const slackEventTypes: string[] = [];
|
|
180
|
+
if (mentionsEnabled) {
|
|
181
|
+
slackEventTypes.push("app_mention");
|
|
182
|
+
}
|
|
183
|
+
if (directMessagesEnabled || channelPosts !== undefined) {
|
|
184
|
+
slackEventTypes.push("message");
|
|
185
|
+
}
|
|
162
186
|
const toolApprovals = options.toolApprovals === true;
|
|
163
187
|
const interactivity = options.interactivity === true;
|
|
164
188
|
const onBlockAction = options.onBlockAction;
|
|
@@ -201,6 +225,9 @@ export function slackChannel(
|
|
|
201
225
|
waitUntil: (promise: Promise<unknown>) => void;
|
|
202
226
|
host: HostContext;
|
|
203
227
|
artifacts: ArtifactsApi;
|
|
228
|
+
/** Override the channel-level dedupe (hosted admission passes a fresh one). */
|
|
229
|
+
eventIds?: EventIdDedupe;
|
|
230
|
+
propagateHandlerErrors?: boolean;
|
|
204
231
|
hasContinuationSession?: (continuationToken: string) => Promise<boolean>;
|
|
205
232
|
isContinuationBusy?: (continuationToken: string) => Promise<boolean>;
|
|
206
233
|
getContinuationLastBotMessageTs?: (
|
|
@@ -216,7 +243,8 @@ export function slackChannel(
|
|
|
216
243
|
onDirectMessage,
|
|
217
244
|
...(onReactionAdded === undefined ? {} : { onReactionAdded }),
|
|
218
245
|
credentials,
|
|
219
|
-
eventIds,
|
|
246
|
+
eventIds: args.eventIds ?? eventIds,
|
|
247
|
+
propagateHandlerErrors: args.propagateHandlerErrors,
|
|
220
248
|
host: args.host,
|
|
221
249
|
artifacts: args.artifacts,
|
|
222
250
|
log: getLog(),
|
|
@@ -253,6 +281,10 @@ export function slackChannel(
|
|
|
253
281
|
routes: [],
|
|
254
282
|
meta: {
|
|
255
283
|
kind: "slack",
|
|
284
|
+
// Omitted (not empty) when nothing dispatches, so fanout never
|
|
285
|
+
// materializes a subscription with no event types.
|
|
286
|
+
slackEventTypes:
|
|
287
|
+
slackEventTypes.length === 0 ? undefined : slackEventTypes,
|
|
256
288
|
...(channelPosts === undefined
|
|
257
289
|
? {}
|
|
258
290
|
: { slackChannelPosts: [...channelPosts.allow] }),
|
|
@@ -551,6 +583,36 @@ export function slackChannel(
|
|
|
551
583
|
});
|
|
552
584
|
|
|
553
585
|
slackChannelOptionsByDefinition.set(definition, options);
|
|
586
|
+
attachHostedAdmissionAdapter(definition, {
|
|
587
|
+
kind: "slack",
|
|
588
|
+
prepareArgs: withPropagatingBackgroundErrors,
|
|
589
|
+
// The payload is the full `event_callback` body the CP verified — the
|
|
590
|
+
// same shape Socket Mode unwraps — so it routes through the same
|
|
591
|
+
// inbound dispatch. Outcomes: a captured `send` overrides the fallback
|
|
592
|
+
// tag below, so `skipped` surfaces when the engagement rules declined
|
|
593
|
+
// (`not_engaged`) or no handler takes the shape (`not_dispatchable`);
|
|
594
|
+
// a throwing handler rejects `waitUntil` (propagateHandlerErrors) and
|
|
595
|
+
// hosted admission answers a retryable 503, like the PR adapters.
|
|
596
|
+
// The channel-level event_id dedupe is deliberately bypassed with a
|
|
597
|
+
// fresh instance per delivery: the control plane's app-scoped ingress
|
|
598
|
+
// claim already dedupes Slack retries, and on a warm pod the local set
|
|
599
|
+
// would otherwise swallow the control plane's own retry of a delivery
|
|
600
|
+
// that failed after the id was marked handled.
|
|
601
|
+
dispatch: async ({ payload, args }) => {
|
|
602
|
+
const dispatched = dispatchInboundFromEventBody(
|
|
603
|
+
payload,
|
|
604
|
+
inboundDeps({
|
|
605
|
+
send: args.send,
|
|
606
|
+
waitUntil: args.waitUntil,
|
|
607
|
+
host: args.host,
|
|
608
|
+
artifacts: args.artifacts,
|
|
609
|
+
eventIds: createEventIdDedupe(),
|
|
610
|
+
propagateHandlerErrors: true,
|
|
611
|
+
})
|
|
612
|
+
);
|
|
613
|
+
return skipped(dispatched ? "not_engaged" : "not_dispatchable");
|
|
614
|
+
},
|
|
615
|
+
});
|
|
554
616
|
|
|
555
617
|
return definition;
|
|
556
618
|
}
|
package/src/extensions.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* An extension is a directory laid out like `agent/`: `extension.ts`
|
|
5
5
|
* declares it; `tools/`, `skills/`, `mcp-connections/`,
|
|
6
6
|
* `host-connections/`, `hooks/`, `channels/`, `schedules/`,
|
|
7
|
-
* `subagents/`, `instructions`, `
|
|
8
|
-
*
|
|
7
|
+
* `subagents/`, `instructions`, `artifacts.ts`, and
|
|
8
|
+
* `sandbox/workspace/` are its contributions. `lib/` holds
|
|
9
9
|
* shared code.
|
|
10
10
|
*
|
|
11
11
|
* ```ts
|
|
@@ -162,10 +162,6 @@ export function disableInstructions(): DisabledDefinition {
|
|
|
162
162
|
return disable();
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
export function disableAB(): DisabledDefinition {
|
|
166
|
-
return disable();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
165
|
export function disableArtifacts(): DisabledDefinition {
|
|
170
166
|
return disable();
|
|
171
167
|
}
|
package/src/index.ts
CHANGED
|
@@ -31,7 +31,6 @@ import type {
|
|
|
31
31
|
ServeOptions,
|
|
32
32
|
} from "./types.js";
|
|
33
33
|
|
|
34
|
-
export { defineAB } from "./ab.js";
|
|
35
34
|
export { defineArtifacts } from "./artifacts.js";
|
|
36
35
|
// Authoring helpers (also available on their focused subpath exports).
|
|
37
36
|
export {
|
|
@@ -55,7 +54,6 @@ export {
|
|
|
55
54
|
cursorPlugin,
|
|
56
55
|
defineExtension,
|
|
57
56
|
disable,
|
|
58
|
-
disableAB,
|
|
59
57
|
disableArtifacts,
|
|
60
58
|
disableChannel,
|
|
61
59
|
disableConnection,
|
|
@@ -190,7 +188,6 @@ export { defineSkill } from "./skills.js";
|
|
|
190
188
|
export type {
|
|
191
189
|
DurableSessionRecord,
|
|
192
190
|
DurableSessionSummary,
|
|
193
|
-
StorageABTable,
|
|
194
191
|
StorageCasTable,
|
|
195
192
|
StorageConfig,
|
|
196
193
|
StorageContext,
|
|
@@ -20,10 +20,16 @@
|
|
|
20
20
|
// Null-prototype copies so specifiers like "constructor" or "__proto__"
|
|
21
21
|
// can never resolve to inherited Object.prototype members.
|
|
22
22
|
let directAliases = toNullProtoMap({});
|
|
23
|
+
let sourceFallbackAliases = toNullProtoMap({});
|
|
23
24
|
let sourceTreeFallbackParentURL: string | undefined;
|
|
24
25
|
|
|
25
26
|
export interface AuthoredAliasHookData {
|
|
26
27
|
directAliases: Record<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* Framework exports omitted from the running distribution. Resolve these
|
|
30
|
+
* against an authored project's `anysphere-source` package condition.
|
|
31
|
+
*/
|
|
32
|
+
sourceFallbackAliases?: string[];
|
|
27
33
|
/**
|
|
28
34
|
* `file:` URL of the running `@cursor/july` package.json. Bare imports
|
|
29
35
|
* from monorepo `packages/agent-serve/` source retry against this parent
|
|
@@ -40,6 +46,11 @@ function toNullProtoMap(
|
|
|
40
46
|
|
|
41
47
|
export function initialize(data: AuthoredAliasHookData): void {
|
|
42
48
|
directAliases = toNullProtoMap(data.directAliases);
|
|
49
|
+
sourceFallbackAliases = toNullProtoMap(
|
|
50
|
+
Object.fromEntries(
|
|
51
|
+
(data.sourceFallbackAliases ?? []).map((specifier) => [specifier, "1"])
|
|
52
|
+
)
|
|
53
|
+
);
|
|
43
54
|
const parent = data.sourceTreeFallbackParentURL;
|
|
44
55
|
sourceTreeFallbackParentURL =
|
|
45
56
|
typeof parent === "string" && parent !== "" ? parent : undefined;
|
|
@@ -65,6 +76,9 @@ export function resolve(
|
|
|
65
76
|
if (direct !== undefined) {
|
|
66
77
|
return { url: direct, shortCircuit: true };
|
|
67
78
|
}
|
|
79
|
+
if (sourceFallbackAliases[specifier] !== undefined) {
|
|
80
|
+
return nextResolve(specifier, withCondition(context, "anysphere-source"));
|
|
81
|
+
}
|
|
68
82
|
if (
|
|
69
83
|
sourceTreeFallbackParentURL !== undefined &&
|
|
70
84
|
isBarePackageSpecifier(specifier) &&
|
|
@@ -95,6 +109,24 @@ function withParentURL(context: unknown, parentURL: string): unknown {
|
|
|
95
109
|
return { parentURL };
|
|
96
110
|
}
|
|
97
111
|
|
|
112
|
+
function withCondition(context: unknown, condition: string): unknown {
|
|
113
|
+
const record =
|
|
114
|
+
context !== null && typeof context === "object"
|
|
115
|
+
? (context as Record<string, unknown>)
|
|
116
|
+
: {};
|
|
117
|
+
const conditions = Array.isArray(record["conditions"])
|
|
118
|
+
? record["conditions"].filter(
|
|
119
|
+
(value): value is string => typeof value === "string"
|
|
120
|
+
)
|
|
121
|
+
: [];
|
|
122
|
+
return {
|
|
123
|
+
...record,
|
|
124
|
+
conditions: conditions.includes(condition)
|
|
125
|
+
? conditions
|
|
126
|
+
: [...conditions, condition],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
98
130
|
function isBarePackageSpecifier(specifier: string): boolean {
|
|
99
131
|
if (specifier.length === 0) {
|
|
100
132
|
return false;
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
* tsconfig paths already cover them.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { existsSync } from "node:fs";
|
|
21
22
|
import { stat } from "node:fs/promises";
|
|
22
23
|
import { register as registerModuleHooks } from "node:module";
|
|
23
24
|
import { join } from "node:path";
|
|
24
|
-
import { pathToFileURL } from "node:url";
|
|
25
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
25
26
|
import type { AuthoredAliasHookData } from "./authored-alias-hooks.js";
|
|
26
27
|
import {
|
|
27
28
|
CLI_COMMAND_NAME,
|
|
@@ -61,6 +62,22 @@ export function authoredModuleSpecifier(
|
|
|
61
62
|
return url.href;
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
export function partitionFrameworkAliases(aliases: Record<string, string>): {
|
|
66
|
+
directAliases: Record<string, string>;
|
|
67
|
+
sourceFallbackAliases: string[];
|
|
68
|
+
} {
|
|
69
|
+
const directAliases: Record<string, string> = {};
|
|
70
|
+
const sourceFallbackAliases: string[] = [];
|
|
71
|
+
for (const [specifier, url] of Object.entries(aliases)) {
|
|
72
|
+
if (existsSync(fileURLToPath(url))) {
|
|
73
|
+
directAliases[specifier] = url;
|
|
74
|
+
} else {
|
|
75
|
+
sourceFallbackAliases.push(specifier);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { directAliases, sourceFallbackAliases };
|
|
79
|
+
}
|
|
80
|
+
|
|
64
81
|
/**
|
|
65
82
|
* Dynamically import an authored TypeScript/JavaScript module, re-reading it
|
|
66
83
|
* from disk when the file's mtime has changed since the last import.
|
|
@@ -165,8 +182,15 @@ function registerFrameworkAliases(): void {
|
|
|
165
182
|
return;
|
|
166
183
|
}
|
|
167
184
|
const hooksUrl = new URL("./authored-alias-hooks.js", import.meta.url);
|
|
185
|
+
const { directAliases, sourceFallbackAliases } = partitionFrameworkAliases(
|
|
186
|
+
frameworkAliases()
|
|
187
|
+
);
|
|
168
188
|
const data: AuthoredAliasHookData = {
|
|
169
|
-
directAliases
|
|
189
|
+
directAliases,
|
|
190
|
+
// Internal-only exports stay out of the public package. When one is
|
|
191
|
+
// mounted by an agent in this source checkout, resolve that one import
|
|
192
|
+
// through the checkout's `anysphere-source` export instead.
|
|
193
|
+
sourceFallbackAliases,
|
|
170
194
|
// Hosted factory agents relative-import this package's src/ from a
|
|
171
195
|
// monorepo checkout while npm install ran only in the agent directory.
|
|
172
196
|
// Bare specifiers from that tree retry against this package.json.
|
package/src/internal/cli-ax.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* init / run / trajectory / eval
|
|
4
4
|
*
|
|
5
5
|
* Coding agents get JSON-first output, ephemeral local servers, and
|
|
6
|
-
* filesystem-first evals under evals/ (*.eval.ts).
|
|
7
|
-
* (`defineAB` under `agent/ab`) plug into serve — there is no `ab` CLI.
|
|
6
|
+
* filesystem-first evals under evals/ (*.eval.ts).
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
|
|
@@ -787,14 +787,22 @@ function extractSlack(payload: unknown): string | undefined {
|
|
|
787
787
|
if (record === undefined) {
|
|
788
788
|
return undefined;
|
|
789
789
|
}
|
|
790
|
+
// Events-API deliveries are the full event_callback body, so the
|
|
791
|
+
// identity fields live under `event`. Top-level fields still win for
|
|
792
|
+
// pre-flattened payloads (Socket Mode local dev, tests). Keep in
|
|
793
|
+
// lockstep with the control-plane twin (SlackThreadExtractor).
|
|
794
|
+
const event = asRecord(record.event);
|
|
790
795
|
const channelId =
|
|
791
796
|
nonEmpty(record.channelId) ??
|
|
792
797
|
nonEmpty(record.channel_id) ??
|
|
793
|
-
nonEmpty(record.channel)
|
|
798
|
+
nonEmpty(record.channel) ??
|
|
799
|
+
nonEmpty(event?.channel);
|
|
794
800
|
const threadTs =
|
|
795
801
|
nonEmpty(record.threadTs) ??
|
|
796
802
|
nonEmpty(record.thread_ts) ??
|
|
797
|
-
nonEmpty(
|
|
803
|
+
nonEmpty(event?.thread_ts) ??
|
|
804
|
+
nonEmpty(record.ts) ??
|
|
805
|
+
nonEmpty(event?.ts);
|
|
798
806
|
if (channelId === undefined || threadTs === undefined) {
|
|
799
807
|
return undefined;
|
|
800
808
|
}
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
type ArtifactsDefinition,
|
|
14
14
|
DEFAULT_MODEL,
|
|
15
|
-
type DiscoveredAB,
|
|
16
15
|
type DiscoveredChannel,
|
|
17
16
|
type DiscoveredHook,
|
|
18
17
|
type DiscoveredSchedule,
|
|
@@ -50,7 +49,7 @@ export interface LoadedRootAgent {
|
|
|
50
49
|
agent: ResolvedAgent;
|
|
51
50
|
projectSlots: Pick<
|
|
52
51
|
ExtensionContributions,
|
|
53
|
-
"hooks" | "channels" | "schedules" | "
|
|
52
|
+
"hooks" | "channels" | "schedules" | "artifacts"
|
|
54
53
|
>;
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -66,7 +65,6 @@ export async function loadAgent(
|
|
|
66
65
|
hooks: [],
|
|
67
66
|
channels: [],
|
|
68
67
|
schedules: [],
|
|
69
|
-
abs: [],
|
|
70
68
|
artifacts: undefined,
|
|
71
69
|
},
|
|
72
70
|
};
|
|
@@ -92,7 +90,6 @@ export async function loadAgent(
|
|
|
92
90
|
const hooks: DiscoveredHook[] = [];
|
|
93
91
|
const channels: DiscoveredChannel[] = [];
|
|
94
92
|
const schedules: DiscoveredSchedule[] = [];
|
|
95
|
-
const abs: DiscoveredAB[] = [];
|
|
96
93
|
const instructionParts: string[] = [];
|
|
97
94
|
const contributions = {
|
|
98
95
|
tools,
|
|
@@ -105,7 +102,6 @@ export async function loadAgent(
|
|
|
105
102
|
schedules,
|
|
106
103
|
instructionParts,
|
|
107
104
|
seedFiles,
|
|
108
|
-
abs,
|
|
109
105
|
artifacts: undefined as ArtifactsDefinition | undefined,
|
|
110
106
|
};
|
|
111
107
|
const extensions = await appendExtensions(
|
|
@@ -351,7 +347,6 @@ export async function loadAgent(
|
|
|
351
347
|
hooks,
|
|
352
348
|
channels,
|
|
353
349
|
schedules,
|
|
354
|
-
abs,
|
|
355
350
|
artifacts: contributions.artifacts,
|
|
356
351
|
},
|
|
357
352
|
};
|
|
@@ -374,7 +369,6 @@ export async function warnUnknownSlots(
|
|
|
374
369
|
"schedules",
|
|
375
370
|
"reminders",
|
|
376
371
|
"hooks",
|
|
377
|
-
"ab",
|
|
378
372
|
"sandbox",
|
|
379
373
|
"lib",
|
|
380
374
|
// Vite playground custom tool chips (agent/playground/tools).
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import type {
|
|
8
8
|
ArtifactsDefinition,
|
|
9
|
-
DiscoveredAB,
|
|
10
9
|
DiscoveredChannel,
|
|
11
10
|
DiscoveredHook,
|
|
12
11
|
DiscoveredSchedule,
|
|
@@ -14,7 +13,6 @@ import type {
|
|
|
14
13
|
ResolvedAgent,
|
|
15
14
|
} from "../../types.js";
|
|
16
15
|
import { getDefinitionKind } from "../brand.js";
|
|
17
|
-
import { loadABs } from "./ab.js";
|
|
18
16
|
import { loadChannels } from "./channels.js";
|
|
19
17
|
import { type DiscoveryContext, displayPath, errorMessage } from "./context.js";
|
|
20
18
|
import {
|
|
@@ -202,22 +200,6 @@ export async function overlayInstructionsFragment(
|
|
|
202
200
|
return loadInstructions(ctx, overlayDir, undefined, false);
|
|
203
201
|
}
|
|
204
202
|
|
|
205
|
-
export async function overlayAbs(
|
|
206
|
-
ctx: DiscoveryContext,
|
|
207
|
-
site: OverlaySite,
|
|
208
|
-
contributed: Map<string, DiscoveredAB>,
|
|
209
|
-
overlayDir: string
|
|
210
|
-
): Promise<void> {
|
|
211
|
-
const loaded = await loadABs(ctx, overlayDir, (source, path) => {
|
|
212
|
-
if (!contributed.delete(source)) {
|
|
213
|
-
unknownContribution(ctx, path, "disableAB", source, site.ns);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
for (const experiment of loaded) {
|
|
217
|
-
contributed.set(experiment.source ?? experiment.name, experiment);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
203
|
export async function overlayArtifacts(
|
|
222
204
|
ctx: DiscoveryContext,
|
|
223
205
|
overlayDir: string,
|