bamboo-agents 0.1.8-dev.90.eaeaaa5 → 0.1.8-dev.93.c78005c
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 +314 -29
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.8-dev.
|
|
1
|
+
0.1.8-dev.93.c78005c
|
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.93.c78005c";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -12753,6 +12753,197 @@ var init_inbox_apply_revision = __esm({
|
|
|
12753
12753
|
}
|
|
12754
12754
|
});
|
|
12755
12755
|
|
|
12756
|
+
// ../../src/lib/api-contracts/cli/inbox-management.ts
|
|
12757
|
+
var InboxOperationSchema, InboxManageOperationSchema, InboxOperationBindingSchema, common, INBOX_MANAGEMENT_BINDINGS, INBOX_EXISTING_COMMAND_BINDINGS, InboxManagementCatalogResponseSchema, InboxManagementCallSchema, InboxWorkItemSchema, InboxListReceiptSchema, InboxGetReceiptSchema, InboxEnvelopeBaseSchema, InboxOperationEnvelopeSchema;
|
|
12758
|
+
var init_inbox_management = __esm({
|
|
12759
|
+
"../../src/lib/api-contracts/cli/inbox-management.ts"() {
|
|
12760
|
+
init_zod();
|
|
12761
|
+
InboxOperationSchema = external_exports.enum(["inbox.list", "inbox.get", "inbox.revise", "inbox.apply_revision"]);
|
|
12762
|
+
InboxManageOperationSchema = external_exports.enum(["inbox.list", "inbox.get"]);
|
|
12763
|
+
InboxOperationBindingSchema = external_exports.object({
|
|
12764
|
+
operation: InboxOperationSchema,
|
|
12765
|
+
description: external_exports.string(),
|
|
12766
|
+
work_item_family: external_exports.literal("inbox"),
|
|
12767
|
+
method: external_exports.literal("POST"),
|
|
12768
|
+
path: external_exports.string().startsWith("/api/v1/"),
|
|
12769
|
+
cli_command: external_exports.string().startsWith("bamboo-agents inbox "),
|
|
12770
|
+
supported_runtimes: external_exports.array(external_exports.enum(["cli", "api"])),
|
|
12771
|
+
inputs: external_exports.object({
|
|
12772
|
+
required: external_exports.array(external_exports.string()),
|
|
12773
|
+
optional: external_exports.array(external_exports.string()),
|
|
12774
|
+
server_injected: external_exports.record(external_exports.string(), external_exports.string())
|
|
12775
|
+
}),
|
|
12776
|
+
authority: external_exports.string(),
|
|
12777
|
+
approval_required: external_exports.boolean(),
|
|
12778
|
+
side_effect: external_exports.string(),
|
|
12779
|
+
receipt: external_exports.string(),
|
|
12780
|
+
receipt_type: external_exports.enum(["inbox_list_receipt_v1", "inbox_get_receipt_v1", "inbox_revise_receipt_v1", "inbox_apply_revision_receipt_v1"]),
|
|
12781
|
+
error_codes: external_exports.array(external_exports.enum([
|
|
12782
|
+
"authentication_required",
|
|
12783
|
+
"organization_scope_required",
|
|
12784
|
+
"organization_scope_mismatch",
|
|
12785
|
+
"forbidden",
|
|
12786
|
+
"unsupported_operation",
|
|
12787
|
+
"invalid_input",
|
|
12788
|
+
"not_found",
|
|
12789
|
+
"partial_read",
|
|
12790
|
+
"malformed_response",
|
|
12791
|
+
"invalid_request",
|
|
12792
|
+
"github_not_connected",
|
|
12793
|
+
"no_workspace_repo",
|
|
12794
|
+
"request_changes_forbidden",
|
|
12795
|
+
"request_changes_cross_scope",
|
|
12796
|
+
"pr_not_found",
|
|
12797
|
+
"policy_input_failed",
|
|
12798
|
+
"pr_already_merged",
|
|
12799
|
+
"stale_review_task",
|
|
12800
|
+
"branch_mismatch",
|
|
12801
|
+
"pr_branch_moved",
|
|
12802
|
+
"commit_failed"
|
|
12803
|
+
])),
|
|
12804
|
+
minimum_cli_version: external_exports.string()
|
|
12805
|
+
});
|
|
12806
|
+
common = {
|
|
12807
|
+
method: "POST",
|
|
12808
|
+
path: "/api/v1/inbox/manage",
|
|
12809
|
+
cli_command: "bamboo-agents inbox manage",
|
|
12810
|
+
work_item_family: "inbox",
|
|
12811
|
+
supported_runtimes: ["cli", "api"],
|
|
12812
|
+
authority: "Superadmin session with an explicit customer organization",
|
|
12813
|
+
approval_required: false,
|
|
12814
|
+
side_effect: "none",
|
|
12815
|
+
minimum_cli_version: "0.1.8",
|
|
12816
|
+
error_codes: [
|
|
12817
|
+
"authentication_required",
|
|
12818
|
+
"organization_scope_required",
|
|
12819
|
+
"organization_scope_mismatch",
|
|
12820
|
+
"forbidden",
|
|
12821
|
+
"unsupported_operation",
|
|
12822
|
+
"invalid_input",
|
|
12823
|
+
"not_found",
|
|
12824
|
+
"partial_read",
|
|
12825
|
+
"malformed_response"
|
|
12826
|
+
]
|
|
12827
|
+
};
|
|
12828
|
+
INBOX_MANAGEMENT_BINDINGS = [
|
|
12829
|
+
{
|
|
12830
|
+
...common,
|
|
12831
|
+
operation: "inbox.list",
|
|
12832
|
+
description: "List a bounded page of actionable work in one customer Inbox",
|
|
12833
|
+
inputs: { required: [], optional: ["brand_id", "limit", "cursor"], server_injected: {} },
|
|
12834
|
+
receipt: "bounded actionable Inbox page with completeness metadata",
|
|
12835
|
+
receipt_type: "inbox_list_receipt_v1"
|
|
12836
|
+
},
|
|
12837
|
+
{
|
|
12838
|
+
...common,
|
|
12839
|
+
operation: "inbox.get",
|
|
12840
|
+
description: "Inspect one actionable Inbox item at its current source revision",
|
|
12841
|
+
inputs: { required: ["id"], optional: ["brand_id"], server_injected: {} },
|
|
12842
|
+
receipt: "one current actionable Inbox item",
|
|
12843
|
+
receipt_type: "inbox_get_receipt_v1"
|
|
12844
|
+
}
|
|
12845
|
+
];
|
|
12846
|
+
INBOX_EXISTING_COMMAND_BINDINGS = [
|
|
12847
|
+
{
|
|
12848
|
+
...common,
|
|
12849
|
+
operation: "inbox.revise",
|
|
12850
|
+
path: "/api/v1/cli/inbox/revise",
|
|
12851
|
+
cli_command: "bamboo-agents inbox revise",
|
|
12852
|
+
description: "Request a revision to one pending Inbox pull request",
|
|
12853
|
+
inputs: { required: ["pr_number", "feedback", "file"], optional: ["agent_id", "selected_lines"], server_injected: {} },
|
|
12854
|
+
authority: "Authenticated Inbox reviewer authorized for the pull request scope",
|
|
12855
|
+
approval_required: true,
|
|
12856
|
+
side_effect: "dispatches a revision or materializes the file for operator editing",
|
|
12857
|
+
receipt: "revision dispatch status or editable PR-head file",
|
|
12858
|
+
receipt_type: "inbox_revise_receipt_v1",
|
|
12859
|
+
minimum_cli_version: "0.1.5",
|
|
12860
|
+
error_codes: ["authentication_required", "invalid_request", "github_not_connected", "no_workspace_repo", "request_changes_forbidden", "request_changes_cross_scope", "pr_not_found", "policy_input_failed", "pr_already_merged", "stale_review_task"]
|
|
12861
|
+
},
|
|
12862
|
+
{
|
|
12863
|
+
...common,
|
|
12864
|
+
operation: "inbox.apply_revision",
|
|
12865
|
+
path: "/api/v1/cli/inbox/apply-revision",
|
|
12866
|
+
cli_command: "bamboo-agents inbox apply-revision",
|
|
12867
|
+
description: "Commit a prepared revision to a pending Inbox pull request",
|
|
12868
|
+
inputs: { required: ["pr_number", "file", "new_content", "commit_message", "file_sha"], optional: ["branch"], server_injected: {} },
|
|
12869
|
+
authority: "Authenticated Inbox reviewer authorized for the pull request scope",
|
|
12870
|
+
approval_required: true,
|
|
12871
|
+
side_effect: "commits to the existing pull-request branch",
|
|
12872
|
+
receipt: "committed branch and pull-request number",
|
|
12873
|
+
receipt_type: "inbox_apply_revision_receipt_v1",
|
|
12874
|
+
minimum_cli_version: "0.1.5",
|
|
12875
|
+
error_codes: ["authentication_required", "invalid_request", "github_not_connected", "no_workspace_repo", "request_changes_forbidden", "request_changes_cross_scope", "pr_not_found", "pr_already_merged", "stale_review_task", "branch_mismatch", "pr_branch_moved", "commit_failed"]
|
|
12876
|
+
}
|
|
12877
|
+
];
|
|
12878
|
+
InboxManagementCatalogResponseSchema = external_exports.object({
|
|
12879
|
+
contract_version: external_exports.literal(1),
|
|
12880
|
+
bindings: external_exports.array(InboxOperationBindingSchema),
|
|
12881
|
+
related_cli_commands: external_exports.array(external_exports.string())
|
|
12882
|
+
});
|
|
12883
|
+
InboxManagementCallSchema = external_exports.discriminatedUnion("operation", [
|
|
12884
|
+
external_exports.object({
|
|
12885
|
+
operation: external_exports.literal("inbox.list"),
|
|
12886
|
+
input: external_exports.object({
|
|
12887
|
+
brand_id: external_exports.string().uuid().optional(),
|
|
12888
|
+
limit: external_exports.number().int().min(1).max(100).default(25),
|
|
12889
|
+
cursor: external_exports.string().nullable().optional()
|
|
12890
|
+
})
|
|
12891
|
+
}),
|
|
12892
|
+
external_exports.object({
|
|
12893
|
+
operation: external_exports.literal("inbox.get"),
|
|
12894
|
+
input: external_exports.object({ id: external_exports.string().min(1), brand_id: external_exports.string().uuid().optional() })
|
|
12895
|
+
})
|
|
12896
|
+
]);
|
|
12897
|
+
InboxWorkItemSchema = external_exports.object({
|
|
12898
|
+
id: external_exports.string(),
|
|
12899
|
+
kind: external_exports.enum(["change_review", "output_annotation", "opportunity_curation", "graph_recovery", "fde_action"]),
|
|
12900
|
+
subject: external_exports.object({ type: external_exports.string(), id: external_exports.string(), revision: external_exports.string() }),
|
|
12901
|
+
brand_ids: external_exports.array(external_exports.string()),
|
|
12902
|
+
status: external_exports.enum(["open", "blocked", "in_progress", "resolved"]),
|
|
12903
|
+
reason: external_exports.string(),
|
|
12904
|
+
required_action: external_exports.string().nullable(),
|
|
12905
|
+
blocked_reason: external_exports.string().nullable(),
|
|
12906
|
+
created_at: external_exports.string(),
|
|
12907
|
+
updated_at: external_exports.string()
|
|
12908
|
+
}).passthrough();
|
|
12909
|
+
InboxListReceiptSchema = external_exports.object({
|
|
12910
|
+
state: external_exports.enum(["complete", "empty", "partial", "truncated", "unavailable"]),
|
|
12911
|
+
items: external_exports.array(InboxWorkItemSchema),
|
|
12912
|
+
has_more: external_exports.boolean(),
|
|
12913
|
+
next_cursor: external_exports.string().nullable(),
|
|
12914
|
+
truncated: external_exports.boolean(),
|
|
12915
|
+
missing: external_exports.array(external_exports.string())
|
|
12916
|
+
});
|
|
12917
|
+
InboxGetReceiptSchema = external_exports.discriminatedUnion("state", [
|
|
12918
|
+
external_exports.object({ state: external_exports.literal("complete"), item: InboxWorkItemSchema }),
|
|
12919
|
+
external_exports.object({ state: external_exports.literal("unavailable"), item: external_exports.null(), missing: external_exports.array(external_exports.string()) })
|
|
12920
|
+
]);
|
|
12921
|
+
InboxEnvelopeBaseSchema = external_exports.object({
|
|
12922
|
+
scope: external_exports.object({
|
|
12923
|
+
org_id: external_exports.string(),
|
|
12924
|
+
org_name: external_exports.string(),
|
|
12925
|
+
brand_id: external_exports.string().nullable(),
|
|
12926
|
+
brand_name: external_exports.string().nullable()
|
|
12927
|
+
}),
|
|
12928
|
+
actor: external_exports.object({ user_id: external_exports.string(), role: external_exports.string() }),
|
|
12929
|
+
command_id: external_exports.null(),
|
|
12930
|
+
outcome: external_exports.enum(["succeeded", "no_change", "pending", "unknown"])
|
|
12931
|
+
});
|
|
12932
|
+
InboxOperationEnvelopeSchema = external_exports.discriminatedUnion("operation", [
|
|
12933
|
+
InboxEnvelopeBaseSchema.extend({
|
|
12934
|
+
operation: external_exports.literal("inbox.list"),
|
|
12935
|
+
source_version: external_exports.null(),
|
|
12936
|
+
receipt: InboxListReceiptSchema
|
|
12937
|
+
}),
|
|
12938
|
+
InboxEnvelopeBaseSchema.extend({
|
|
12939
|
+
operation: external_exports.literal("inbox.get"),
|
|
12940
|
+
source_version: external_exports.string().nullable(),
|
|
12941
|
+
receipt: InboxGetReceiptSchema
|
|
12942
|
+
})
|
|
12943
|
+
]);
|
|
12944
|
+
}
|
|
12945
|
+
});
|
|
12946
|
+
|
|
12756
12947
|
// ../../src/lib/api-contracts/cli/context-health.ts
|
|
12757
12948
|
var ScopeKindSchema, ScopeSchema, CriterionMetricsSchema, StatusSchema, CriterionContributionSchema, CriterionResultSchema, BucketScoresSchema, ResolvedScopeSchema, GapsSchema, HealthyResponseSchema, UnavailableResponseSchema, ContextHealthResponseSchema;
|
|
12758
12949
|
var init_context_health = __esm({
|
|
@@ -13139,7 +13330,7 @@ var init_eval_test_sets = __esm({
|
|
|
13139
13330
|
});
|
|
13140
13331
|
|
|
13141
13332
|
// ../../src/lib/api-contracts/cli/eval-management.ts
|
|
13142
|
-
var EvalManagementOperationSchema, EvalManagementBindingSchema, EvalManagementInputHelpSchema, EVAL_MANAGEMENT_INPUTS,
|
|
13333
|
+
var EvalManagementOperationSchema, EvalManagementBindingSchema, EvalManagementInputHelpSchema, EVAL_MANAGEMENT_INPUTS, common2, EVAL_MANAGEMENT_BINDINGS, EvalManagementCatalogResponseSchema, EvalManagementCallSchema, EvalManagementResultSchema;
|
|
13143
13334
|
var init_eval_management = __esm({
|
|
13144
13335
|
"../../src/lib/api-contracts/cli/eval-management.ts"() {
|
|
13145
13336
|
init_zod();
|
|
@@ -13272,7 +13463,7 @@ var init_eval_management = __esm({
|
|
|
13272
13463
|
optional: ["not_before"]
|
|
13273
13464
|
}
|
|
13274
13465
|
};
|
|
13275
|
-
|
|
13466
|
+
common2 = {
|
|
13276
13467
|
cli_command: "bamboo-agents eval manage",
|
|
13277
13468
|
supported_runtimes: ["cli", "api"],
|
|
13278
13469
|
authority: "Authenticated human or attributed agent with access to the target brand",
|
|
@@ -13280,7 +13471,7 @@ var init_eval_management = __esm({
|
|
|
13280
13471
|
};
|
|
13281
13472
|
EVAL_MANAGEMENT_BINDINGS = [
|
|
13282
13473
|
{
|
|
13283
|
-
...
|
|
13474
|
+
...common2,
|
|
13284
13475
|
operation: "investigation.list",
|
|
13285
13476
|
description: "List current or historical investigations",
|
|
13286
13477
|
method: "GET",
|
|
@@ -13289,7 +13480,7 @@ var init_eval_management = __esm({
|
|
|
13289
13480
|
receipt: "investigation read model"
|
|
13290
13481
|
},
|
|
13291
13482
|
{
|
|
13292
|
-
...
|
|
13483
|
+
...common2,
|
|
13293
13484
|
operation: "investigation.get",
|
|
13294
13485
|
description: "Read one investigation with its claims and evidence",
|
|
13295
13486
|
method: "GET",
|
|
@@ -13298,7 +13489,7 @@ var init_eval_management = __esm({
|
|
|
13298
13489
|
receipt: "investigation read model"
|
|
13299
13490
|
},
|
|
13300
13491
|
{
|
|
13301
|
-
...
|
|
13492
|
+
...common2,
|
|
13302
13493
|
operation: "investigation.create",
|
|
13303
13494
|
description: "Open an authored investigation; does not queue execution",
|
|
13304
13495
|
method: "POST",
|
|
@@ -13307,7 +13498,7 @@ var init_eval_management = __esm({
|
|
|
13307
13498
|
receipt: "source path, source SHA, and investigation id"
|
|
13308
13499
|
},
|
|
13309
13500
|
{
|
|
13310
|
-
...
|
|
13501
|
+
...common2,
|
|
13311
13502
|
operation: "investigation.update",
|
|
13312
13503
|
description: "Revise an authored investigation with optimistic source concurrency",
|
|
13313
13504
|
method: "PATCH",
|
|
@@ -13316,7 +13507,7 @@ var init_eval_management = __esm({
|
|
|
13316
13507
|
receipt: "source SHA and publication result"
|
|
13317
13508
|
},
|
|
13318
13509
|
{
|
|
13319
|
-
...
|
|
13510
|
+
...common2,
|
|
13320
13511
|
operation: "investigation.hold",
|
|
13321
13512
|
description: "Stop future queue claims without discarding pending work",
|
|
13322
13513
|
method: "POST",
|
|
@@ -13325,7 +13516,7 @@ var init_eval_management = __esm({
|
|
|
13325
13516
|
receipt: "control receipt and resulting revision"
|
|
13326
13517
|
},
|
|
13327
13518
|
{
|
|
13328
|
-
...
|
|
13519
|
+
...common2,
|
|
13329
13520
|
operation: "investigation.resume",
|
|
13330
13521
|
description: "Allow pending work to be claimed again",
|
|
13331
13522
|
method: "POST",
|
|
@@ -13334,7 +13525,7 @@ var init_eval_management = __esm({
|
|
|
13334
13525
|
receipt: "control receipt and resulting revision"
|
|
13335
13526
|
},
|
|
13336
13527
|
{
|
|
13337
|
-
...
|
|
13528
|
+
...common2,
|
|
13338
13529
|
operation: "investigation.cancel",
|
|
13339
13530
|
description: "Cancel pending work without deleting served evidence",
|
|
13340
13531
|
method: "POST",
|
|
@@ -13343,7 +13534,7 @@ var init_eval_management = __esm({
|
|
|
13343
13534
|
receipt: "control receipt with affected count and served ids"
|
|
13344
13535
|
},
|
|
13345
13536
|
{
|
|
13346
|
-
...
|
|
13537
|
+
...common2,
|
|
13347
13538
|
operation: "investigation.conclude_claim",
|
|
13348
13539
|
description: "Record an evidence-linked claim conclusion",
|
|
13349
13540
|
method: "POST",
|
|
@@ -13352,7 +13543,7 @@ var init_eval_management = __esm({
|
|
|
13352
13543
|
receipt: "decision, judgment, publication, and evidence references"
|
|
13353
13544
|
},
|
|
13354
13545
|
{
|
|
13355
|
-
...
|
|
13546
|
+
...common2,
|
|
13356
13547
|
operation: "investigation.close",
|
|
13357
13548
|
description: "Close an investigation through an evidence-linked decision",
|
|
13358
13549
|
method: "POST",
|
|
@@ -13361,7 +13552,7 @@ var init_eval_management = __esm({
|
|
|
13361
13552
|
receipt: "decision, publication, cancellation count, and served ids"
|
|
13362
13553
|
},
|
|
13363
13554
|
{
|
|
13364
|
-
...
|
|
13555
|
+
...common2,
|
|
13365
13556
|
operation: "investigation.reopen",
|
|
13366
13557
|
description: "Reopen while retaining prior decisions and runs",
|
|
13367
13558
|
method: "POST",
|
|
@@ -13370,7 +13561,7 @@ var init_eval_management = __esm({
|
|
|
13370
13561
|
receipt: "decision and publication receipt"
|
|
13371
13562
|
},
|
|
13372
13563
|
{
|
|
13373
|
-
...
|
|
13564
|
+
...common2,
|
|
13374
13565
|
operation: "investigation.retire",
|
|
13375
13566
|
description: "Retire an investigation without deleting its history",
|
|
13376
13567
|
method: "POST",
|
|
@@ -13379,7 +13570,7 @@ var init_eval_management = __esm({
|
|
|
13379
13570
|
receipt: "decision, publication, cancellation count, and served ids"
|
|
13380
13571
|
},
|
|
13381
13572
|
{
|
|
13382
|
-
...
|
|
13573
|
+
...common2,
|
|
13383
13574
|
operation: "wave.list",
|
|
13384
13575
|
description: "List coordinated investigation waves",
|
|
13385
13576
|
method: "GET",
|
|
@@ -13388,7 +13579,7 @@ var init_eval_management = __esm({
|
|
|
13388
13579
|
receipt: "wave read model"
|
|
13389
13580
|
},
|
|
13390
13581
|
{
|
|
13391
|
-
...
|
|
13582
|
+
...common2,
|
|
13392
13583
|
operation: "wave.get",
|
|
13393
13584
|
description: "Read membership revisions and admission receipts for one wave",
|
|
13394
13585
|
method: "GET",
|
|
@@ -13397,7 +13588,7 @@ var init_eval_management = __esm({
|
|
|
13397
13588
|
receipt: "wave, members, and request receipts"
|
|
13398
13589
|
},
|
|
13399
13590
|
{
|
|
13400
|
-
...
|
|
13591
|
+
...common2,
|
|
13401
13592
|
operation: "wave.create",
|
|
13402
13593
|
description: "Create a coordination container; does not schedule it",
|
|
13403
13594
|
method: "POST",
|
|
@@ -13406,7 +13597,7 @@ var init_eval_management = __esm({
|
|
|
13406
13597
|
receipt: "wave id and membership revision"
|
|
13407
13598
|
},
|
|
13408
13599
|
{
|
|
13409
|
-
...
|
|
13600
|
+
...common2,
|
|
13410
13601
|
operation: "wave.update",
|
|
13411
13602
|
description: "Revise wave metadata or membership atomically",
|
|
13412
13603
|
method: "PATCH",
|
|
@@ -13415,7 +13606,7 @@ var init_eval_management = __esm({
|
|
|
13415
13606
|
receipt: "wave and resulting membership revision"
|
|
13416
13607
|
},
|
|
13417
13608
|
{
|
|
13418
|
-
...
|
|
13609
|
+
...common2,
|
|
13419
13610
|
operation: "wave.schedule",
|
|
13420
13611
|
description: "Freeze wave membership and admit each investigation idempotently",
|
|
13421
13612
|
method: "POST",
|
|
@@ -13446,6 +13637,24 @@ var init_eval_management = __esm({
|
|
|
13446
13637
|
|
|
13447
13638
|
// src/lib/api.ts
|
|
13448
13639
|
import { platform as platform2 } from "node:os";
|
|
13640
|
+
async function getInboxManagementOperations(session) {
|
|
13641
|
+
const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/operations`, {
|
|
13642
|
+
headers: { Authorization: `Bearer ${session}` }
|
|
13643
|
+
});
|
|
13644
|
+
if (!res.ok) throw await parseError(res);
|
|
13645
|
+
const json = await res.json();
|
|
13646
|
+
return InboxManagementCatalogResponseSchema.parse(json.data);
|
|
13647
|
+
}
|
|
13648
|
+
async function callInboxManagement(session, orgId, call) {
|
|
13649
|
+
const res = await cliApiFetch(`${apiBase()}/api/v1/inbox/manage`, {
|
|
13650
|
+
method: "POST",
|
|
13651
|
+
headers: { Authorization: `Bearer ${session}`, "bamboo-active-org": orgId, "Content-Type": "application/json" },
|
|
13652
|
+
body: JSON.stringify(call)
|
|
13653
|
+
});
|
|
13654
|
+
if (!res.ok) throw await parseError(res);
|
|
13655
|
+
const json = await res.json();
|
|
13656
|
+
return InboxOperationEnvelopeSchema.parse(json.data);
|
|
13657
|
+
}
|
|
13449
13658
|
function defaultApiBase(version) {
|
|
13450
13659
|
return version.includes("-dev.") ? DEV_DEFAULT_BASE : PROD_DEFAULT_BASE;
|
|
13451
13660
|
}
|
|
@@ -14086,6 +14295,7 @@ var init_api = __esm({
|
|
|
14086
14295
|
init_skill_apply();
|
|
14087
14296
|
init_inbox_revise();
|
|
14088
14297
|
init_inbox_apply_revision();
|
|
14298
|
+
init_inbox_management();
|
|
14089
14299
|
init_save();
|
|
14090
14300
|
init_history();
|
|
14091
14301
|
init_changes();
|
|
@@ -18487,13 +18697,80 @@ var init_knowledge = __esm({
|
|
|
18487
18697
|
}
|
|
18488
18698
|
});
|
|
18489
18699
|
|
|
18700
|
+
// src/commands/inbox-management.ts
|
|
18701
|
+
var inbox_management_exports = {};
|
|
18702
|
+
__export(inbox_management_exports, {
|
|
18703
|
+
runInboxManage: () => runInboxManage,
|
|
18704
|
+
runInboxOperations: () => runInboxOperations
|
|
18705
|
+
});
|
|
18706
|
+
import { readFile as readFile8 } from "node:fs/promises";
|
|
18707
|
+
async function sessionForOrg(org) {
|
|
18708
|
+
const token = await resolveSession();
|
|
18709
|
+
if (!token) throw Object.assign(new Error("Run `bamboo-agents login` first."), { code: "authentication_required" });
|
|
18710
|
+
if (token.startsWith("bam_")) throw Object.assign(new Error("Cross-customer Inbox operations require a user session; API keys cannot switch organizations."), { code: "organization_scope_required" });
|
|
18711
|
+
if (!org) throw Object.assign(new Error("Pass the customer organization with --org."), { code: "organization_scope_required" });
|
|
18712
|
+
return token;
|
|
18713
|
+
}
|
|
18714
|
+
async function inputObject(value) {
|
|
18715
|
+
const raw = value.startsWith("@") ? await readFile8(value.slice(1), "utf8") : value;
|
|
18716
|
+
const parsed = JSON.parse(raw);
|
|
18717
|
+
if (!parsed || Array.isArray(parsed) || typeof parsed !== "object") throw new Error("--input must be a JSON object");
|
|
18718
|
+
return parsed;
|
|
18719
|
+
}
|
|
18720
|
+
function fail(error, output) {
|
|
18721
|
+
const value = error;
|
|
18722
|
+
const invalidInput = error instanceof SyntaxError || error instanceof ZodError;
|
|
18723
|
+
emitError({
|
|
18724
|
+
code: value.code ?? (invalidInput ? "invalid_input" : "inbox_operation_failed"),
|
|
18725
|
+
message: value.message ?? "Inbox operation failed."
|
|
18726
|
+
}, output, 1);
|
|
18727
|
+
throw new Error("unreachable");
|
|
18728
|
+
}
|
|
18729
|
+
async function runInboxOperations(options) {
|
|
18730
|
+
try {
|
|
18731
|
+
const session = await resolveSession();
|
|
18732
|
+
if (!session) throw Object.assign(new Error("Run `bamboo-agents login` first."), { code: "authentication_required" });
|
|
18733
|
+
const catalog = await getInboxManagementOperations(session);
|
|
18734
|
+
for (const binding of catalog.bindings) human(` ${binding.operation.padEnd(18)} ${binding.description}`, options);
|
|
18735
|
+
for (const command of catalog.related_cli_commands) human(` ${command}`, options);
|
|
18736
|
+
emitSuccess(catalog, options);
|
|
18737
|
+
} catch (error) {
|
|
18738
|
+
fail(error, options);
|
|
18739
|
+
}
|
|
18740
|
+
}
|
|
18741
|
+
async function runInboxManage(options) {
|
|
18742
|
+
try {
|
|
18743
|
+
const session = await sessionForOrg(options.org);
|
|
18744
|
+
if (!InboxManageOperationSchema.safeParse(options.operation).success) {
|
|
18745
|
+
throw Object.assign(new Error(`Unsupported Inbox operation: ${options.operation}`), { code: "unsupported_operation" });
|
|
18746
|
+
}
|
|
18747
|
+
const call = InboxManagementCallSchema.parse({ operation: options.operation, input: await inputObject(options.input) });
|
|
18748
|
+
const result = await callInboxManagement(session, options.org, call);
|
|
18749
|
+
if (result.scope.org_id !== options.org) throw Object.assign(new Error(`Requested organization ${options.org} but server resolved ${result.scope.org_id}.`), { code: "organization_scope_mismatch" });
|
|
18750
|
+
human(`Resolved organization: ${result.scope.org_name} (${result.scope.org_id})`, options);
|
|
18751
|
+
emitSuccess(result, options);
|
|
18752
|
+
} catch (error) {
|
|
18753
|
+
fail(error, options);
|
|
18754
|
+
}
|
|
18755
|
+
}
|
|
18756
|
+
var init_inbox_management2 = __esm({
|
|
18757
|
+
"src/commands/inbox-management.ts"() {
|
|
18758
|
+
"use strict";
|
|
18759
|
+
init_zod();
|
|
18760
|
+
init_inbox_management();
|
|
18761
|
+
init_api();
|
|
18762
|
+
init_credentials();
|
|
18763
|
+
init_output();
|
|
18764
|
+
}
|
|
18765
|
+
});
|
|
18766
|
+
|
|
18490
18767
|
// src/commands/inbox.ts
|
|
18491
18768
|
var inbox_exports = {};
|
|
18492
18769
|
__export(inbox_exports, {
|
|
18493
18770
|
runInboxApplyRevision: () => runInboxApplyRevision,
|
|
18494
18771
|
runInboxRevise: () => runInboxRevise
|
|
18495
18772
|
});
|
|
18496
|
-
import { mkdir as mkdir5, readFile as
|
|
18773
|
+
import { mkdir as mkdir5, readFile as readFile9, writeFile as writeFile4 } from "node:fs/promises";
|
|
18497
18774
|
import { tmpdir } from "node:os";
|
|
18498
18775
|
import { basename, join as join6 } from "node:path";
|
|
18499
18776
|
async function requireSession4(opts) {
|
|
@@ -18515,7 +18792,7 @@ async function requireSession4(opts) {
|
|
|
18515
18792
|
async function readSelectionFile(path2) {
|
|
18516
18793
|
let raw;
|
|
18517
18794
|
try {
|
|
18518
|
-
raw = await
|
|
18795
|
+
raw = await readFile9(path2, "utf8");
|
|
18519
18796
|
} catch (err) {
|
|
18520
18797
|
throw new Error(`couldn't read selection file ${path2}: ${err.message}`);
|
|
18521
18798
|
}
|
|
@@ -18725,7 +19002,7 @@ async function runInboxApplyRevision(options) {
|
|
|
18725
19002
|
}
|
|
18726
19003
|
let newContent;
|
|
18727
19004
|
try {
|
|
18728
|
-
newContent = await
|
|
19005
|
+
newContent = await readFile9(options.contentFile, "utf8");
|
|
18729
19006
|
} catch (err) {
|
|
18730
19007
|
emitError(
|
|
18731
19008
|
{
|
|
@@ -19747,10 +20024,10 @@ __export(eval_management_exports, {
|
|
|
19747
20024
|
runEvalManage: () => runEvalManage,
|
|
19748
20025
|
runEvalOperations: () => runEvalOperations
|
|
19749
20026
|
});
|
|
19750
|
-
import { readFile as
|
|
20027
|
+
import { readFile as readFile10 } from "node:fs/promises";
|
|
19751
20028
|
async function requireSession12(opts) {
|
|
19752
|
-
const
|
|
19753
|
-
if (!
|
|
20029
|
+
const session = await resolveSession();
|
|
20030
|
+
if (!session) {
|
|
19754
20031
|
emitError(
|
|
19755
20032
|
{
|
|
19756
20033
|
code: "not_signed_in",
|
|
@@ -19762,10 +20039,10 @@ async function requireSession12(opts) {
|
|
|
19762
20039
|
);
|
|
19763
20040
|
throw new Error("unreachable");
|
|
19764
20041
|
}
|
|
19765
|
-
return
|
|
20042
|
+
return session;
|
|
19766
20043
|
}
|
|
19767
20044
|
async function parseInput(value) {
|
|
19768
|
-
const raw = value.startsWith("@") ? await
|
|
20045
|
+
const raw = value.startsWith("@") ? await readFile10(value.slice(1), "utf8") : value;
|
|
19769
20046
|
const parsed = JSON.parse(raw);
|
|
19770
20047
|
if (!parsed || Array.isArray(parsed) || typeof parsed !== "object") {
|
|
19771
20048
|
throw new Error("--input must be a JSON object");
|
|
@@ -19848,7 +20125,7 @@ var eval_ab_exports2 = {};
|
|
|
19848
20125
|
__export(eval_ab_exports2, {
|
|
19849
20126
|
runEvalAblate: () => runEvalAblate
|
|
19850
20127
|
});
|
|
19851
|
-
import { readFile as
|
|
20128
|
+
import { readFile as readFile11 } from "node:fs/promises";
|
|
19852
20129
|
import { resolve as resolve2 } from "node:path";
|
|
19853
20130
|
async function requireSession13(opts) {
|
|
19854
20131
|
const creds = await readCredentials();
|
|
@@ -19905,7 +20182,7 @@ async function runEvalAblate(options) {
|
|
|
19905
20182
|
let candidateBody;
|
|
19906
20183
|
const bodyPath = resolve2(process.cwd(), options.body);
|
|
19907
20184
|
try {
|
|
19908
|
-
candidateBody = await
|
|
20185
|
+
candidateBody = await readFile11(bodyPath, "utf-8");
|
|
19909
20186
|
} catch (err) {
|
|
19910
20187
|
emitError(
|
|
19911
20188
|
{
|
|
@@ -20647,6 +20924,14 @@ knowledge.command("save").description("Save a knowledge file (routed write \u201
|
|
|
20647
20924
|
await runKnowledgeSave2(options);
|
|
20648
20925
|
});
|
|
20649
20926
|
var inbox = program2.command("inbox").description("Actions on pending workspace PRs (the Inbox)");
|
|
20927
|
+
inbox.command("operations").description("List the supported customer Inbox operations").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (options) => {
|
|
20928
|
+
const { runInboxOperations: runInboxOperations2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
|
|
20929
|
+
await runInboxOperations2(options);
|
|
20930
|
+
});
|
|
20931
|
+
inbox.command("manage").description("Call one exact read operation (`inbox.list` or `inbox.get`)").argument("<operation>", "Exact operation name").requiredOption("--input <json-or-@file>", "JSON object, inline or loaded from @path").requiredOption("--org <uuid>", "Explicit customer organization UUID").option("--json", "Emit a JSON envelope for agent consumption").option("--fields <list>", "Project only these dotted field paths from data (comma-separated)").option("--quiet", "Suppress human chatter (data/errors only)").action(async (operation, options) => {
|
|
20932
|
+
const { runInboxManage: runInboxManage2 } = await Promise.resolve().then(() => (init_inbox_management2(), inbox_management_exports));
|
|
20933
|
+
await runInboxManage2({ operation, ...options });
|
|
20934
|
+
});
|
|
20650
20935
|
inbox.command("revise").description("Request a revision on a pending inbox PR (dispatches the source agent)").requiredOption("--pr <number>", "PR number in the workspace repo").requiredOption("--feedback <text>", "One sentence describing the change to make").requiredOption("--file <path>", "Repo-relative path of the file the feedback targets").option("--agent <id>", "Source agent id (default: resolved from the PR body)").option(
|
|
20651
20936
|
"--selection-file <path>",
|
|
20652
20937
|
"JSON file with the selected diff lines (array of {kind, old_line, new_line, content})"
|