@sentry/junior 0.163.0 → 0.165.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-6IX5CV7G.js → agent-hooks-GSNL33UA.js} +9 -9
- package/dist/api/schema/workspace.d.ts +51 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +15 -3
- package/dist/api/workspaces/routes.d.ts +4 -0
- package/dist/api.js +171 -27
- package/dist/app.js +36 -34
- package/dist/{catalog-runtime-NEPZNTOM.js → catalog-runtime-4ERDVI7V.js} +5 -5
- package/dist/chat/repository-instructions.d.ts +12 -1
- package/dist/chat/sandbox/sandbox.d.ts +1 -1
- package/dist/chat/sandbox/snapshot/resolve.d.ts +12 -0
- package/dist/chat/sandbox/snapshot/runtime.d.ts +2 -0
- package/dist/chat/workspaces/store.d.ts +27 -0
- package/dist/chat/workspaces/types.d.ts +0 -1
- package/dist/chat/workspaces/validation.d.ts +20 -0
- package/dist/{chunk-TPT6EF7K.js → chunk-32CCG4WP.js} +1 -1
- package/dist/{chunk-ICJ3KCA2.js → chunk-3V2EIQLT.js} +1 -1
- package/dist/{chunk-ZDKTZG3G.js → chunk-5T6WPPEI.js} +1 -1
- package/dist/{chunk-ZF6IC27P.js → chunk-5WDDWMQ7.js} +260 -8
- package/dist/{chunk-TPDNZCZU.js → chunk-65B3PDY7.js} +1 -1
- package/dist/{chunk-2FBPN2Y4.js → chunk-6OWVPXNO.js} +2 -1
- package/dist/{chunk-2HBJQEBE.js → chunk-6RZ6MMEK.js} +1 -1
- package/dist/{chunk-IIT23D3M.js → chunk-6YXCG2XL.js} +4 -4
- package/dist/{chunk-XY2IVIAY.js → chunk-7J26TW64.js} +5 -5
- package/dist/{chunk-RK7KPI6G.js → chunk-7S2JVUWS.js} +1 -1
- package/dist/{chunk-NL53P7PS.js → chunk-AEBF6AO2.js} +1 -1
- package/dist/{chunk-O5ZZL7IR.js → chunk-AQEBOQUC.js} +9 -9
- package/dist/{chunk-SA6BEEAB.js → chunk-BEC542E6.js} +111 -74
- package/dist/{chunk-THS4CKN4.js → chunk-BEHPIDVZ.js} +5 -4
- package/dist/{chunk-BLZUFHM7.js → chunk-DKO4RRGJ.js} +1 -1
- package/dist/{chunk-MXFL7LNZ.js → chunk-EA4UL5H2.js} +73 -14
- package/dist/{chunk-YAUQXZVT.js → chunk-FMOFCEAA.js} +2 -2
- package/dist/{chunk-SR6WRBJW.js → chunk-FNNQCHOL.js} +4 -4
- package/dist/{chunk-3OZNFCPR.js → chunk-FXX4NHOM.js} +6 -6
- package/dist/{chunk-GCLHNRMU.js → chunk-G72LBEMZ.js} +1 -1
- package/dist/{chunk-IX4XI42N.js → chunk-HPWZ4BJJ.js} +72 -120
- package/dist/{chunk-FEIHINKR.js → chunk-HZDLOFO4.js} +9 -5
- package/dist/{chunk-ATWHPSMF.js → chunk-IZHR2OES.js} +4 -13
- package/dist/{chunk-O4IK4O7C.js → chunk-N2BRRIQZ.js} +1 -1
- package/dist/{chunk-MWVQ35U6.js → chunk-NPW6LM2X.js} +12 -12
- package/dist/{chunk-JI5EPI3O.js → chunk-RQQTOF3H.js} +3 -3
- package/dist/{chunk-WPGYWDJR.js → chunk-SA5FVUWJ.js} +6 -6
- package/dist/{chunk-KD3ROG6P.js → chunk-T6BAHCT6.js} +17 -17
- package/dist/{chunk-4P2XNVTO.js → chunk-TCWPG5VL.js} +2 -2
- package/dist/{chunk-EKGJVUVS.js → chunk-VDNNVTX2.js} +5 -5
- package/dist/{chunk-RTPJRLOP.js → chunk-XOINKFDJ.js} +7 -7
- package/dist/{chunk-3T7RJVDJ.js → chunk-ZUKU2Y3J.js} +1 -1
- package/dist/cli/chat.js +29 -29
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/workspaces.d.ts +0 -17
- package/dist/db/schema.d.ts +0 -17
- package/dist/{db-6VBMHVW2.js → db-5TTEPMTY.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-5NCCUIM2.js → oauth-callback-server-IVFC5YHY.js} +22 -22
- package/dist/{runner-6ONEB6TQ.js → runner-G76TSHWO.js} +31 -33
- package/dist/{skills-Y5R36UH4.js → skills-F6PSLVSG.js} +6 -6
- package/dist/spawn-WMJPIAZL.js +37 -0
- package/dist/{validation-HLHEQDEK.js → validation-56EJI6UQ.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-VIEFYTFG.js → work-RNRQCP3Y.js} +17 -17
- package/dist/worker-FBR2WUI4.js +24 -0
- package/migrations/0030_drop_workspace_repo_primary.sql +2 -0
- package/migrations/meta/0030_snapshot.json +2799 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -5
- package/dist/spawn-RFMBQ6B3.js +0 -37
- package/dist/worker-MRSKPKQZ.js +0 -24
|
@@ -717,108 +717,139 @@ var createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z6.
|
|
|
717
717
|
var personalTokenParamsSchema = z6.object({ id: z6.string().uuid() }).strict();
|
|
718
718
|
var revokePersonalTokenResponseSchema = z6.object({ revoked: z6.literal(true) }).strict();
|
|
719
719
|
|
|
720
|
-
// src/api/schema/
|
|
720
|
+
// src/api/schema/workspace.ts
|
|
721
721
|
import { z as z7 } from "zod";
|
|
722
|
-
var
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
722
|
+
var workspaceRepoInputSchema = z7.object({
|
|
723
|
+
provider: z7.string(),
|
|
724
|
+
repo: z7.string()
|
|
725
|
+
}).strict();
|
|
726
|
+
var workspaceRepoSchema = z7.object({
|
|
727
|
+
provider: z7.string(),
|
|
728
|
+
repo: z7.string(),
|
|
729
|
+
checkoutPath: z7.string()
|
|
730
|
+
}).strict();
|
|
731
|
+
var workspaceSnapshotSchema = z7.object({
|
|
732
|
+
id: z7.string(),
|
|
733
|
+
generatedAt: z7.iso.datetime()
|
|
734
|
+
}).strict();
|
|
735
|
+
var workspaceSchema = z7.object({
|
|
736
|
+
id: z7.string().uuid(),
|
|
737
|
+
name: z7.string(),
|
|
738
|
+
setupScript: z7.string(),
|
|
739
|
+
repos: z7.array(workspaceRepoSchema),
|
|
740
|
+
snapshot: workspaceSnapshotSchema.nullable()
|
|
741
|
+
}).strict();
|
|
742
|
+
var workspaceListSchema = z7.object({ workspaces: z7.array(workspaceSchema) }).strict();
|
|
743
|
+
var workspaceBodySchema = z7.object({
|
|
744
|
+
name: z7.string(),
|
|
745
|
+
setupScript: z7.string().optional(),
|
|
746
|
+
repos: z7.array(workspaceRepoInputSchema)
|
|
747
|
+
}).strict();
|
|
748
|
+
var workspaceParamsSchema = z7.object({ id: z7.string().uuid() }).strict();
|
|
749
|
+
var deleteWorkspaceResponseSchema = z7.object({ deleted: z7.literal(true) }).strict();
|
|
750
|
+
|
|
751
|
+
// src/api/schema/task.ts
|
|
752
|
+
import { z as z8 } from "zod";
|
|
753
|
+
var taskDestinationSchema = z8.object({
|
|
754
|
+
channelId: z8.string().min(1),
|
|
755
|
+
label: z8.string().min(1),
|
|
756
|
+
teamId: z8.string().min(1),
|
|
757
|
+
visibility: z8.enum(["private", "public"])
|
|
758
|
+
}).strict();
|
|
759
|
+
var taskSummaryBaseSchema = z8.object({
|
|
760
|
+
createdAt: z8.string().datetime(),
|
|
761
|
+
createdBy: z8.string().min(1),
|
|
762
|
+
createdByEmail: z8.string().trim().email().optional(),
|
|
732
763
|
destination: taskDestinationSchema,
|
|
733
|
-
id:
|
|
734
|
-
instruction:
|
|
735
|
-
lastConversationId:
|
|
736
|
-
lastRunAt:
|
|
737
|
-
ownedByViewer:
|
|
738
|
-
runsLast7Days:
|
|
764
|
+
id: z8.string().min(1),
|
|
765
|
+
instruction: z8.string().min(1),
|
|
766
|
+
lastConversationId: z8.string().min(1).optional(),
|
|
767
|
+
lastRunAt: z8.string().datetime().optional(),
|
|
768
|
+
ownedByViewer: z8.boolean(),
|
|
769
|
+
runsLast7Days: z8.number().int().nonnegative(),
|
|
739
770
|
/** Short display title; falls back from instruction when unset. */
|
|
740
|
-
title:
|
|
741
|
-
totalRuns:
|
|
771
|
+
title: z8.string().min(1),
|
|
772
|
+
totalRuns: z8.number().int().nonnegative()
|
|
742
773
|
});
|
|
743
774
|
var scheduledTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
744
|
-
kind:
|
|
745
|
-
nextRunAt:
|
|
746
|
-
schedule:
|
|
747
|
-
status:
|
|
775
|
+
kind: z8.literal("scheduled"),
|
|
776
|
+
nextRunAt: z8.string().datetime().optional(),
|
|
777
|
+
schedule: z8.string().min(1),
|
|
778
|
+
status: z8.enum(["active", "blocked", "completed"])
|
|
748
779
|
}).strict();
|
|
749
780
|
var eventTaskSummarySchema = taskSummaryBaseSchema.extend({
|
|
750
|
-
events:
|
|
751
|
-
kind:
|
|
752
|
-
resource:
|
|
753
|
-
source:
|
|
754
|
-
triggerAvailable:
|
|
781
|
+
events: z8.array(z8.string().min(1)).min(1),
|
|
782
|
+
kind: z8.literal("event"),
|
|
783
|
+
resource: z8.string().min(1),
|
|
784
|
+
source: z8.string().min(1),
|
|
785
|
+
triggerAvailable: z8.boolean()
|
|
755
786
|
}).strict();
|
|
756
|
-
var taskSummarySchema =
|
|
787
|
+
var taskSummarySchema = z8.discriminatedUnion("kind", [
|
|
757
788
|
scheduledTaskSummarySchema,
|
|
758
789
|
eventTaskSummarySchema
|
|
759
790
|
]);
|
|
760
|
-
var taskExecutionDaySchema =
|
|
761
|
-
date:
|
|
762
|
-
event:
|
|
763
|
-
scheduled:
|
|
791
|
+
var taskExecutionDaySchema = z8.object({
|
|
792
|
+
date: z8.string().min(1),
|
|
793
|
+
event: z8.number().int().nonnegative(),
|
|
794
|
+
scheduled: z8.number().int().nonnegative()
|
|
764
795
|
}).strict();
|
|
765
|
-
var taskListSchema =
|
|
766
|
-
executionDays:
|
|
767
|
-
tasks:
|
|
768
|
-
truncated:
|
|
796
|
+
var taskListSchema = z8.object({
|
|
797
|
+
executionDays: z8.array(taskExecutionDaySchema),
|
|
798
|
+
tasks: z8.array(taskSummarySchema),
|
|
799
|
+
truncated: z8.boolean()
|
|
769
800
|
}).strict();
|
|
770
|
-
var taskParamsSchema =
|
|
771
|
-
id:
|
|
772
|
-
kind:
|
|
801
|
+
var taskParamsSchema = z8.object({
|
|
802
|
+
id: z8.string().min(1),
|
|
803
|
+
kind: z8.enum(["scheduled", "event"])
|
|
773
804
|
}).strict();
|
|
774
|
-
var taskExecutionStatusSchema =
|
|
805
|
+
var taskExecutionStatusSchema = z8.enum([
|
|
775
806
|
"blocked",
|
|
776
807
|
"completed",
|
|
777
808
|
"failed"
|
|
778
809
|
]);
|
|
779
|
-
var taskExecutionSchema =
|
|
780
|
-
conversationId:
|
|
781
|
-
executedAt:
|
|
782
|
-
executionId:
|
|
810
|
+
var taskExecutionSchema = z8.object({
|
|
811
|
+
conversationId: z8.string().min(1).optional(),
|
|
812
|
+
executedAt: z8.string().datetime(),
|
|
813
|
+
executionId: z8.string().min(1),
|
|
783
814
|
status: taskExecutionStatusSchema,
|
|
784
|
-
title:
|
|
815
|
+
title: z8.string().min(1).optional()
|
|
785
816
|
}).strict();
|
|
786
|
-
var taskExecutionStatusDaySchema =
|
|
787
|
-
blocked:
|
|
788
|
-
completed:
|
|
789
|
-
date:
|
|
790
|
-
failed:
|
|
817
|
+
var taskExecutionStatusDaySchema = z8.object({
|
|
818
|
+
blocked: z8.number().int().nonnegative(),
|
|
819
|
+
completed: z8.number().int().nonnegative(),
|
|
820
|
+
date: z8.string().min(1),
|
|
821
|
+
failed: z8.number().int().nonnegative()
|
|
791
822
|
}).strict();
|
|
792
|
-
var taskExecutionListSchema =
|
|
793
|
-
executionDays:
|
|
794
|
-
executions:
|
|
823
|
+
var taskExecutionListSchema = z8.object({
|
|
824
|
+
executionDays: z8.array(taskExecutionStatusDaySchema),
|
|
825
|
+
executions: z8.array(taskExecutionSchema),
|
|
795
826
|
task: taskSummarySchema,
|
|
796
|
-
truncated:
|
|
827
|
+
truncated: z8.boolean()
|
|
797
828
|
}).strict();
|
|
798
829
|
var taskRunSchema = taskExecutionSchema.extend({
|
|
799
|
-
kind:
|
|
800
|
-
taskId:
|
|
801
|
-
taskTitle:
|
|
830
|
+
kind: z8.enum(["scheduled", "event"]),
|
|
831
|
+
taskId: z8.string().min(1),
|
|
832
|
+
taskTitle: z8.string().min(1)
|
|
802
833
|
}).strict();
|
|
803
|
-
var taskRunListSchema =
|
|
804
|
-
runs:
|
|
805
|
-
truncated:
|
|
834
|
+
var taskRunListSchema = z8.object({
|
|
835
|
+
runs: z8.array(taskRunSchema),
|
|
836
|
+
truncated: z8.boolean()
|
|
806
837
|
}).strict();
|
|
807
838
|
|
|
808
839
|
// src/api/schema/stats.ts
|
|
809
|
-
import { z as
|
|
810
|
-
var statSchema =
|
|
811
|
-
count:
|
|
812
|
-
date:
|
|
813
|
-
metric:
|
|
814
|
-
name:
|
|
815
|
-
namespace:
|
|
816
|
-
}).strict();
|
|
817
|
-
var statsReportSchema =
|
|
818
|
-
generatedAt:
|
|
819
|
-
stats:
|
|
820
|
-
windowEnd:
|
|
821
|
-
windowStart:
|
|
840
|
+
import { z as z9 } from "zod";
|
|
841
|
+
var statSchema = z9.object({
|
|
842
|
+
count: z9.number().int().nonnegative(),
|
|
843
|
+
date: z9.string(),
|
|
844
|
+
metric: z9.string().min(1),
|
|
845
|
+
name: z9.string().min(1),
|
|
846
|
+
namespace: z9.string().min(1)
|
|
847
|
+
}).strict();
|
|
848
|
+
var statsReportSchema = z9.object({
|
|
849
|
+
generatedAt: z9.string().datetime(),
|
|
850
|
+
stats: z9.array(statSchema),
|
|
851
|
+
windowEnd: z9.string(),
|
|
852
|
+
windowStart: z9.string()
|
|
822
853
|
}).strict();
|
|
823
854
|
|
|
824
855
|
export {
|
|
@@ -875,6 +906,12 @@ export {
|
|
|
875
906
|
taskExecutionListSchema,
|
|
876
907
|
taskRunSchema,
|
|
877
908
|
taskRunListSchema,
|
|
909
|
+
workspaceRepoSchema,
|
|
910
|
+
workspaceSchema,
|
|
911
|
+
workspaceListSchema,
|
|
912
|
+
workspaceBodySchema,
|
|
913
|
+
workspaceParamsSchema,
|
|
914
|
+
deleteWorkspaceResponseSchema,
|
|
878
915
|
statSchema,
|
|
879
916
|
statsReportSchema
|
|
880
917
|
};
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
} from "./chunk-BVREIWBD.js";
|
|
6
6
|
import {
|
|
7
7
|
getStateAdapter
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-65B3PDY7.js";
|
|
9
9
|
import {
|
|
10
10
|
toOptionalTrimmed
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FMOFCEAA.js";
|
|
12
12
|
import {
|
|
13
13
|
pluginCatalogRuntime
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7S2JVUWS.js";
|
|
15
15
|
import {
|
|
16
16
|
setSpanAttributes,
|
|
17
17
|
setSpanStatus,
|
|
18
18
|
withSpan
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-32CCG4WP.js";
|
|
20
20
|
|
|
21
21
|
// src/chat/sandbox/resources.ts
|
|
22
22
|
var configuredResources;
|
|
@@ -1170,6 +1170,7 @@ export {
|
|
|
1170
1170
|
bindSandboxFileSystem,
|
|
1171
1171
|
createSandboxSession,
|
|
1172
1172
|
stopSession,
|
|
1173
|
+
getCachedSnapshot,
|
|
1173
1174
|
resolve,
|
|
1174
1175
|
isMissingError
|
|
1175
1176
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
instructionProvenanceFor,
|
|
14
14
|
sanitizePostgresJson,
|
|
15
15
|
withConversationEventLock
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RQQTOF3H.js";
|
|
17
17
|
import {
|
|
18
18
|
SANDBOX_REPOS_ROOT,
|
|
19
19
|
SANDBOX_WORKSPACE_ROOT,
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
fenceLock,
|
|
25
25
|
getStateAdapter,
|
|
26
26
|
withLock
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-65B3PDY7.js";
|
|
28
28
|
import {
|
|
29
29
|
botConfig,
|
|
30
30
|
completeText,
|
|
31
31
|
escapeXml,
|
|
32
32
|
resolveGatewayModel,
|
|
33
33
|
unwrapCurrentInstruction
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-FMOFCEAA.js";
|
|
35
35
|
import {
|
|
36
36
|
parseSlackMessageTs,
|
|
37
37
|
toStoredSlackActor
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
logException,
|
|
42
42
|
logWarn,
|
|
43
43
|
setSpanAttributes
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-32CCG4WP.js";
|
|
45
45
|
|
|
46
46
|
// src/chat/turn-context-tag.ts
|
|
47
47
|
var TURN_CONTEXT_TAG = "runtime-turn-context";
|
|
@@ -2054,9 +2054,9 @@ async function findGitRoot(fs, cwd) {
|
|
|
2054
2054
|
current = parent;
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
|
-
async function
|
|
2057
|
+
async function listRepositoryDirectories(fs) {
|
|
2058
2058
|
if (!await directoryExists(fs, SANDBOX_REPOS_ROOT)) {
|
|
2059
|
-
return
|
|
2059
|
+
return [];
|
|
2060
2060
|
}
|
|
2061
2061
|
const entries = await fs.readdir(SANDBOX_REPOS_ROOT);
|
|
2062
2062
|
const repositories = [];
|
|
@@ -2064,12 +2064,11 @@ async function findSingleRepositoryDirectory(fs) {
|
|
|
2064
2064
|
const candidate = path2.posix.join(SANDBOX_REPOS_ROOT, entry);
|
|
2065
2065
|
if (await directoryExists(fs, candidate) && await pathExists(fs, path2.posix.join(candidate, ".git"))) {
|
|
2066
2066
|
repositories.push(candidate);
|
|
2067
|
-
if (repositories.length > 1) {
|
|
2068
|
-
return void 0;
|
|
2069
|
-
}
|
|
2070
2067
|
}
|
|
2071
2068
|
}
|
|
2072
|
-
return repositories
|
|
2069
|
+
return repositories.sort(
|
|
2070
|
+
(left, right) => left < right ? -1 : left > right ? 1 : 0
|
|
2071
|
+
);
|
|
2073
2072
|
}
|
|
2074
2073
|
async function readInstructionFile(fs, filePath) {
|
|
2075
2074
|
try {
|
|
@@ -2098,7 +2097,10 @@ async function resolveRepositoryInstructions(args) {
|
|
|
2098
2097
|
}
|
|
2099
2098
|
directories.reverse();
|
|
2100
2099
|
const sources = [];
|
|
2101
|
-
let remaining =
|
|
2100
|
+
let remaining = Math.max(
|
|
2101
|
+
0,
|
|
2102
|
+
args.maxBytes ?? MAX_REPOSITORY_INSTRUCTIONS_BYTES
|
|
2103
|
+
);
|
|
2102
2104
|
for (const directory of directories) {
|
|
2103
2105
|
if (remaining <= 0) {
|
|
2104
2106
|
break;
|
|
@@ -2116,10 +2118,67 @@ async function resolveRepositoryInstructions(args) {
|
|
|
2116
2118
|
if (sources.length === 0) {
|
|
2117
2119
|
return void 0;
|
|
2118
2120
|
}
|
|
2119
|
-
const text = sources
|
|
2121
|
+
const text = formatInstructionSources(sources);
|
|
2120
2122
|
const fingerprint = createHash2("sha256").update(JSON.stringify({ directory: args.cwd, sources })).digest("hex");
|
|
2121
2123
|
return { directory: args.cwd, fingerprint, sources, text };
|
|
2122
2124
|
}
|
|
2125
|
+
function formatInstructionSources(sources) {
|
|
2126
|
+
if (sources.length === 1) {
|
|
2127
|
+
return sources[0].content;
|
|
2128
|
+
}
|
|
2129
|
+
return sources.map(
|
|
2130
|
+
(source) => `## ${path2.posix.dirname(source.path)}
|
|
2131
|
+
|
|
2132
|
+
${source.content}`
|
|
2133
|
+
).join("\n\n");
|
|
2134
|
+
}
|
|
2135
|
+
function mergeRepositoryInstructions(bundles) {
|
|
2136
|
+
if (bundles.length === 0) {
|
|
2137
|
+
return void 0;
|
|
2138
|
+
}
|
|
2139
|
+
if (bundles.length === 1) {
|
|
2140
|
+
return bundles[0];
|
|
2141
|
+
}
|
|
2142
|
+
const sources = bundles.flatMap((bundle) => bundle.sources);
|
|
2143
|
+
const text = formatInstructionSources(sources);
|
|
2144
|
+
const fingerprint = createHash2("sha256").update(
|
|
2145
|
+
JSON.stringify({
|
|
2146
|
+
directories: bundles.map((bundle) => bundle.directory ?? null),
|
|
2147
|
+
sources
|
|
2148
|
+
})
|
|
2149
|
+
).digest("hex");
|
|
2150
|
+
return { fingerprint, sources, text };
|
|
2151
|
+
}
|
|
2152
|
+
async function resolveRepositoryInstructionsForDirectories(args) {
|
|
2153
|
+
const uniqueDirectories = [
|
|
2154
|
+
...new Set(
|
|
2155
|
+
args.directories.filter(
|
|
2156
|
+
(directory) => directory === SANDBOX_WORKSPACE_ROOT || directory.startsWith(`${SANDBOX_WORKSPACE_ROOT}/`)
|
|
2157
|
+
)
|
|
2158
|
+
)
|
|
2159
|
+
].sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
|
|
2160
|
+
let remaining = MAX_REPOSITORY_INSTRUCTIONS_BYTES;
|
|
2161
|
+
const bundles = [];
|
|
2162
|
+
for (const directory of uniqueDirectories) {
|
|
2163
|
+
if (remaining <= 0) {
|
|
2164
|
+
break;
|
|
2165
|
+
}
|
|
2166
|
+
const instructions = await resolveRepositoryInstructions({
|
|
2167
|
+
cwd: directory,
|
|
2168
|
+
fs: args.fs,
|
|
2169
|
+
maxBytes: remaining
|
|
2170
|
+
});
|
|
2171
|
+
if (!instructions) {
|
|
2172
|
+
continue;
|
|
2173
|
+
}
|
|
2174
|
+
bundles.push(instructions);
|
|
2175
|
+
remaining -= instructions.sources.reduce(
|
|
2176
|
+
(total, source) => total + Buffer.byteLength(source.content, "utf8"),
|
|
2177
|
+
0
|
|
2178
|
+
);
|
|
2179
|
+
}
|
|
2180
|
+
return mergeRepositoryInstructions(bundles);
|
|
2181
|
+
}
|
|
2123
2182
|
function renderAgentsInstructions(args) {
|
|
2124
2183
|
const directory = args.directory ? ` for ${args.directory}` : "";
|
|
2125
2184
|
return `# AGENTS.md instructions${directory}
|
|
@@ -3231,8 +3290,8 @@ export {
|
|
|
3231
3290
|
collectFiles,
|
|
3232
3291
|
AGENTS_REPLACEMENT_NOTICE,
|
|
3233
3292
|
AGENTS_REMOVAL_NOTICE,
|
|
3234
|
-
|
|
3235
|
-
|
|
3293
|
+
listRepositoryDirectories,
|
|
3294
|
+
resolveRepositoryInstructionsForDirectories,
|
|
3236
3295
|
renderAgentsInstructions,
|
|
3237
3296
|
buildAgentsInstructionsMessage,
|
|
3238
3297
|
findVisibleAgentsInstructions,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZUKU2Y3J.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-32CCG4WP.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/services/provider-error.ts
|
|
17
17
|
var ProviderError = class extends Error {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DKO4RRGJ.js";
|
|
4
4
|
import {
|
|
5
5
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
6
6
|
CONVERSATION_WORK_MAX_RETRIES,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
releaseConversationWork,
|
|
22
22
|
requestAnotherSlice,
|
|
23
23
|
startConversationWork
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6YXCG2XL.js";
|
|
25
25
|
import {
|
|
26
26
|
ConversationQueueMessageRejectedError
|
|
27
27
|
} from "./chunk-JAL3CH4G.js";
|
|
28
28
|
import {
|
|
29
29
|
getChatConfig,
|
|
30
30
|
isProviderRetryError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FMOFCEAA.js";
|
|
32
32
|
import {
|
|
33
33
|
logException,
|
|
34
34
|
logInfo,
|
|
35
35
|
logWarn,
|
|
36
36
|
withLogContext
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-32CCG4WP.js";
|
|
38
38
|
|
|
39
39
|
// src/chat/task-execution/worker.ts
|
|
40
40
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId,
|
|
7
7
|
withSlackRetries
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5WDDWMQ7.js";
|
|
9
9
|
import {
|
|
10
10
|
parseDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RQQTOF3H.js";
|
|
12
12
|
import {
|
|
13
13
|
getStateAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-65B3PDY7.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeSlackEmojiName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FMOFCEAA.js";
|
|
18
18
|
import {
|
|
19
19
|
pluginCatalogRuntime
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7S2JVUWS.js";
|
|
21
21
|
import {
|
|
22
22
|
parseSlackMessageTs,
|
|
23
23
|
parseSlackUserId
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
isRecord,
|
|
27
27
|
logInfo,
|
|
28
28
|
logWarn
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-32CCG4WP.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/slack/outbound.ts
|
|
32
32
|
var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
|