bamboo-agents 0.1.11 → 0.1.12-dev.114.5cb2242
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/VERSION +1 -1
- package/dist/index.js +97 -16
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.12-dev.114.5cb2242
|
package/dist/index.js
CHANGED
|
@@ -3037,7 +3037,7 @@ var VERSION;
|
|
|
3037
3037
|
var init_version = __esm({
|
|
3038
3038
|
"src/version.ts"() {
|
|
3039
3039
|
"use strict";
|
|
3040
|
-
VERSION = "0.1.
|
|
3040
|
+
VERSION = "0.1.12-dev.114.5cb2242";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -12757,16 +12757,39 @@ var init_inbox_apply_revision = __esm({
|
|
|
12757
12757
|
}
|
|
12758
12758
|
});
|
|
12759
12759
|
|
|
12760
|
+
// ../../src/lib/api-contracts/cli/investigation-review.ts
|
|
12761
|
+
var InvestigationReviewDecisionSchema;
|
|
12762
|
+
var init_investigation_review = __esm({
|
|
12763
|
+
"../../src/lib/api-contracts/cli/investigation-review.ts"() {
|
|
12764
|
+
init_zod();
|
|
12765
|
+
InvestigationReviewDecisionSchema = external_exports.object({
|
|
12766
|
+
operation: external_exports.enum(["conclude_claim", "block_claim", "retire_claim", "close", "reopen", "retire"]),
|
|
12767
|
+
conclusion: external_exports.enum(["supported", "partial", "contradicted", "insufficient_evidence"]).optional(),
|
|
12768
|
+
verdict_tier: external_exports.enum(["eyeballed", "tested", "reviewed"]).optional(),
|
|
12769
|
+
decision: external_exports.enum(["merge", "more_evidence", "drop"]).optional(),
|
|
12770
|
+
next_action: external_exports.string().trim().min(1).max(5e3).optional()
|
|
12771
|
+
}).superRefine((value, ctx) => {
|
|
12772
|
+
if (value.operation === "conclude_claim" && (!value.conclusion || !value.verdict_tier))
|
|
12773
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "A conclusion and verdict tier are required." });
|
|
12774
|
+
if (value.operation === "conclude_claim" && value.decision === "more_evidence" && !value.next_action)
|
|
12775
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["next_action"], message: "More evidence requires a next action." });
|
|
12776
|
+
if (value.operation === "block_claim" && !value.next_action)
|
|
12777
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, path: ["next_action"], message: "A blocker requires the next action that can unblock it." });
|
|
12778
|
+
});
|
|
12779
|
+
}
|
|
12780
|
+
});
|
|
12781
|
+
|
|
12760
12782
|
// ../../src/lib/api-contracts/cli/inbox-management.ts
|
|
12761
12783
|
function inboxSourceVersionsMatch(current, reviewed) {
|
|
12762
12784
|
if (typeof current !== "string" || typeof reviewed !== "string") return current === reviewed;
|
|
12763
12785
|
const canonicalUtc = (value) => value.replace(/\+00:00$/i, "Z");
|
|
12764
12786
|
return canonicalUtc(current) === canonicalUtc(reviewed);
|
|
12765
12787
|
}
|
|
12766
|
-
var InboxUtcTimestampSchema, InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, changeCommon, CHANGE_MANAGEMENT_BINDINGS, opportunityCommon, OPPORTUNITY_MANAGEMENT_BINDINGS, annotationCommon, ANNOTATION_MANAGEMENT_BINDINGS, lifecycleMutationInputs, FDE_ACTION_MANAGEMENT_BINDINGS, GRAPH_RECOVERY_MANAGEMENT_BINDINGS, InboxManagementCatalogResponseSchema, InboxOrganizationsResponseSchema, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, AnnotationSnapshotSchema, AnnotationUnknownReceiptSchema, InboxOperationEnvelopeSchema;
|
|
12788
|
+
var InboxUtcTimestampSchema, InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, changeCommon, CHANGE_MANAGEMENT_BINDINGS, opportunityCommon, graphDecisionErrorCodes, OPPORTUNITY_MANAGEMENT_BINDINGS, annotationCommon, ANNOTATION_MANAGEMENT_BINDINGS, lifecycleMutationInputs, FDE_ACTION_MANAGEMENT_BINDINGS, GRAPH_RECOVERY_MANAGEMENT_BINDINGS, InboxManagementCatalogResponseSchema, InboxOrganizationsResponseSchema, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, AnnotationSnapshotSchema, AnnotationUnknownReceiptSchema, InboxOperationEnvelopeSchema;
|
|
12767
12789
|
var init_inbox_management = __esm({
|
|
12768
12790
|
"../../src/lib/api-contracts/cli/inbox-management.ts"() {
|
|
12769
12791
|
init_zod();
|
|
12792
|
+
init_investigation_review();
|
|
12770
12793
|
InboxUtcTimestampSchema = external_exports.string().datetime({ offset: true }).refine(
|
|
12771
12794
|
(value) => /(?:Z|\+00:00)$/i.test(value),
|
|
12772
12795
|
"source version must use UTC (Z or +00:00)"
|
|
@@ -12920,10 +12943,20 @@ var init_inbox_management = __esm({
|
|
|
12920
12943
|
"brain_opportunity_stale",
|
|
12921
12944
|
"brain_opportunity_assignment_target_invalid",
|
|
12922
12945
|
"missing_assignment",
|
|
12946
|
+
"missing_proposed_assignee",
|
|
12923
12947
|
"wording_mismatch",
|
|
12924
12948
|
"recipient_mismatch",
|
|
12925
12949
|
"proposal_failed",
|
|
12926
12950
|
"graph_decision_conflict",
|
|
12951
|
+
"opportunity_not_decidable",
|
|
12952
|
+
"opportunity_applied_receipt_unavailable",
|
|
12953
|
+
"opportunity_preflight_failed",
|
|
12954
|
+
"graph_decision_reason_required",
|
|
12955
|
+
"graph_decision_assignee_required",
|
|
12956
|
+
"graph_decision_assignee_invalid",
|
|
12957
|
+
"graph_decision_invalid",
|
|
12958
|
+
"graph_decision_command_id_required",
|
|
12959
|
+
"graph_decision_command_id_too_long",
|
|
12927
12960
|
"stale_action",
|
|
12928
12961
|
"invalid_transition",
|
|
12929
12962
|
"stale_transition",
|
|
@@ -13256,6 +13289,18 @@ var init_inbox_management = __esm({
|
|
|
13256
13289
|
"malformed_response"
|
|
13257
13290
|
]
|
|
13258
13291
|
};
|
|
13292
|
+
graphDecisionErrorCodes = [
|
|
13293
|
+
"opportunity_not_decidable",
|
|
13294
|
+
"opportunity_applied_receipt_unavailable",
|
|
13295
|
+
"opportunity_preflight_failed",
|
|
13296
|
+
"missing_proposed_assignee",
|
|
13297
|
+
"graph_decision_reason_required",
|
|
13298
|
+
"graph_decision_assignee_required",
|
|
13299
|
+
"graph_decision_assignee_invalid",
|
|
13300
|
+
"graph_decision_invalid",
|
|
13301
|
+
"graph_decision_command_id_required",
|
|
13302
|
+
"graph_decision_command_id_too_long"
|
|
13303
|
+
];
|
|
13259
13304
|
OPPORTUNITY_MANAGEMENT_BINDINGS = [
|
|
13260
13305
|
{
|
|
13261
13306
|
...opportunityCommon,
|
|
@@ -13320,7 +13365,8 @@ var init_inbox_management = __esm({
|
|
|
13320
13365
|
"missing_assignment",
|
|
13321
13366
|
"wording_mismatch",
|
|
13322
13367
|
"recipient_mismatch",
|
|
13323
|
-
"graph_decision_conflict"
|
|
13368
|
+
"graph_decision_conflict",
|
|
13369
|
+
...graphDecisionErrorCodes
|
|
13324
13370
|
]
|
|
13325
13371
|
},
|
|
13326
13372
|
...["reject", "defer", "annotate", "block"].map((decision) => ({
|
|
@@ -13347,7 +13393,8 @@ var init_inbox_management = __esm({
|
|
|
13347
13393
|
error_codes: [
|
|
13348
13394
|
...opportunityCommon.error_codes,
|
|
13349
13395
|
"brain_opportunity_stale",
|
|
13350
|
-
"graph_decision_conflict"
|
|
13396
|
+
"graph_decision_conflict",
|
|
13397
|
+
...graphDecisionErrorCodes
|
|
13351
13398
|
]
|
|
13352
13399
|
})),
|
|
13353
13400
|
{
|
|
@@ -13471,7 +13518,8 @@ var init_inbox_management = __esm({
|
|
|
13471
13518
|
description: "Execute one server-advertised FDE action command",
|
|
13472
13519
|
inputs: {
|
|
13473
13520
|
...lifecycleMutationInputs,
|
|
13474
|
-
required: [...lifecycleMutationInputs.required, "command"]
|
|
13521
|
+
required: [...lifecycleMutationInputs.required, "command"],
|
|
13522
|
+
optional: [...lifecycleMutationInputs.optional, "investigation_decision"]
|
|
13475
13523
|
},
|
|
13476
13524
|
approval_required: true,
|
|
13477
13525
|
side_effect: "applies the selected legal FDE action transition",
|
|
@@ -13796,6 +13844,7 @@ var init_inbox_management = __esm({
|
|
|
13796
13844
|
"reject"
|
|
13797
13845
|
]),
|
|
13798
13846
|
reason: external_exports.string().trim().min(3).max(1e3),
|
|
13847
|
+
investigation_decision: InvestigationReviewDecisionSchema.optional(),
|
|
13799
13848
|
approved: external_exports.literal(true),
|
|
13800
13849
|
approved_effect: external_exports.literal("apply_server_advertised_fde_action_command"),
|
|
13801
13850
|
approved_reversible: external_exports.literal(true)
|
|
@@ -13993,7 +14042,9 @@ var init_inbox_management = __esm({
|
|
|
13993
14042
|
OpportunityUnknownReceiptSchema = external_exports.object({
|
|
13994
14043
|
state: external_exports.literal("unknown"),
|
|
13995
14044
|
command_id: external_exports.string(),
|
|
13996
|
-
instruction: external_exports.literal("inspect_source_before_retry")
|
|
14045
|
+
instruction: external_exports.literal("inspect_source_before_retry"),
|
|
14046
|
+
reason: external_exports.enum(["read_back_unavailable", "postcondition_not_observed", "command_receipt_unavailable"]),
|
|
14047
|
+
read_back: OpportunitySnapshotSchema.optional()
|
|
13997
14048
|
});
|
|
13998
14049
|
OpportunityCommandSchema = external_exports.union([
|
|
13999
14050
|
external_exports.object({
|
|
@@ -14796,6 +14847,7 @@ function parseEvalManagementOperationData(call, data, selectedOrgId) {
|
|
|
14796
14847
|
parsed = InvestigationControlReceiptSchema.parse(data);
|
|
14797
14848
|
else if ([
|
|
14798
14849
|
"investigation.conclude_claim",
|
|
14850
|
+
"investigation.retire_claim",
|
|
14799
14851
|
"investigation.close",
|
|
14800
14852
|
"investigation.reopen",
|
|
14801
14853
|
"investigation.retire"
|
|
@@ -14824,7 +14876,7 @@ function parseEvalManagementOperationData(call, data, selectedOrgId) {
|
|
|
14824
14876
|
if (receipt.operation !== action) mismatch("operation");
|
|
14825
14877
|
if (inputId && !sameId(receipt.investigation_id, inputId))
|
|
14826
14878
|
mismatch("investigation_id");
|
|
14827
|
-
} else if (operation === "investigation.conclude_claim" || operation === "investigation.close" || operation === "investigation.reopen" || operation === "investigation.retire") {
|
|
14879
|
+
} else if (operation === "investigation.conclude_claim" || operation === "investigation.retire_claim" || operation === "investigation.close" || operation === "investigation.reopen" || operation === "investigation.retire") {
|
|
14828
14880
|
const receipt = parsed;
|
|
14829
14881
|
if (receipt.operation !== action) mismatch("operation");
|
|
14830
14882
|
if (inputId && !sameId(receipt.investigation_id, inputId))
|
|
@@ -14851,7 +14903,7 @@ function parseEvalManagementOperationData(call, data, selectedOrgId) {
|
|
|
14851
14903
|
}
|
|
14852
14904
|
return parsed;
|
|
14853
14905
|
}
|
|
14854
|
-
var EvalManagementOperationSchema, EvalManagementBindingSchema, EvalManagementInputHelpSchema, EVAL_MANAGEMENT_INPUTS, common2, EVAL_MANAGEMENT_BINDINGS, EvalManagementCatalogResponseSchema, EvalManagementCallSchema, EvalManagementScopeSchema, InvestigationPublicationReceiptSchema, InvestigationAuthoringDataSchema, InvestigationControlReceiptSchema, InvestigationDecisionReceiptSchema, InvestigationWaveMemberReceiptSchema, InvestigationWaveCreateReceiptSchema, InvestigationWaveUpdateReceiptSchema, InvestigationWaveScheduleReceiptSchema, EvalManagementCatalogResultSchema, EvalManagementResultSchema;
|
|
14906
|
+
var EvalManagementOperationSchema, EvalManagementBindingSchema, EvalManagementCatalogBindingSchema, EvalManagementInputHelpSchema, EVAL_MANAGEMENT_INPUTS, common2, EVAL_MANAGEMENT_BINDINGS, EvalManagementCatalogResponseSchema, EvalManagementCallSchema, EvalManagementScopeSchema, InvestigationPublicationReceiptSchema, InvestigationAuthoringDataSchema, InvestigationControlReceiptSchema, InvestigationDecisionReceiptSchema, InvestigationWaveMemberReceiptSchema, InvestigationWaveCreateReceiptSchema, InvestigationWaveUpdateReceiptSchema, InvestigationWaveScheduleReceiptSchema, EvalManagementCatalogResultSchema, EvalManagementResultSchema;
|
|
14855
14907
|
var init_eval_management = __esm({
|
|
14856
14908
|
"../../src/lib/api-contracts/cli/eval-management.ts"() {
|
|
14857
14909
|
init_zod();
|
|
@@ -14865,6 +14917,7 @@ var init_eval_management = __esm({
|
|
|
14865
14917
|
"investigation.resume",
|
|
14866
14918
|
"investigation.cancel",
|
|
14867
14919
|
"investigation.conclude_claim",
|
|
14920
|
+
"investigation.retire_claim",
|
|
14868
14921
|
"investigation.close",
|
|
14869
14922
|
"investigation.reopen",
|
|
14870
14923
|
"investigation.retire",
|
|
@@ -14887,6 +14940,9 @@ var init_eval_management = __esm({
|
|
|
14887
14940
|
minimum_cli_version: external_exports.string(),
|
|
14888
14941
|
explicit_org_scope: external_exports.boolean()
|
|
14889
14942
|
});
|
|
14943
|
+
EvalManagementCatalogBindingSchema = EvalManagementBindingSchema.extend({
|
|
14944
|
+
operation: external_exports.string().min(1)
|
|
14945
|
+
});
|
|
14890
14946
|
EvalManagementInputHelpSchema = external_exports.object({
|
|
14891
14947
|
required: external_exports.array(external_exports.string()),
|
|
14892
14948
|
optional: external_exports.array(external_exports.string()),
|
|
@@ -14949,6 +15005,11 @@ var init_eval_management = __esm({
|
|
|
14949
15005
|
optional: ["decision", "next_action", "expected_source_sha"],
|
|
14950
15006
|
server_injected: { operation: "conclude_claim" }
|
|
14951
15007
|
},
|
|
15008
|
+
"investigation.retire_claim": {
|
|
15009
|
+
required: ["id", "brand_id", "command_id", "claim_key", "body"],
|
|
15010
|
+
optional: ["expected_source_sha"],
|
|
15011
|
+
server_injected: { operation: "retire_claim" }
|
|
15012
|
+
},
|
|
14952
15013
|
"investigation.close": {
|
|
14953
15014
|
required: ["id", "brand_id", "command_id", "body"],
|
|
14954
15015
|
optional: ["expected_source_sha"],
|
|
@@ -15086,6 +15147,20 @@ var init_eval_management = __esm({
|
|
|
15086
15147
|
minimum_cli_version: "0.1.11",
|
|
15087
15148
|
explicit_org_scope: true
|
|
15088
15149
|
},
|
|
15150
|
+
{
|
|
15151
|
+
...common2,
|
|
15152
|
+
operation: "investigation.retire_claim",
|
|
15153
|
+
description: "Retire an unrun claim with an FDE-authored reason",
|
|
15154
|
+
method: "POST",
|
|
15155
|
+
path: "/api/v1/eval/investigations/{id}/decisions",
|
|
15156
|
+
side_effect: "append-only FDE judgment plus repo and Tests lifecycle update",
|
|
15157
|
+
receipt: "decision, judgment, publication, and projection receipt",
|
|
15158
|
+
// 0.1.12 is the first stable whose catalog parser tolerates this
|
|
15159
|
+
// additive operation; every earlier stable rejects the whole catalog
|
|
15160
|
+
// once it appears (BAM-5292), so it must not claim 0.1.11.
|
|
15161
|
+
minimum_cli_version: "0.1.12",
|
|
15162
|
+
explicit_org_scope: true
|
|
15163
|
+
},
|
|
15089
15164
|
{
|
|
15090
15165
|
...common2,
|
|
15091
15166
|
operation: "investigation.close",
|
|
@@ -15175,11 +15250,8 @@ var init_eval_management = __esm({
|
|
|
15175
15250
|
];
|
|
15176
15251
|
EvalManagementCatalogResponseSchema = external_exports.object({
|
|
15177
15252
|
contract_version: external_exports.literal(1),
|
|
15178
|
-
bindings: external_exports.array(
|
|
15179
|
-
inputs: external_exports.record(
|
|
15180
|
-
EvalManagementOperationSchema,
|
|
15181
|
-
EvalManagementInputHelpSchema
|
|
15182
|
-
),
|
|
15253
|
+
bindings: external_exports.array(EvalManagementCatalogBindingSchema),
|
|
15254
|
+
inputs: external_exports.record(external_exports.string(), EvalManagementInputHelpSchema),
|
|
15183
15255
|
related_cli_commands: external_exports.array(external_exports.string())
|
|
15184
15256
|
});
|
|
15185
15257
|
EvalManagementCallSchema = external_exports.object({
|
|
@@ -15246,7 +15318,13 @@ var init_eval_management = __esm({
|
|
|
15246
15318
|
id: external_exports.string().uuid(),
|
|
15247
15319
|
judgment_id: external_exports.string().uuid(),
|
|
15248
15320
|
investigation_id: external_exports.string().uuid(),
|
|
15249
|
-
operation: external_exports.enum([
|
|
15321
|
+
operation: external_exports.enum([
|
|
15322
|
+
"conclude_claim",
|
|
15323
|
+
"retire_claim",
|
|
15324
|
+
"close",
|
|
15325
|
+
"reopen",
|
|
15326
|
+
"retire"
|
|
15327
|
+
]),
|
|
15250
15328
|
publication_status: external_exports.enum(["pending", "published", "failed"]),
|
|
15251
15329
|
source_sha: external_exports.string().nullable().optional(),
|
|
15252
15330
|
pr_url: external_exports.string().url().nullable().optional(),
|
|
@@ -15988,6 +16066,7 @@ async function callEvalManagement(bambooSession, call, orgId) {
|
|
|
15988
16066
|
"resume",
|
|
15989
16067
|
"cancel",
|
|
15990
16068
|
"conclude_claim",
|
|
16069
|
+
"retire_claim",
|
|
15991
16070
|
"close",
|
|
15992
16071
|
"reopen",
|
|
15993
16072
|
"retire"
|
|
@@ -20730,7 +20809,7 @@ async function runInboxManage(options) {
|
|
|
20730
20809
|
{ code: "organization_scope_mismatch" }
|
|
20731
20810
|
);
|
|
20732
20811
|
const suppliedVersion = input.source_version ?? input.subject_revision;
|
|
20733
|
-
if (!isProposal && !inboxSourceVersionsMatch(preview.source_version, suppliedVersion))
|
|
20812
|
+
if (!isProposal && !isFdeAction && !inboxSourceVersionsMatch(preview.source_version, suppliedVersion))
|
|
20734
20813
|
throw Object.assign(
|
|
20735
20814
|
new Error(
|
|
20736
20815
|
`The reviewed source revision ${String(suppliedVersion)} is stale; current revision is ${preview.source_version}.`
|
|
@@ -22326,7 +22405,9 @@ function managementOutcomeLine(result, readOnly) {
|
|
|
22326
22405
|
if (["hold", "resume", "cancel"].includes(lifecycle ?? "")) {
|
|
22327
22406
|
return `${lifecycle === "hold" ? "Held" : lifecycle === "resume" ? "Resumed" : "Canceled pending work for"} the investigation.`;
|
|
22328
22407
|
}
|
|
22329
|
-
if (["conclude_claim", "close", "reopen", "retire"].includes(
|
|
22408
|
+
if (["conclude_claim", "retire_claim", "close", "reopen", "retire"].includes(
|
|
22409
|
+
lifecycle ?? ""
|
|
22410
|
+
)) {
|
|
22330
22411
|
const publicationStatus = data.publication_status;
|
|
22331
22412
|
return publicationStatus === "pending" ? `Recorded ${result.operation}; repository publication is pending.` : `Published ${result.operation} with its decision receipt.`;
|
|
22332
22413
|
}
|