aglio-worker 0.85.0 → 0.87.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.
Files changed (2) hide show
  1. package/agent.js +164 -26
  2. package/package.json +1 -1
package/agent.js CHANGED
@@ -70306,9 +70306,10 @@ var PLAN_CATALOG = {
70306
70306
  enterprise: {
70307
70307
  id: "enterprise",
70308
70308
  label: "Enterprise",
70309
- tagline: "Unlimited seats, projects and usage.",
70309
+ tagline: "Custom seats, projects and usage. Agreed in your contract.",
70310
70310
  priceLabel: "Contact us",
70311
70311
  monthlyPriceUsd: null,
70312
+ customTerms: true,
70312
70313
  entitlements: {
70313
70314
  seats: null,
70314
70315
  projects: null,
@@ -70758,14 +70759,44 @@ var createCommentSchema = external_exports.object({
70758
70759
  mentionAgentId: external_exports.string().nullish(),
70759
70760
  parentCommentId: external_exports.string().nullish()
70760
70761
  });
70762
+ var questionOptionSchema = external_exports.object({
70763
+ label: external_exports.string().trim().min(1).max(120),
70764
+ description: external_exports.string().trim().max(200).optional(),
70765
+ /** Marks the answer the agent suggests, so the human can pick it in one click. */
70766
+ recommended: external_exports.boolean().optional()
70767
+ });
70761
70768
  var questionSchema = external_exports.object({
70762
- text: external_exports.string().min(1),
70769
+ text: external_exports.string().trim().min(1).max(2e3),
70763
70770
  type: questionTypeSchema,
70764
- options: external_exports.array(external_exports.object({ label: external_exports.string().min(1), description: external_exports.string().optional() })).optional(),
70771
+ options: external_exports.array(questionOptionSchema).max(10).optional(),
70765
70772
  required: external_exports.boolean().default(true)
70773
+ }).superRefine((question, ctx) => {
70774
+ const options = question.options ?? [];
70775
+ if (question.type !== "text" && options.length < 2) {
70776
+ ctx.addIssue({
70777
+ code: "custom",
70778
+ path: ["options"],
70779
+ message: "Choice questions need at least two options"
70780
+ });
70781
+ }
70782
+ const labels = options.map((option2) => option2.label.trim().toLowerCase());
70783
+ if (new Set(labels).size !== labels.length) {
70784
+ ctx.addIssue({
70785
+ code: "custom",
70786
+ path: ["options"],
70787
+ message: "Question options must be distinct"
70788
+ });
70789
+ }
70790
+ if (options.filter((option2) => option2.recommended).length > 1) {
70791
+ ctx.addIssue({
70792
+ code: "custom",
70793
+ path: ["options"],
70794
+ message: "Mark at most one option as recommended"
70795
+ });
70796
+ }
70766
70797
  });
70767
70798
  var askQuestionsSchema = external_exports.object({
70768
- questions: external_exports.array(questionSchema).min(1).max(20)
70799
+ questions: external_exports.array(questionSchema).min(1).max(10)
70769
70800
  });
70770
70801
  var workLogSchema = external_exports.object({
70771
70802
  type: workLogTypeSchema,
@@ -70898,7 +70929,10 @@ var REMOTE_CONSULT_READ_TOOLS = [
70898
70929
  "card_get",
70899
70930
  "card_search",
70900
70931
  "project_history",
70901
- "card_history"
70932
+ "card_history",
70933
+ "agent_list",
70934
+ "member_list",
70935
+ "job_list"
70902
70936
  ];
70903
70937
  var REMOTE_CONSULT_TOOLS = [
70904
70938
  ...REMOTE_CONSULT_READ_TOOLS,
@@ -70908,11 +70942,10 @@ var REMOTE_CONSULT_TOOLS = [
70908
70942
  "comment_add",
70909
70943
  "question_answer",
70910
70944
  "spec_propose",
70911
- "pr_open",
70912
- "pr_merge",
70913
70945
  "run_start",
70914
70946
  "assign_card",
70915
- "card_delete"
70947
+ "card_delete",
70948
+ "job_run"
70916
70949
  ];
70917
70950
 
70918
70951
  // ../../packages/shared/src/workers.ts
@@ -71604,6 +71637,8 @@ var boardListMoveSchema = external_exports.object({
71604
71637
  overKey: external_exports.string().min(1),
71605
71638
  insertAfter: external_exports.boolean().default(false)
71606
71639
  });
71640
+ var JOBS_COLUMN_KEY = "jobs";
71641
+ var BOARD_BUILTIN_COLUMNS = [JOBS_COLUMN_KEY, ...CARD_COLUMNS];
71607
71642
 
71608
71643
  // ../../packages/shared/src/project-sections.ts
71609
71644
  var PROJECT_SECTION_NAME_MAX = 40;
@@ -86959,7 +86994,7 @@ function workerCardApi(config2, fetchImpl, signal) {
86959
86994
  const response = await jobTokenRequest(
86960
86995
  config2,
86961
86996
  fetchImpl,
86962
- `/api/workers/jobs/${input2.jobId}/context?leaseId=${encodeURIComponent(input2.leaseId)}&workspaceRoot=${encodeURIComponent(input2.workspaceRoot)}&workspaceReady=${input2.workspaceReady ? "1" : "0"}`,
86997
+ `/api/workers/jobs/${input2.jobId}/context?leaseId=${encodeURIComponent(input2.leaseId)}&workspaceRoot=${encodeURIComponent(input2.workspaceRoot)}&workspaceReady=${input2.workspaceReady ? "1" : "0"}&executor=${encodeURIComponent(config2.mode)}`,
86963
86998
  input2.token,
86964
86999
  { method: "GET", signal }
86965
87000
  );
@@ -99293,20 +99328,60 @@ function createConsultServer(run) {
99293
99328
  },
99294
99329
  async (input2) => forward("card_history", input2)
99295
99330
  );
99331
+ server.registerTool(
99332
+ "agent_list",
99333
+ {
99334
+ description: "List agents in this workspace with driver, model and archived state. Read-only.",
99335
+ inputSchema: { includeArchived: external_exports.boolean().optional() }
99336
+ },
99337
+ async (input2) => forward("agent_list", input2)
99338
+ );
99339
+ server.registerTool(
99340
+ "member_list",
99341
+ {
99342
+ description: "List workspace members with role and userId. Read-only.",
99343
+ inputSchema: {}
99344
+ },
99345
+ async () => forward("member_list", {})
99346
+ );
99347
+ server.registerTool(
99348
+ "job_list",
99349
+ {
99350
+ description: "List recurring job cards with project, schedule, last run and next run. Read-only.",
99351
+ inputSchema: {
99352
+ projectId: external_exports.string().optional(),
99353
+ includeArchived: external_exports.boolean().optional(),
99354
+ limit: external_exports.number().int().min(1).max(100).optional()
99355
+ }
99356
+ },
99357
+ async (input2) => forward("job_list", input2)
99358
+ );
99296
99359
  server.registerTool(
99297
99360
  "card_create",
99298
99361
  {
99299
- description: "Create an unassigned draft card in Backlog in this workspace.",
99300
- inputSchema: { title: external_exports.string().min(1).max(300), body: external_exports.string().max(5e4).optional(), ...projectFields }
99362
+ description: "Create an unassigned card in this workspace. Optionally pick the starting column.",
99363
+ inputSchema: {
99364
+ title: external_exports.string().min(1).max(300),
99365
+ body: external_exports.string().max(5e4).optional(),
99366
+ column: external_exports.enum(CARD_COLUMNS).optional(),
99367
+ ...projectFields
99368
+ }
99301
99369
  },
99302
99370
  async (input2) => forward("card_create", input2)
99303
99371
  );
99304
99372
  server.registerTool(
99305
99373
  "card_bulk_create",
99306
99374
  {
99307
- description: "Create many unassigned draft cards in Backlog in this workspace.",
99375
+ description: "Create many unassigned cards in this workspace. Optionally pick the starting column.",
99308
99376
  inputSchema: {
99309
- cards: external_exports.array(external_exports.object({ title: external_exports.string().min(1).max(300), body: external_exports.string().max(5e4).optional() })).min(1).max(100),
99377
+ cards: external_exports.array(
99378
+ external_exports.object({
99379
+ title: external_exports.string().min(1).max(300),
99380
+ body: external_exports.string().max(5e4).optional(),
99381
+ column: external_exports.enum(CARD_COLUMNS).optional()
99382
+ })
99383
+ ).min(1).max(100),
99384
+ column: external_exports.enum(CARD_COLUMNS).optional(),
99310
99385
  ...projectFields
99311
99386
  }
99312
99387
  },
@@ -99315,12 +99390,12 @@ function createConsultServer(run) {
99315
99390
  server.registerTool(
99316
99391
  "card_update",
99317
99392
  {
99318
- description: "Update a workspace card title, body, priority or move it to backlog/todo.",
99393
+ description: "Update any card title, body, priority or column in this workspace.",
99319
99394
  inputSchema: {
99320
99395
  cardId: external_exports.string().min(1),
99321
99396
  title: external_exports.string().min(1).max(300).optional(),
99322
99397
  body: external_exports.string().max(5e4).optional(),
99323
- column: external_exports.string().optional(),
99398
+ column: external_exports.enum(CARD_COLUMNS).optional(),
99324
99399
  priority: external_exports.number().int().min(-100).max(100).optional()
99325
99400
  }
99326
99401
  },
@@ -99349,7 +99424,7 @@ function createConsultServer(run) {
99349
99424
  server.registerTool(
99350
99425
  "spec_propose",
99351
99426
  {
99352
- description: "Propose a spec for a card created in this consultant thread. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids. A human still approves it.",
99427
+ description: "Propose a spec for any card in this workspace. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids; split entries also accept split:N, a 1-based sibling reference. A human still approves it.",
99353
99428
  inputSchema: {
99354
99429
  cardId: external_exports.string().min(1),
99355
99430
  title: external_exports.string().min(1).max(300),
@@ -99370,12 +99445,50 @@ function createConsultServer(run) {
99370
99445
  },
99371
99446
  async (input2) => forward("spec_propose", input2)
99372
99447
  );
99448
+ server.registerTool(
99449
+ "assign_card",
99450
+ {
99451
+ description: "Assign a card to an agent or workspace member, or release it back to the queue. Omit both ids to release.",
99452
+ inputSchema: {
99453
+ cardId: external_exports.string().min(1),
99454
+ agentConfigId: external_exports.string().optional(),
99455
+ userId: external_exports.string().optional()
99456
+ }
99457
+ },
99458
+ async (input2) => forward("assign_card", input2)
99459
+ );
99460
+ server.registerTool(
99461
+ "run_start",
99462
+ {
99463
+ description: "Start a build, consult or review run on a card in this workspace. Defaults to the card assignee, consultant agent or first active agent.",
99464
+ inputSchema: {
99465
+ cardId: external_exports.string().min(1),
99466
+ kind: external_exports.enum(["build", "consult", "review"]).optional(),
99467
+ agentConfigId: external_exports.string().optional(),
99468
+ prompt: external_exports.string().max(2e4).optional()
99469
+ }
99470
+ },
99471
+ async (input2) => forward("run_start", input2)
99472
+ );
99473
+ server.registerTool(
99474
+ "card_delete",
99475
+ {
99476
+ description: "Archive a card and its subtickets in this workspace.",
99477
+ inputSchema: { cardId: external_exports.string().min(1) }
99478
+ },
99479
+ async (input2) => forward("card_delete", input2)
99480
+ );
99481
+ server.registerTool(
99482
+ "job_run",
99483
+ {
99484
+ description: "Trigger a job card now. The job run opens no pull request; read its result on the job card.",
99485
+ inputSchema: { cardId: external_exports.string().min(1) }
99486
+ },
99487
+ async (input2) => forward("job_run", input2)
99488
+ );
99373
99489
  for (const [name2, description] of [
99374
- ["pr_open", "Workspace consultant runs cannot open pull requests."],
99375
- ["pr_merge", "Workspace consultant runs cannot merge pull requests."],
99376
- ["run_start", "Workspace consultant runs cannot start runs."],
99377
- ["assign_card", "Workspace consultant runs cannot assign cards."],
99378
- ["card_delete", "Workspace consultant runs cannot delete cards."]
99490
+ ["pr_open", "Workspace consultant runs cannot push code or open pull requests. Use run_start."],
99491
+ ["pr_merge", "Workspace consultant runs cannot merge pull requests."]
99379
99492
  ]) {
99380
99493
  server.registerTool(name2, { description, inputSchema: {} }, async () => fail(description));
99381
99494
  }
@@ -99531,6 +99644,25 @@ function createServerForRun(run) {
99531
99644
  },
99532
99645
  async (input2) => forward("card_block_remove", input2)
99533
99646
  );
99647
+ server.registerTool(
99648
+ "job_list",
99649
+ {
99650
+ description: "List the recurring job cards of this project with schedule, last run and next run. Read-only.",
99651
+ inputSchema: {
99652
+ includeArchived: external_exports.boolean().optional(),
99653
+ limit: external_exports.number().int().min(1).max(100).optional()
99654
+ }
99655
+ },
99656
+ async (input2) => forward("job_list", input2)
99657
+ );
99658
+ server.registerTool(
99659
+ "job_run",
99660
+ {
99661
+ description: "Trigger a job card of this project now. The job run opens no pull request; read its result on the job card.",
99662
+ inputSchema: { cardId: external_exports.string().min(1) }
99663
+ },
99664
+ async (input2) => forward("job_run", input2)
99665
+ );
99534
99666
  server.registerTool(
99535
99667
  "request_human_action",
99536
99668
  {
@@ -99559,7 +99691,7 @@ function createServerForRun(run) {
99559
99691
  server.registerTool(
99560
99692
  "spec_propose",
99561
99693
  {
99562
- description: "Propose a new card spec. In planning this is the main output. During build it suspends the run until a human decides. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids; unresolved refs come back as warnings.",
99694
+ description: "Propose a new card spec. In planning this is the main output. During build it suspends the run until a human decides. Optional blocks/blockedBy (top-level or split entries) accept AGLIO-123, #123 or card ids; split entries also accept split:N, a 1-based sibling reference. Unresolved refs come back as warnings.",
99563
99695
  inputSchema: {
99564
99696
  title: external_exports.string().min(1).max(300),
99565
99697
  body: external_exports.string().min(1).max(5e4),
@@ -99592,16 +99724,22 @@ function createServerForRun(run) {
99592
99724
  server.registerTool(
99593
99725
  "question_ask",
99594
99726
  {
99595
- description: "Ask the human typed questions and suspend the run until answered. Use single, multi or text. Required questions block the resume.",
99727
+ description: "Ask the human up to 10 questions and pause the run until the required ones are answered. Ask only when the answer changes what you build and you cannot infer it from the card, comments, work log or repo. Batch related questions into one call, mark one option as recommended, and mark a question required only when you cannot continue without it. Never repeat a question that is still open.",
99596
99728
  inputSchema: {
99597
99729
  questions: external_exports.array(
99598
99730
  external_exports.object({
99599
- text: external_exports.string().min(1).max(2e3),
99731
+ text: external_exports.string().trim().min(1).max(2e3),
99600
99732
  type: external_exports.enum(QUESTION_TYPES),
99601
- options: external_exports.array(external_exports.object({ label: external_exports.string().min(1), description: external_exports.string().optional() })).optional(),
99733
+ options: external_exports.array(
99734
+ external_exports.object({
99735
+ label: external_exports.string().trim().min(1).max(120),
99736
+ description: external_exports.string().trim().max(200).optional(),
99737
+ recommended: external_exports.boolean().optional()
99738
+ })
99739
+ ).min(2).max(10).optional(),
99602
99740
  required: external_exports.boolean().default(true)
99603
99741
  })
99604
- ).min(1).max(20)
99742
+ ).min(1).max(10)
99605
99743
  }
99606
99744
  },
99607
99745
  async (input2) => forward("question_ask", input2)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aglio-worker",
3
- "version": "0.85.0",
3
+ "version": "0.87.0",
4
4
  "description": "Host machine agent for Aglio: claims jobs over the API and starts aglio-runner containers.",
5
5
  "type": "module",
6
6
  "bin": {