bamboo-agents 0.1.8-dev.96.9c7d886 → 0.1.8-dev.98.9f07155
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 +309 -15
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.8-dev.
|
|
1
|
+
0.1.8-dev.98.9f07155
|
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.8-dev.
|
|
3040
|
+
VERSION = "0.1.8-dev.98.9f07155";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -12756,7 +12756,7 @@ var init_inbox_apply_revision = __esm({
|
|
|
12756
12756
|
});
|
|
12757
12757
|
|
|
12758
12758
|
// ../../src/lib/api-contracts/cli/inbox-management.ts
|
|
12759
|
-
var InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, changeCommon, CHANGE_MANAGEMENT_BINDINGS, opportunityCommon, OPPORTUNITY_MANAGEMENT_BINDINGS, lifecycleMutationInputs, FDE_ACTION_MANAGEMENT_BINDINGS, GRAPH_RECOVERY_MANAGEMENT_BINDINGS, InboxManagementCatalogResponseSchema, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, InboxOperationEnvelopeSchema;
|
|
12759
|
+
var 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, OpportunityDecisionInputBaseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, UnknownMutationReceiptSchema, ChangeReadBackSchema, OpportunitySnapshotSchema, OpportunityUnknownReceiptSchema, OpportunityCommandSchema, FdeActionSnapshotSchema, GraphRecoverySnapshotSchema, LifecycleUnknownReceiptSchema, AnnotationSnapshotSchema, AnnotationUnknownReceiptSchema, InboxOperationEnvelopeSchema;
|
|
12760
12760
|
var init_inbox_management = __esm({
|
|
12761
12761
|
"../../src/lib/api-contracts/cli/inbox-management.ts"() {
|
|
12762
12762
|
init_zod();
|
|
@@ -12779,11 +12779,15 @@ var init_inbox_management = __esm({
|
|
|
12779
12779
|
"opportunity.defer",
|
|
12780
12780
|
"opportunity.annotate",
|
|
12781
12781
|
"opportunity.block",
|
|
12782
|
+
"opportunity.record_answer",
|
|
12782
12783
|
"fde_action.get",
|
|
12783
12784
|
"fde_action.command",
|
|
12784
12785
|
"graph_recovery.get",
|
|
12785
12786
|
"graph_recovery.command",
|
|
12786
|
-
"graph_recovery.select_predecessor"
|
|
12787
|
+
"graph_recovery.select_predecessor",
|
|
12788
|
+
"annotation.get",
|
|
12789
|
+
"annotation.command",
|
|
12790
|
+
"annotation.complete"
|
|
12787
12791
|
]);
|
|
12788
12792
|
InboxManageOperationSchema = external_exports.enum([
|
|
12789
12793
|
"inbox.list",
|
|
@@ -12802,11 +12806,15 @@ var init_inbox_management = __esm({
|
|
|
12802
12806
|
"opportunity.defer",
|
|
12803
12807
|
"opportunity.annotate",
|
|
12804
12808
|
"opportunity.block",
|
|
12809
|
+
"opportunity.record_answer",
|
|
12805
12810
|
"fde_action.get",
|
|
12806
12811
|
"fde_action.command",
|
|
12807
12812
|
"graph_recovery.get",
|
|
12808
12813
|
"graph_recovery.command",
|
|
12809
|
-
"graph_recovery.select_predecessor"
|
|
12814
|
+
"graph_recovery.select_predecessor",
|
|
12815
|
+
"annotation.get",
|
|
12816
|
+
"annotation.command",
|
|
12817
|
+
"annotation.complete"
|
|
12810
12818
|
]);
|
|
12811
12819
|
InboxOperationBindingSchema = external_exports.object({
|
|
12812
12820
|
operation: InboxOperationSchema,
|
|
@@ -12816,7 +12824,8 @@ var init_inbox_management = __esm({
|
|
|
12816
12824
|
"workspace_change",
|
|
12817
12825
|
"brain_opportunity",
|
|
12818
12826
|
"fde_action",
|
|
12819
|
-
"graph_recovery"
|
|
12827
|
+
"graph_recovery",
|
|
12828
|
+
"output_annotation"
|
|
12820
12829
|
]),
|
|
12821
12830
|
method: external_exports.literal("POST"),
|
|
12822
12831
|
path: external_exports.string().startsWith("/api/v1/"),
|
|
@@ -12850,11 +12859,15 @@ var init_inbox_management = __esm({
|
|
|
12850
12859
|
"opportunity_defer_receipt_v1",
|
|
12851
12860
|
"opportunity_annotate_receipt_v1",
|
|
12852
12861
|
"opportunity_block_receipt_v1",
|
|
12862
|
+
"opportunity_answer_receipt_v1",
|
|
12853
12863
|
"fde_action_get_receipt_v1",
|
|
12854
12864
|
"fde_action_command_receipt_v1",
|
|
12855
12865
|
"graph_recovery_get_receipt_v1",
|
|
12856
12866
|
"graph_recovery_command_receipt_v1",
|
|
12857
|
-
"graph_recovery_predecessor_receipt_v1"
|
|
12867
|
+
"graph_recovery_predecessor_receipt_v1",
|
|
12868
|
+
"annotation_get_receipt_v1",
|
|
12869
|
+
"annotation_command_receipt_v1",
|
|
12870
|
+
"annotation_complete_receipt_v1"
|
|
12858
12871
|
]),
|
|
12859
12872
|
error_codes: external_exports.array(
|
|
12860
12873
|
external_exports.enum([
|
|
@@ -12885,6 +12898,10 @@ var init_inbox_management = __esm({
|
|
|
12885
12898
|
"idempotency_conflict",
|
|
12886
12899
|
"already_merged",
|
|
12887
12900
|
"unknown_outcome",
|
|
12901
|
+
"source_output_unavailable",
|
|
12902
|
+
"source_output_read_failed",
|
|
12903
|
+
"brain_opportunity_answer_stale_source",
|
|
12904
|
+
"brain_opportunity_answer_idempotency_conflict",
|
|
12888
12905
|
"approval_required",
|
|
12889
12906
|
"policy_blocked",
|
|
12890
12907
|
"decline_forbidden",
|
|
@@ -12900,7 +12917,11 @@ var init_inbox_management = __esm({
|
|
|
12900
12917
|
"invalid_transition",
|
|
12901
12918
|
"stale_transition",
|
|
12902
12919
|
"graph_recovery_unavailable",
|
|
12903
|
-
"continuation_required"
|
|
12920
|
+
"continuation_required",
|
|
12921
|
+
"task_changed",
|
|
12922
|
+
"invalid_transition",
|
|
12923
|
+
"invalid_assignee",
|
|
12924
|
+
"label_write_failed"
|
|
12904
12925
|
])
|
|
12905
12926
|
),
|
|
12906
12927
|
minimum_cli_version: external_exports.string()
|
|
@@ -13317,7 +13338,93 @@ var init_inbox_management = __esm({
|
|
|
13317
13338
|
"brain_opportunity_stale",
|
|
13318
13339
|
"graph_decision_conflict"
|
|
13319
13340
|
]
|
|
13320
|
-
}))
|
|
13341
|
+
})),
|
|
13342
|
+
{
|
|
13343
|
+
...opportunityCommon,
|
|
13344
|
+
operation: "opportunity.record_answer",
|
|
13345
|
+
description: "Record attributed FDE evidence and verify Brain publication",
|
|
13346
|
+
inputs: {
|
|
13347
|
+
required: [
|
|
13348
|
+
"opportunity_id",
|
|
13349
|
+
"source_version",
|
|
13350
|
+
"command_id",
|
|
13351
|
+
"answer",
|
|
13352
|
+
"approved",
|
|
13353
|
+
"approved_effect",
|
|
13354
|
+
"approved_reversible"
|
|
13355
|
+
],
|
|
13356
|
+
optional: ["brand_id", "subquestion_key", "slot_key"],
|
|
13357
|
+
server_injected: { answer_actor_type: "fde_evidence" }
|
|
13358
|
+
},
|
|
13359
|
+
approval_required: true,
|
|
13360
|
+
side_effect: "records attributed FDE evidence and attempts canonical Brain publication",
|
|
13361
|
+
receipt: "answer attribution plus pending, published, skipped, failed, or unknown publication state",
|
|
13362
|
+
receipt_type: "opportunity_answer_receipt_v1",
|
|
13363
|
+
error_codes: [
|
|
13364
|
+
...opportunityCommon.error_codes,
|
|
13365
|
+
"brain_opportunity_answer_stale_source",
|
|
13366
|
+
"brain_opportunity_answer_idempotency_conflict",
|
|
13367
|
+
"unknown_outcome"
|
|
13368
|
+
]
|
|
13369
|
+
}
|
|
13370
|
+
];
|
|
13371
|
+
annotationCommon = {
|
|
13372
|
+
...common,
|
|
13373
|
+
work_item_family: "output_annotation",
|
|
13374
|
+
description: "",
|
|
13375
|
+
inputs: {
|
|
13376
|
+
required: ["task_id"],
|
|
13377
|
+
optional: ["brand_id", "command_id", "command_operation"],
|
|
13378
|
+
server_injected: {}
|
|
13379
|
+
},
|
|
13380
|
+
error_codes: [
|
|
13381
|
+
...common.error_codes,
|
|
13382
|
+
"task_changed",
|
|
13383
|
+
"invalid_transition",
|
|
13384
|
+
"invalid_assignee",
|
|
13385
|
+
"label_write_failed",
|
|
13386
|
+
"idempotency_conflict",
|
|
13387
|
+
"unknown_outcome",
|
|
13388
|
+
"source_output_unavailable",
|
|
13389
|
+
"source_output_read_failed"
|
|
13390
|
+
]
|
|
13391
|
+
};
|
|
13392
|
+
ANNOTATION_MANAGEMENT_BINDINGS = [
|
|
13393
|
+
{
|
|
13394
|
+
...annotationCommon,
|
|
13395
|
+
operation: "annotation.get",
|
|
13396
|
+
description: "Inspect one output-annotation task and its current legal actions",
|
|
13397
|
+
receipt: "current source output, evidence, legal actions, and lock version",
|
|
13398
|
+
receipt_type: "annotation_get_receipt_v1"
|
|
13399
|
+
},
|
|
13400
|
+
{
|
|
13401
|
+
...annotationCommon,
|
|
13402
|
+
operation: "annotation.command",
|
|
13403
|
+
description: "Apply one server-advertised annotation routing command",
|
|
13404
|
+
inputs: {
|
|
13405
|
+
required: ["task_id", "source_version", "command_id", "command", "approved", "approved_effect", "approved_reversible"],
|
|
13406
|
+
optional: ["brand_id", "target_user_id", "reason"],
|
|
13407
|
+
server_injected: {}
|
|
13408
|
+
},
|
|
13409
|
+
approval_required: true,
|
|
13410
|
+
side_effect: "updates the authoritative annotation task lifecycle",
|
|
13411
|
+
receipt: "completed, no-change, stale, conflict, or unknown task state",
|
|
13412
|
+
receipt_type: "annotation_command_receipt_v1"
|
|
13413
|
+
},
|
|
13414
|
+
{
|
|
13415
|
+
...annotationCommon,
|
|
13416
|
+
operation: "annotation.complete",
|
|
13417
|
+
description: "Write approved rubric labels and complete one annotation task",
|
|
13418
|
+
inputs: {
|
|
13419
|
+
required: ["task_id", "source_version", "command_id", "labels", "approved", "approved_effect", "approved_reversible"],
|
|
13420
|
+
optional: ["brand_id", "reason"],
|
|
13421
|
+
server_injected: { source: "cli" }
|
|
13422
|
+
},
|
|
13423
|
+
approval_required: true,
|
|
13424
|
+
side_effect: "writes labels through the canonical label writer and advances the task",
|
|
13425
|
+
receipt: "completion state, label-write receipts, and authoritative read-back",
|
|
13426
|
+
receipt_type: "annotation_complete_receipt_v1"
|
|
13427
|
+
}
|
|
13321
13428
|
];
|
|
13322
13429
|
lifecycleMutationInputs = {
|
|
13323
13430
|
required: [
|
|
@@ -13630,6 +13737,23 @@ var init_inbox_management = __esm({
|
|
|
13630
13737
|
approved_effect: external_exports.literal("block_internal_opportunity")
|
|
13631
13738
|
})
|
|
13632
13739
|
}),
|
|
13740
|
+
external_exports.object({
|
|
13741
|
+
operation: external_exports.literal("opportunity.record_answer"),
|
|
13742
|
+
input: external_exports.object({
|
|
13743
|
+
opportunity_id: external_exports.string().uuid(),
|
|
13744
|
+
brand_id: external_exports.string().uuid().optional(),
|
|
13745
|
+
source_version: external_exports.string().datetime(),
|
|
13746
|
+
command_id: external_exports.string().min(1).max(128),
|
|
13747
|
+
answer: external_exports.string().trim().min(1).max(2e4),
|
|
13748
|
+
subquestion_key: external_exports.string().trim().min(1).max(240).optional(),
|
|
13749
|
+
slot_key: external_exports.string().trim().min(1).max(240).optional(),
|
|
13750
|
+
approved: external_exports.literal(true),
|
|
13751
|
+
approved_effect: external_exports.literal(
|
|
13752
|
+
"record_fde_evidence_and_attempt_brain_publication"
|
|
13753
|
+
),
|
|
13754
|
+
approved_reversible: external_exports.literal(false)
|
|
13755
|
+
})
|
|
13756
|
+
}),
|
|
13633
13757
|
external_exports.object({
|
|
13634
13758
|
operation: external_exports.literal("fde_action.get"),
|
|
13635
13759
|
input: external_exports.object({
|
|
@@ -13696,6 +13820,70 @@ var init_inbox_management = __esm({
|
|
|
13696
13820
|
approved_effect: external_exports.literal("continue_from_selected_predecessor"),
|
|
13697
13821
|
approved_reversible: external_exports.literal(false)
|
|
13698
13822
|
})
|
|
13823
|
+
}),
|
|
13824
|
+
external_exports.object({
|
|
13825
|
+
operation: external_exports.literal("annotation.get"),
|
|
13826
|
+
input: external_exports.object({
|
|
13827
|
+
task_id: external_exports.string().uuid(),
|
|
13828
|
+
brand_id: external_exports.string().uuid().optional(),
|
|
13829
|
+
command_id: external_exports.string().min(1).max(200).optional(),
|
|
13830
|
+
command_operation: external_exports.enum(["claim", "assign", "reassign", "escalate", "recall", "dismiss", "complete"]).optional()
|
|
13831
|
+
}).refine((value) => Boolean(value.command_id) === Boolean(value.command_operation), {
|
|
13832
|
+
message: "command_id and command_operation must be supplied together"
|
|
13833
|
+
})
|
|
13834
|
+
}),
|
|
13835
|
+
external_exports.object({
|
|
13836
|
+
operation: external_exports.literal("annotation.command"),
|
|
13837
|
+
input: external_exports.object({
|
|
13838
|
+
task_id: external_exports.string().uuid(),
|
|
13839
|
+
brand_id: external_exports.string().uuid().optional(),
|
|
13840
|
+
source_version: external_exports.number().int().positive(),
|
|
13841
|
+
command_id: external_exports.string().min(1).max(200),
|
|
13842
|
+
command: external_exports.enum(["claim", "assign", "reassign", "escalate", "recall", "dismiss"]),
|
|
13843
|
+
target_user_id: external_exports.string().uuid().optional(),
|
|
13844
|
+
reason: external_exports.string().trim().min(1).max(1e3).optional(),
|
|
13845
|
+
approved: external_exports.literal(true),
|
|
13846
|
+
approved_effect: external_exports.enum([
|
|
13847
|
+
"claim_annotation_task",
|
|
13848
|
+
"assign_annotation_task",
|
|
13849
|
+
"reassign_annotation_task",
|
|
13850
|
+
"escalate_annotation_task",
|
|
13851
|
+
"recall_annotation_task",
|
|
13852
|
+
"dismiss_annotation_task"
|
|
13853
|
+
]),
|
|
13854
|
+
approved_reversible: external_exports.boolean()
|
|
13855
|
+
}).superRefine((value, ctx) => {
|
|
13856
|
+
const expected = {
|
|
13857
|
+
claim: { effect: "claim_annotation_task", reversible: true },
|
|
13858
|
+
assign: { effect: "assign_annotation_task", reversible: true },
|
|
13859
|
+
reassign: { effect: "reassign_annotation_task", reversible: true },
|
|
13860
|
+
escalate: { effect: "escalate_annotation_task", reversible: true },
|
|
13861
|
+
recall: { effect: "recall_annotation_task", reversible: true },
|
|
13862
|
+
dismiss: { effect: "dismiss_annotation_task", reversible: false }
|
|
13863
|
+
}[value.command];
|
|
13864
|
+
if (value.approved_effect !== expected.effect || value.approved_reversible !== expected.reversible) {
|
|
13865
|
+
ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: "approval fingerprint does not match the annotation command" });
|
|
13866
|
+
}
|
|
13867
|
+
})
|
|
13868
|
+
}),
|
|
13869
|
+
external_exports.object({
|
|
13870
|
+
operation: external_exports.literal("annotation.complete"),
|
|
13871
|
+
input: external_exports.object({
|
|
13872
|
+
task_id: external_exports.string().uuid(),
|
|
13873
|
+
brand_id: external_exports.string().uuid().optional(),
|
|
13874
|
+
source_version: external_exports.number().int().positive(),
|
|
13875
|
+
command_id: external_exports.string().min(1).max(200),
|
|
13876
|
+
labels: external_exports.array(external_exports.object({
|
|
13877
|
+
criterion_key: external_exports.string().min(1).max(120),
|
|
13878
|
+
verdict: external_exports.enum(["pass", "fail", "n/a"]),
|
|
13879
|
+
note: external_exports.string().max(4e3).optional(),
|
|
13880
|
+
provenance: external_exports.enum(["blind", "flip", "anchored_agree"]).optional()
|
|
13881
|
+
})).min(1),
|
|
13882
|
+
reason: external_exports.string().trim().min(1).max(1e3).optional(),
|
|
13883
|
+
approved: external_exports.literal(true),
|
|
13884
|
+
approved_effect: external_exports.literal("write_annotation_labels_and_complete_task"),
|
|
13885
|
+
approved_reversible: external_exports.literal(false)
|
|
13886
|
+
})
|
|
13699
13887
|
})
|
|
13700
13888
|
]);
|
|
13701
13889
|
InboxWorkItemSchema = external_exports.object({
|
|
@@ -13823,6 +14011,26 @@ var init_inbox_management = __esm({
|
|
|
13823
14011
|
command_id: external_exports.string(),
|
|
13824
14012
|
instruction: external_exports.literal("inspect_source_before_retry")
|
|
13825
14013
|
});
|
|
14014
|
+
AnnotationSnapshotSchema = external_exports.object({
|
|
14015
|
+
id: external_exports.string().uuid(),
|
|
14016
|
+
brand_id: external_exports.string().uuid(),
|
|
14017
|
+
lock_version: external_exports.number().int().positive(),
|
|
14018
|
+
status: external_exports.string(),
|
|
14019
|
+
stage: external_exports.string(),
|
|
14020
|
+
valid_next_actions: external_exports.array(external_exports.string()),
|
|
14021
|
+
case_input: external_exports.string(),
|
|
14022
|
+
judge_summary: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
14023
|
+
source_output: external_exports.unknown().nullable().default(null),
|
|
14024
|
+
labelable_criterion_keys: external_exports.array(external_exports.string()),
|
|
14025
|
+
assignee_user_id: external_exports.string().uuid().nullable(),
|
|
14026
|
+
completed_by_user_id: external_exports.string().uuid().nullable(),
|
|
14027
|
+
updated_at: external_exports.string()
|
|
14028
|
+
}).passthrough();
|
|
14029
|
+
AnnotationUnknownReceiptSchema = external_exports.object({
|
|
14030
|
+
state: external_exports.literal("unknown"),
|
|
14031
|
+
command_id: external_exports.string(),
|
|
14032
|
+
instruction: external_exports.literal("inspect_source_before_retry")
|
|
14033
|
+
});
|
|
13826
14034
|
InboxOperationEnvelopeSchema = external_exports.discriminatedUnion("operation", [
|
|
13827
14035
|
InboxEnvelopeBaseSchema.extend({
|
|
13828
14036
|
operation: external_exports.literal("inbox.list"),
|
|
@@ -13998,6 +14206,35 @@ var init_inbox_management = __esm({
|
|
|
13998
14206
|
])
|
|
13999
14207
|
})
|
|
14000
14208
|
),
|
|
14209
|
+
InboxEnvelopeBaseSchema.extend({
|
|
14210
|
+
operation: external_exports.literal("opportunity.record_answer"),
|
|
14211
|
+
source_version: external_exports.string(),
|
|
14212
|
+
receipt: external_exports.object({
|
|
14213
|
+
answer: external_exports.object({
|
|
14214
|
+
recorded: external_exports.boolean(),
|
|
14215
|
+
actor_type: external_exports.literal("fde_evidence"),
|
|
14216
|
+
command_id: external_exports.string()
|
|
14217
|
+
}),
|
|
14218
|
+
publication: external_exports.discriminatedUnion("state", [
|
|
14219
|
+
external_exports.object({ state: external_exports.literal("published") }),
|
|
14220
|
+
external_exports.object({
|
|
14221
|
+
state: external_exports.literal("pending"),
|
|
14222
|
+
pr_number: external_exports.number().int().positive(),
|
|
14223
|
+
pr_url: external_exports.string().url()
|
|
14224
|
+
}),
|
|
14225
|
+
external_exports.object({ state: external_exports.literal("skipped"), reason: external_exports.string() }),
|
|
14226
|
+
external_exports.object({ state: external_exports.literal("failed"), reason: external_exports.string() }),
|
|
14227
|
+
external_exports.object({ state: external_exports.literal("unknown"), reason: external_exports.string() })
|
|
14228
|
+
]),
|
|
14229
|
+
read_back: external_exports.union([
|
|
14230
|
+
OpportunitySnapshotSchema,
|
|
14231
|
+
external_exports.object({
|
|
14232
|
+
state: external_exports.literal("unavailable"),
|
|
14233
|
+
instruction: external_exports.literal("inspect_source_before_retry")
|
|
14234
|
+
})
|
|
14235
|
+
])
|
|
14236
|
+
})
|
|
14237
|
+
}),
|
|
14001
14238
|
InboxEnvelopeBaseSchema.extend({
|
|
14002
14239
|
operation: external_exports.literal("fde_action.get"),
|
|
14003
14240
|
source_version: external_exports.string(),
|
|
@@ -14051,6 +14288,40 @@ var init_inbox_management = __esm({
|
|
|
14051
14288
|
}),
|
|
14052
14289
|
LifecycleUnknownReceiptSchema
|
|
14053
14290
|
])
|
|
14291
|
+
}),
|
|
14292
|
+
InboxEnvelopeBaseSchema.extend({
|
|
14293
|
+
operation: external_exports.literal("annotation.get"),
|
|
14294
|
+
source_version: external_exports.number().int().positive(),
|
|
14295
|
+
receipt: external_exports.object({
|
|
14296
|
+
state: external_exports.literal("complete"),
|
|
14297
|
+
task: AnnotationSnapshotSchema,
|
|
14298
|
+
command: OpportunityCommandSchema.optional()
|
|
14299
|
+
})
|
|
14300
|
+
}),
|
|
14301
|
+
InboxEnvelopeBaseSchema.extend({
|
|
14302
|
+
operation: external_exports.literal("annotation.command"),
|
|
14303
|
+
source_version: external_exports.number().int().positive(),
|
|
14304
|
+
receipt: external_exports.union([
|
|
14305
|
+
external_exports.object({
|
|
14306
|
+
state: external_exports.enum(["completed", "no_change"]),
|
|
14307
|
+
replayed: external_exports.boolean(),
|
|
14308
|
+
read_back: AnnotationSnapshotSchema
|
|
14309
|
+
}),
|
|
14310
|
+
AnnotationUnknownReceiptSchema
|
|
14311
|
+
])
|
|
14312
|
+
}),
|
|
14313
|
+
InboxEnvelopeBaseSchema.extend({
|
|
14314
|
+
operation: external_exports.literal("annotation.complete"),
|
|
14315
|
+
source_version: external_exports.number().int().positive(),
|
|
14316
|
+
receipt: external_exports.union([
|
|
14317
|
+
external_exports.object({
|
|
14318
|
+
state: external_exports.enum(["completed", "pending", "no_change"]),
|
|
14319
|
+
replayed: external_exports.boolean(),
|
|
14320
|
+
label_writes: external_exports.array(external_exports.unknown()),
|
|
14321
|
+
read_back: AnnotationSnapshotSchema
|
|
14322
|
+
}),
|
|
14323
|
+
AnnotationUnknownReceiptSchema
|
|
14324
|
+
])
|
|
14054
14325
|
})
|
|
14055
14326
|
]);
|
|
14056
14327
|
}
|
|
@@ -19897,12 +20168,13 @@ async function runInboxManage(options) {
|
|
|
19897
20168
|
const input = await inputObject(options.input);
|
|
19898
20169
|
const isMutation = options.operation.startsWith("change.") && !["change.get", "change.diff", "change.head"].includes(
|
|
19899
20170
|
options.operation
|
|
19900
|
-
) || options.operation.startsWith("opportunity.") && options.operation !== "opportunity.get" || options.operation === "fde_action.command" || options.operation.startsWith("graph_recovery.") && options.operation !== "graph_recovery.get";
|
|
20171
|
+
) || options.operation.startsWith("opportunity.") && options.operation !== "opportunity.get" || options.operation === "fde_action.command" || options.operation.startsWith("graph_recovery.") && options.operation !== "graph_recovery.get" || options.operation.startsWith("annotation.") && options.operation !== "annotation.get";
|
|
19901
20172
|
if (isMutation) {
|
|
19902
20173
|
const isProposal = options.operation === "opportunity.propose";
|
|
19903
20174
|
const isOpportunity = options.operation.startsWith("opportunity.");
|
|
19904
20175
|
const isFdeAction = options.operation.startsWith("fde_action.");
|
|
19905
20176
|
const isGraphRecovery = options.operation.startsWith("graph_recovery.");
|
|
20177
|
+
const isAnnotation = options.operation.startsWith("annotation.");
|
|
19906
20178
|
const previewCall = isProposal ? InboxManagementCallSchema.parse({
|
|
19907
20179
|
operation: "inbox.list",
|
|
19908
20180
|
input: {
|
|
@@ -19927,6 +20199,12 @@ async function runInboxManage(options) {
|
|
|
19927
20199
|
id: input.id,
|
|
19928
20200
|
...typeof input.brand_id === "string" ? { brand_id: input.brand_id } : {}
|
|
19929
20201
|
}
|
|
20202
|
+
}) : isAnnotation ? InboxManagementCallSchema.parse({
|
|
20203
|
+
operation: "annotation.get",
|
|
20204
|
+
input: {
|
|
20205
|
+
task_id: input.task_id,
|
|
20206
|
+
...typeof input.brand_id === "string" ? { brand_id: input.brand_id } : {}
|
|
20207
|
+
}
|
|
19930
20208
|
}) : InboxManagementCallSchema.parse({
|
|
19931
20209
|
operation: "change.get",
|
|
19932
20210
|
input: {
|
|
@@ -19957,8 +20235,8 @@ async function runInboxManage(options) {
|
|
|
19957
20235
|
const previewReceipt = preview.receipt && typeof preview.receipt === "object" ? preview.receipt : {};
|
|
19958
20236
|
const action = previewReceipt.action;
|
|
19959
20237
|
const cycle = previewReceipt.cycle;
|
|
19960
|
-
const advertised = isFdeAction ? action?.supported_commands : isGraphRecovery ? cycle?.next_legal_commands : null;
|
|
19961
|
-
const requestedCommand = options.operation === "graph_recovery.select_predecessor" ? "select_predecessor" : input.command;
|
|
20238
|
+
const advertised = isFdeAction ? action?.supported_commands : isGraphRecovery ? cycle?.next_legal_commands : isAnnotation ? previewReceipt.task?.valid_next_actions : null;
|
|
20239
|
+
const requestedCommand = options.operation === "graph_recovery.select_predecessor" ? "select_predecessor" : options.operation === "annotation.complete" ? "complete" : input.command;
|
|
19962
20240
|
if (Array.isArray(advertised) && !advertised.includes(requestedCommand))
|
|
19963
20241
|
throw Object.assign(
|
|
19964
20242
|
new Error(
|
|
@@ -19968,11 +20246,11 @@ async function runInboxManage(options) {
|
|
|
19968
20246
|
);
|
|
19969
20247
|
const recipient = input.recipient_name ? `; recipient: ${String(input.recipient_name)}` : "";
|
|
19970
20248
|
const wording = input.approved_wording ? `; wording: ${JSON.stringify(input.approved_wording)}` : "";
|
|
19971
|
-
const mutation = MUTATION_EFFECTS[options.operation];
|
|
20249
|
+
const mutation = options.operation === "annotation.command" ? ANNOTATION_COMMAND_EFFECTS[String(input.command)] : MUTATION_EFFECTS[options.operation];
|
|
19972
20250
|
const sourceItem = isProposal ? String(
|
|
19973
20251
|
input.proposal && typeof input.proposal === "object" ? input.proposal.opportunity_key ?? "new stable-key proposal" : "new proposal"
|
|
19974
20252
|
) : String(
|
|
19975
|
-
input.opportunity_id ?? input.pr_number ?? input.id ?? "unknown"
|
|
20253
|
+
input.opportunity_id ?? input.pr_number ?? input.id ?? input.task_id ?? "unknown"
|
|
19976
20254
|
);
|
|
19977
20255
|
human(
|
|
19978
20256
|
`Approval preview \u2014 organization: ${preview.scope.org_name} (${preview.scope.org_id}); brand: ${preview.scope.brand_name ?? "all brands"}; operation: ${options.operation}; source item: ${sourceItem}; source version: ${preview.source_version ?? "new proposal"}; effect: ${mutation?.effect ?? "unspecified"}; reversible: ${String(mutation?.reversible ?? "unspecified")}${recipient}${wording}`,
|
|
@@ -19989,7 +20267,7 @@ async function runInboxManage(options) {
|
|
|
19989
20267
|
}
|
|
19990
20268
|
if (options.approve) {
|
|
19991
20269
|
input.approved = true;
|
|
19992
|
-
const mutation = MUTATION_EFFECTS[options.operation];
|
|
20270
|
+
const mutation = options.operation === "annotation.command" ? ANNOTATION_COMMAND_EFFECTS[String(input.command)] : MUTATION_EFFECTS[options.operation];
|
|
19993
20271
|
if (mutation) {
|
|
19994
20272
|
input.approved_effect = mutation.effect;
|
|
19995
20273
|
input.approved_reversible = mutation.reversible;
|
|
@@ -20016,7 +20294,7 @@ async function runInboxManage(options) {
|
|
|
20016
20294
|
fail(error, options);
|
|
20017
20295
|
}
|
|
20018
20296
|
}
|
|
20019
|
-
var MUTATION_EFFECTS;
|
|
20297
|
+
var MUTATION_EFFECTS, ANNOTATION_COMMAND_EFFECTS;
|
|
20020
20298
|
var init_inbox_management2 = __esm({
|
|
20021
20299
|
"src/commands/inbox-management.ts"() {
|
|
20022
20300
|
"use strict";
|
|
@@ -20063,6 +20341,10 @@ var init_inbox_management2 = __esm({
|
|
|
20063
20341
|
effect: "block_internal_opportunity",
|
|
20064
20342
|
reversible: true
|
|
20065
20343
|
},
|
|
20344
|
+
"opportunity.record_answer": {
|
|
20345
|
+
effect: "record_fde_evidence_and_attempt_brain_publication",
|
|
20346
|
+
reversible: false
|
|
20347
|
+
},
|
|
20066
20348
|
"fde_action.command": {
|
|
20067
20349
|
effect: "apply_server_advertised_fde_action_command",
|
|
20068
20350
|
reversible: true
|
|
@@ -20074,8 +20356,20 @@ var init_inbox_management2 = __esm({
|
|
|
20074
20356
|
"graph_recovery.select_predecessor": {
|
|
20075
20357
|
effect: "continue_from_selected_predecessor",
|
|
20076
20358
|
reversible: false
|
|
20359
|
+
},
|
|
20360
|
+
"annotation.complete": {
|
|
20361
|
+
effect: "write_annotation_labels_and_complete_task",
|
|
20362
|
+
reversible: false
|
|
20077
20363
|
}
|
|
20078
20364
|
};
|
|
20365
|
+
ANNOTATION_COMMAND_EFFECTS = {
|
|
20366
|
+
claim: { effect: "claim_annotation_task", reversible: true },
|
|
20367
|
+
assign: { effect: "assign_annotation_task", reversible: true },
|
|
20368
|
+
reassign: { effect: "reassign_annotation_task", reversible: true },
|
|
20369
|
+
escalate: { effect: "escalate_annotation_task", reversible: true },
|
|
20370
|
+
recall: { effect: "recall_annotation_task", reversible: true },
|
|
20371
|
+
dismiss: { effect: "dismiss_annotation_task", reversible: false }
|
|
20372
|
+
};
|
|
20079
20373
|
}
|
|
20080
20374
|
});
|
|
20081
20375
|
|