@bakers-build/addon-remote-drupal 0.6.1-next.5 → 0.6.1-next.7
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/src/index.d.ts +2 -1
- package/dist/src/index.js +19 -2
- package/package.json +6 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActiveRun, AddonDefinitionV2, AddonRegistration, BbRemote, ClaimedRun, ClaimOptions, ClaimWithheld, ConductorRegistration, ConductorStatus, FinalizableRun, FrozenTicket, InboxSnapshot, RemotePlugin, RunMetrics, RunWriteAttributes, Ticket, TicketMetric, UncleanTicket } from '@bakers-build/conductor/contract';
|
|
1
|
+
import type { ActiveRun, AddonDefinitionV2, AddonRegistration, BbRemote, ClaimedRun, ClaimOptions, ClaimWithheld, ConductorRegistration, ConductorStatus, FinalizableRun, FrozenTicket, InboxSnapshot, RemotePlugin, RunMetrics, RunWriteAttributes, SiteToolClient, Ticket, TicketMetric, UncleanTicket } from '@bakers-build/conductor/contract';
|
|
2
2
|
import type { MessageResult } from '@bakers-build/message';
|
|
3
3
|
export { AmbiguousProjectNameError, ConductorTakeoverRequired, } from '@bakers-build/conductor/contract';
|
|
4
4
|
export { createRunLogHttp, RunLogSizeError } from './run-log-http.js';
|
|
@@ -36,6 +36,7 @@ export declare class DrupalBbRemote implements BbRemote {
|
|
|
36
36
|
private readonly selection?;
|
|
37
37
|
private readonly resolvedProjectId?;
|
|
38
38
|
private readonly fetchRunLog;
|
|
39
|
+
siteTools?: SiteToolClient;
|
|
39
40
|
constructor(api: JsonApiClient, selection?: BbProjectSelection | undefined, resolvedProjectId?: string | undefined, fetchRunLog?: RunLogFetcher);
|
|
40
41
|
fetchActiveRuns(id: string): Promise<ActiveRun[]>;
|
|
41
42
|
activeRunCount(id: string): Promise<number>;
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createBbConnectionContext, toUnixSeconds } from '@bakers-build/core';
|
|
2
|
+
import { createToolClient } from '@dropsh/plugin-tool';
|
|
2
3
|
import { AmbiguousProjectNameError, ConductorTakeoverRequired, resolveBbProjectContext, } from '@bakers-build/conductor/contract';
|
|
3
4
|
export { AmbiguousProjectNameError, ConductorTakeoverRequired, } from '@bakers-build/conductor/contract';
|
|
4
5
|
export { createRunLogHttp, RunLogSizeError } from './run-log-http.js';
|
|
@@ -60,6 +61,7 @@ export class DrupalBbRemote {
|
|
|
60
61
|
selection;
|
|
61
62
|
resolvedProjectId;
|
|
62
63
|
fetchRunLog;
|
|
64
|
+
siteTools;
|
|
63
65
|
constructor(api, selection, resolvedProjectId, fetchRunLog = throwingRunLogFetcher) {
|
|
64
66
|
this.api = api;
|
|
65
67
|
this.selection = selection;
|
|
@@ -512,6 +514,8 @@ export class DrupalBbRemote {
|
|
|
512
514
|
worktreePath: r.attr('worktree_path') ?? '',
|
|
513
515
|
agent: r.attr('agent') ?? '',
|
|
514
516
|
startedAt: r.attr('started_at') ?? '',
|
|
517
|
+
// Strict: an older server sends nothing, which must mean "do not upload".
|
|
518
|
+
runLogStorageAllowed: r.attr('run_log_storage_allowed') === true,
|
|
515
519
|
}));
|
|
516
520
|
}
|
|
517
521
|
async finalizableRunsInState(id, state) {
|
|
@@ -527,6 +531,7 @@ export class DrupalBbRemote {
|
|
|
527
531
|
'started_at',
|
|
528
532
|
'state_at_start',
|
|
529
533
|
'ticket_id',
|
|
534
|
+
'run_log_storage_allowed',
|
|
530
535
|
])
|
|
531
536
|
.page(100)
|
|
532
537
|
.list();
|
|
@@ -702,7 +707,7 @@ export class DrupalBbRemote {
|
|
|
702
707
|
const run = await this.api
|
|
703
708
|
.collection('bb_run')
|
|
704
709
|
.where('id', '=', runUuid)
|
|
705
|
-
.fields(['id'])
|
|
710
|
+
.fields(['id', 'run_log_storage_allowed'])
|
|
706
711
|
.first();
|
|
707
712
|
if (!run) {
|
|
708
713
|
// Refuse rather than guess. With no row read, `existing` below would be ''
|
|
@@ -712,6 +717,11 @@ export class DrupalBbRemote {
|
|
|
712
717
|
// flags the ticket), never a silent truncation.
|
|
713
718
|
throw new Error(`bb_run ${runUuid} could not be read — run note not written`);
|
|
714
719
|
}
|
|
720
|
+
// Transcript storage is off for this run: the note belongs in the
|
|
721
|
+
// transcript, so neither download nor rewrite it.
|
|
722
|
+
if (run.attr('run_log_storage_allowed') !== true) {
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
715
725
|
// BB-556: the JSON:API `log` attribute is ALWAYS empty on a reload —
|
|
716
726
|
// `BbRun::preSave()` moves any payload to a file and clears the field —
|
|
717
727
|
// so the real current transcript can only be read through the download
|
|
@@ -828,7 +838,14 @@ export function drupalRemote() {
|
|
|
828
838
|
}, {
|
|
829
839
|
http: createRunLogHttp(config.site.base_url, config.site.jsonapi_prefix),
|
|
830
840
|
});
|
|
831
|
-
|
|
841
|
+
const remote = new DrupalBbRemote(context.client, config.bakers, config.resolved_bakers?.projectId, createRunLogFetcher(context.http, context.auth, context.baseUrl));
|
|
842
|
+
// The site's tools for agent runs, on the same auth profile: the run never holds it.
|
|
843
|
+
remote.siteTools = createToolClient({
|
|
844
|
+
auth: context.auth,
|
|
845
|
+
baseUrl: context.baseUrl,
|
|
846
|
+
endpoint: '/mcp',
|
|
847
|
+
});
|
|
848
|
+
return remote;
|
|
832
849
|
},
|
|
833
850
|
};
|
|
834
851
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-remote-drupal",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.7",
|
|
4
4
|
"description": "bakers.build conductor remote addon: the Drupal/JSON:API control-plane remote.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,15 +20,16 @@
|
|
|
20
20
|
"directory": "bakers-cli/addons/remote-drupal"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@dropsh/plugin-tool": "^0.8.2",
|
|
23
24
|
"dropsh": "^0.8.2"
|
|
24
25
|
},
|
|
25
26
|
"peerDependencies": {
|
|
26
|
-
"@bakers-build/conductor": "^0.6.1-next.
|
|
27
|
-
"@bakers-build/core": "^0.6.1-next.
|
|
28
|
-
"@bakers-build/message": "^0.6.1-next.
|
|
27
|
+
"@bakers-build/conductor": "^0.6.1-next.7",
|
|
28
|
+
"@bakers-build/core": "^0.6.1-next.7",
|
|
29
|
+
"@bakers-build/message": "^0.6.1-next.7"
|
|
29
30
|
},
|
|
30
31
|
"bakersBuild": {
|
|
31
|
-
"commit": "
|
|
32
|
+
"commit": "b89398b187bf51f4f9ca5bfc1150469f73a879e6",
|
|
32
33
|
"channel": "next"
|
|
33
34
|
}
|
|
34
35
|
}
|