@openscout/scout 0.2.50 → 0.2.51

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.
@@ -7,7 +7,7 @@
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Spectral:wght@500;600&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-Dq8Oi6wM.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-CGoQ5qP4.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-C2dy1gpj.css">
12
12
  </head>
13
13
  <body>
package/dist/main.mjs CHANGED
@@ -932,8 +932,8 @@ var init_agent_selectors = __esm(() => {
932
932
  init_agent_address();
933
933
  });
934
934
 
935
- // ../protocol/src/relay-agent-card.ts
936
- function buildRelayReturnAddress(input) {
935
+ // ../protocol/src/scout-agent-card.ts
936
+ function buildScoutReturnAddress(input) {
937
937
  const next = {
938
938
  actorId: input.actorId,
939
939
  handle: input.handle.trim()
@@ -7612,14 +7612,14 @@ function displayNameForBrokerActor(snapshot, actorId) {
7612
7612
  function firstEndpointForActor(snapshot, actorId) {
7613
7613
  return Object.values(snapshot.endpoints).filter((endpoint) => endpoint.agentId === actorId).sort((lhs, rhs) => lhs.id.localeCompare(rhs.id))[0];
7614
7614
  }
7615
- function buildScoutReturnAddress(snapshot, actorId, options = {}) {
7615
+ function buildScoutReturnAddress2(snapshot, actorId, options = {}) {
7616
7616
  const agent = snapshot.agents[actorId];
7617
7617
  const actor = snapshot.actors[actorId];
7618
7618
  const endpoint = firstEndpointForActor(snapshot, actorId);
7619
7619
  const selector = agent?.selector?.trim() || metadataString2(agent?.metadata, "selector") || metadataString2(actor?.metadata, "selector");
7620
7620
  const defaultSelector = agent?.defaultSelector?.trim() || metadataString2(agent?.metadata, "defaultSelector") || metadataString2(actor?.metadata, "defaultSelector");
7621
7621
  const projectRoot = endpoint?.projectRoot ?? endpoint?.cwd ?? metadataString2(agent?.metadata, "projectRoot") ?? metadataString2(actor?.metadata, "projectRoot");
7622
- return buildRelayReturnAddress({
7622
+ return buildScoutReturnAddress({
7623
7623
  actorId,
7624
7624
  handle: agent?.handle?.trim() || actor?.handle?.trim() || actorId,
7625
7625
  displayName: agent?.displayName || actor?.displayName,
@@ -8403,7 +8403,7 @@ async function sendScoutMessage(input) {
8403
8403
  }
8404
8404
  const messageId = `m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
8405
8405
  const speechText = input.shouldSpeak ? stripScoutAgentSelectorLabels(input.body) : "";
8406
- const returnAddress = buildScoutReturnAddress(broker.snapshot, senderId, {
8406
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, senderId, {
8407
8407
  conversationId: conversation.id,
8408
8408
  replyToMessageId: messageId
8409
8409
  });
@@ -8470,7 +8470,7 @@ async function sendScoutMessageToAgentIds(input) {
8470
8470
  }
8471
8471
  const messageId = `m-${createdAtMs.toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
8472
8472
  const speechText = input.shouldSpeak ? input.body.trim() : "";
8473
- const returnAddress = buildScoutReturnAddress(broker.snapshot, senderId, {
8473
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, senderId, {
8474
8474
  conversationId: conversation.id,
8475
8475
  replyToMessageId: messageId
8476
8476
  });
@@ -8541,7 +8541,7 @@ async function sendScoutDirectMessage(input) {
8541
8541
  const targetAgentId = directSession.targetId;
8542
8542
  const targetAgent = broker.snapshot.agents[targetAgentId] ?? ("agent" in directSession ? directSession.agent : undefined);
8543
8543
  const targetLabel = `@${targetAgent?.handle?.trim() || targetAgent?.displayName?.trim() || targetAgentId}`;
8544
- const returnAddress = buildScoutReturnAddress(broker.snapshot, OPERATOR_ID, {
8544
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, OPERATOR_ID, {
8545
8545
  conversationId: directSession.conversation.id,
8546
8546
  replyToMessageId: messageId
8547
8547
  });
@@ -8644,7 +8644,7 @@ async function askScoutAgentById(input) {
8644
8644
  }
8645
8645
  const messageId = `m-${createdAtMs.toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
8646
8646
  const speechText = input.shouldSpeak ? input.body.trim() : "";
8647
- const returnAddress = buildScoutReturnAddress(broker.snapshot, senderId, {
8647
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, senderId, {
8648
8648
  conversationId: conversation.id,
8649
8649
  replyToMessageId: messageId
8650
8650
  });
@@ -8752,7 +8752,7 @@ async function askScoutQuestion(input) {
8752
8752
  const messageBody = input.body.trim().startsWith(target.label) ? input.body.trim() : `${target.label} ${input.body.trim()}`;
8753
8753
  const speechText = input.shouldSpeak ? stripScoutAgentSelectorLabels(messageBody) : "";
8754
8754
  const createdAt = input.createdAtMs ?? Date.now();
8755
- const returnAddress = buildScoutReturnAddress(broker.snapshot, senderId, {
8755
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, senderId, {
8756
8756
  conversationId: conversation.id,
8757
8757
  replyToMessageId: messageId
8758
8758
  });
@@ -9489,23 +9489,74 @@ var init_broadcast = __esm(async () => {
9489
9489
  ]);
9490
9490
  });
9491
9491
 
9492
- // ../runtime/src/relay-agent-cards.ts
9492
+ // ../runtime/src/scout-agent-cards.ts
9493
9493
  function metadataString3(metadata, key) {
9494
9494
  const value = metadata?.[key];
9495
9495
  return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
9496
9496
  }
9497
- function buildRelayAgentCard(binding, options = {}) {
9497
+ function metadataStringArray(metadata, key) {
9498
+ const value = metadata?.[key];
9499
+ if (!Array.isArray(value)) {
9500
+ return;
9501
+ }
9502
+ const next = value.filter((entry) => typeof entry === "string" && entry.trim().length > 0);
9503
+ return next.length > 0 ? next : undefined;
9504
+ }
9505
+ function metadataStringMatrix(metadata, key) {
9506
+ const value = metadata?.[key];
9507
+ if (!Array.isArray(value)) {
9508
+ return;
9509
+ }
9510
+ const next = value.filter((entry) => Array.isArray(entry)).map((entry) => entry.filter((item) => typeof item === "string" && item.trim().length > 0)).filter((entry) => entry.length > 0);
9511
+ return next.length > 0 ? next : undefined;
9512
+ }
9513
+ function metadataRecord2(metadata, key) {
9514
+ const value = metadata?.[key];
9515
+ if (!value || Array.isArray(value) || typeof value !== "object") {
9516
+ return;
9517
+ }
9518
+ return value;
9519
+ }
9520
+ function metadataRecordArray(metadata, key) {
9521
+ const value = metadata?.[key];
9522
+ if (!Array.isArray(value)) {
9523
+ return;
9524
+ }
9525
+ const next = value.filter((entry) => Boolean(entry) && !Array.isArray(entry) && typeof entry === "object");
9526
+ return next.length > 0 ? next : undefined;
9527
+ }
9528
+ function buildScoutAgentCard(binding, options = {}) {
9498
9529
  const projectRoot = binding.endpoint.projectRoot ?? metadataString3(binding.agent.metadata, "projectRoot") ?? binding.endpoint.cwd ?? process.cwd();
9499
9530
  const currentDirectory = options.currentDirectory?.trim() || projectRoot;
9500
9531
  const handle = binding.agent.handle?.trim() || binding.agent.definitionId;
9501
9532
  const selector = binding.agent.selector?.trim() || metadataString3(binding.agent.metadata, "selector");
9502
9533
  const defaultSelector = binding.agent.defaultSelector?.trim() || metadataString3(binding.agent.metadata, "defaultSelector");
9503
9534
  const branch = metadataString3(binding.agent.metadata, "branch") || metadataString3(binding.endpoint.metadata, "branch");
9535
+ const description = metadataString3(binding.agent.metadata, "description");
9536
+ const version = metadataString3(binding.agent.metadata, "version");
9537
+ const documentationUrl = metadataString3(binding.agent.metadata, "documentationUrl") || metadataString3(binding.agent.metadata, "docsUrl");
9538
+ const provider = metadataRecord2(binding.agent.metadata, "provider");
9539
+ const skills = metadataRecordArray(binding.agent.metadata, "skills");
9540
+ const defaultInputModes = metadataStringArray(binding.agent.metadata, "defaultInputModes");
9541
+ const defaultOutputModes = metadataStringArray(binding.agent.metadata, "defaultOutputModes");
9542
+ const supportedInterfaces = metadataRecordArray(binding.agent.metadata, "supportedInterfaces");
9543
+ const securitySchemes = metadataRecord2(binding.agent.metadata, "securitySchemes");
9544
+ const securityRequirements = metadataStringMatrix(binding.agent.metadata, "securityRequirements");
9504
9545
  return {
9505
9546
  id: binding.agent.id,
9506
9547
  agentId: binding.agent.id,
9507
9548
  definitionId: binding.agent.definitionId,
9508
9549
  displayName: binding.agent.displayName,
9550
+ ...description ? { description } : {},
9551
+ ...provider ? { provider } : {},
9552
+ ...version ? { version } : {},
9553
+ ...documentationUrl ? { documentationUrl } : {},
9554
+ ...skills ? { skills } : {},
9555
+ ...defaultInputModes ? { defaultInputModes } : {},
9556
+ ...defaultOutputModes ? { defaultOutputModes } : {},
9557
+ ...supportedInterfaces ? { supportedInterfaces } : {},
9558
+ ...securitySchemes ? { securitySchemes } : {},
9559
+ ...securityRequirements ? { securityRequirements } : {},
9509
9560
  handle,
9510
9561
  ...selector ? { selector } : {},
9511
9562
  ...defaultSelector ? { defaultSelector } : {},
@@ -9520,7 +9571,7 @@ function buildRelayAgentCard(binding, options = {}) {
9520
9571
  ...options.createdById?.trim() ? { createdById: options.createdById.trim() } : {},
9521
9572
  brokerRegistered: options.brokerRegistered ?? false,
9522
9573
  ...options.inboxConversationId?.trim() ? { inboxConversationId: options.inboxConversationId.trim() } : {},
9523
- returnAddress: buildRelayReturnAddress({
9574
+ returnAddress: buildScoutReturnAddress({
9524
9575
  actorId: binding.agent.id,
9525
9576
  handle,
9526
9577
  displayName: binding.agent.displayName,
@@ -9542,7 +9593,7 @@ function buildRelayAgentCard(binding, options = {}) {
9542
9593
  }
9543
9594
  };
9544
9595
  }
9545
- var init_relay_agent_cards = __esm(() => {
9596
+ var init_scout_agent_cards = __esm(() => {
9546
9597
  init_src();
9547
9598
  });
9548
9599
 
@@ -9595,7 +9646,7 @@ async function createScoutAgentCard(input) {
9595
9646
  inboxConversationId = session.conversation.id;
9596
9647
  createdById = session.sourceId;
9597
9648
  }
9598
- return buildRelayAgentCard(binding, {
9649
+ return buildScoutAgentCard(binding, {
9599
9650
  currentDirectory,
9600
9651
  createdById,
9601
9652
  brokerRegistered: syncResult?.brokerRegistered ?? false,
@@ -9603,7 +9654,7 @@ async function createScoutAgentCard(input) {
9603
9654
  });
9604
9655
  }
9605
9656
  var init_service2 = __esm(async () => {
9606
- init_relay_agent_cards();
9657
+ init_scout_agent_cards();
9607
9658
  await __promiseAll([
9608
9659
  init_local_agents(),
9609
9660
  init_service()
@@ -9611,13 +9662,16 @@ var init_service2 = __esm(async () => {
9611
9662
  });
9612
9663
 
9613
9664
  // ../../apps/desktop/src/ui/terminal/cards.ts
9614
- function renderRelayAgentCard(card) {
9665
+ function renderScoutAgentCard(card) {
9615
9666
  const lines = [
9616
9667
  `${card.displayName} [@${card.handle}]`,
9617
9668
  `Agent: ${card.agentId}`,
9618
9669
  `Project: ${card.projectRoot}`,
9619
9670
  `Runtime: ${card.harness} via ${card.transport}${card.sessionId ? ` (${card.sessionId})` : ""}`
9620
9671
  ];
9672
+ if (card.description) {
9673
+ lines.push(`About: ${card.description}`);
9674
+ }
9621
9675
  if (card.selector) {
9622
9676
  lines.push(`Selector: ${card.selector}`);
9623
9677
  }
@@ -9634,6 +9688,12 @@ function renderRelayAgentCard(card) {
9634
9688
  if (card.returnAddress.conversationId) {
9635
9689
  lines.push(`Reply-To: ${card.returnAddress.conversationId}`);
9636
9690
  }
9691
+ if (card.skills && card.skills.length > 0) {
9692
+ lines.push(`Skills: ${card.skills.map((skill) => skill.name).join(", ")}`);
9693
+ }
9694
+ if (card.documentationUrl) {
9695
+ lines.push(`Docs: ${card.documentationUrl}`);
9696
+ }
9637
9697
  return lines.join(`
9638
9698
  `);
9639
9699
  }
@@ -9699,7 +9759,7 @@ async function runCardCommand(context, args) {
9699
9759
  currentDirectory: options.currentDirectory,
9700
9760
  createdById: resolveScoutAgentName(options.requesterId)
9701
9761
  });
9702
- context.output.writeValue(card, renderRelayAgentCard);
9762
+ context.output.writeValue(card, renderScoutAgentCard);
9703
9763
  }
9704
9764
  var init_card = __esm(async () => {
9705
9765
  init_context();
@@ -8729,8 +8729,8 @@ function diagnoseAgentIdentity(identity, candidates) {
8729
8729
  var parseAgentSelector = parseAgentIdentity;
8730
8730
  var formatAgentSelector = formatAgentIdentity;
8731
8731
  var resolveAgentSelector = resolveAgentIdentity;
8732
- // ../protocol/src/relay-agent-card.ts
8733
- function buildRelayReturnAddress(input) {
8732
+ // ../protocol/src/scout-agent-card.ts
8733
+ function buildScoutReturnAddress(input) {
8734
8734
  const next = {
8735
8735
  actorId: input.actorId,
8736
8736
  handle: input.handle.trim()
@@ -13674,14 +13674,14 @@ function displayNameForBrokerActor(snapshot, actorId) {
13674
13674
  function firstEndpointForActor(snapshot, actorId) {
13675
13675
  return Object.values(snapshot.endpoints).filter((endpoint) => endpoint.agentId === actorId).sort((lhs, rhs) => lhs.id.localeCompare(rhs.id))[0];
13676
13676
  }
13677
- function buildScoutReturnAddress(snapshot, actorId, options = {}) {
13677
+ function buildScoutReturnAddress2(snapshot, actorId, options = {}) {
13678
13678
  const agent = snapshot.agents[actorId];
13679
13679
  const actor = snapshot.actors[actorId];
13680
13680
  const endpoint = firstEndpointForActor(snapshot, actorId);
13681
13681
  const selector = agent?.selector?.trim() || metadataString2(agent?.metadata, "selector") || metadataString2(actor?.metadata, "selector");
13682
13682
  const defaultSelector = agent?.defaultSelector?.trim() || metadataString2(agent?.metadata, "defaultSelector") || metadataString2(actor?.metadata, "defaultSelector");
13683
13683
  const projectRoot = endpoint?.projectRoot ?? endpoint?.cwd ?? metadataString2(agent?.metadata, "projectRoot") ?? metadataString2(actor?.metadata, "projectRoot");
13684
- return buildRelayReturnAddress({
13684
+ return buildScoutReturnAddress({
13685
13685
  actorId,
13686
13686
  handle: agent?.handle?.trim() || actor?.handle?.trim() || actorId,
13687
13687
  displayName: agent?.displayName || actor?.displayName,
@@ -14009,7 +14009,7 @@ async function sendScoutDirectMessage(input) {
14009
14009
  const targetAgentId = directSession.targetId;
14010
14010
  const targetAgent = broker.snapshot.agents[targetAgentId] ?? ("agent" in directSession ? directSession.agent : undefined);
14011
14011
  const targetLabel = `@${targetAgent?.handle?.trim() || targetAgent?.displayName?.trim() || targetAgentId}`;
14012
- const returnAddress = buildScoutReturnAddress(broker.snapshot, OPERATOR_ID, {
14012
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, OPERATOR_ID, {
14013
14013
  conversationId: directSession.conversation.id,
14014
14014
  replyToMessageId: messageId
14015
14015
  });
@@ -1361,8 +1361,8 @@ var init_agent_selectors = __esm(() => {
1361
1361
  init_agent_address();
1362
1362
  });
1363
1363
 
1364
- // packages/protocol/src/relay-agent-card.ts
1365
- function buildRelayReturnAddress(input) {
1364
+ // packages/protocol/src/scout-agent-card.ts
1365
+ function buildScoutReturnAddress(input) {
1366
1366
  const next = {
1367
1367
  actorId: input.actorId,
1368
1368
  handle: input.handle.trim()
@@ -15639,14 +15639,14 @@ function displayNameForBrokerActor(snapshot, actorId) {
15639
15639
  function firstEndpointForActor(snapshot, actorId) {
15640
15640
  return Object.values(snapshot.endpoints).filter((endpoint) => endpoint.agentId === actorId).sort((lhs, rhs) => lhs.id.localeCompare(rhs.id))[0];
15641
15641
  }
15642
- function buildScoutReturnAddress(snapshot, actorId, options = {}) {
15642
+ function buildScoutReturnAddress2(snapshot, actorId, options = {}) {
15643
15643
  const agent = snapshot.agents[actorId];
15644
15644
  const actor = snapshot.actors[actorId];
15645
15645
  const endpoint = firstEndpointForActor(snapshot, actorId);
15646
15646
  const selector = agent?.selector?.trim() || metadataString3(agent?.metadata, "selector") || metadataString3(actor?.metadata, "selector");
15647
15647
  const defaultSelector = agent?.defaultSelector?.trim() || metadataString3(agent?.metadata, "defaultSelector") || metadataString3(actor?.metadata, "defaultSelector");
15648
15648
  const projectRoot = endpoint?.projectRoot ?? endpoint?.cwd ?? metadataString3(agent?.metadata, "projectRoot") ?? metadataString3(actor?.metadata, "projectRoot");
15649
- return buildRelayReturnAddress({
15649
+ return buildScoutReturnAddress({
15650
15650
  actorId,
15651
15651
  handle: agent?.handle?.trim() || actor?.handle?.trim() || actorId,
15652
15652
  displayName: agent?.displayName || actor?.displayName,
@@ -16110,7 +16110,7 @@ async function sendScoutMessage(input) {
16110
16110
  const unresolvedTargets = mentionResolution.resolved.filter((target) => !validTargets.includes(target.agentId)).map((target) => target.label).concat(mentionResolution.unresolved).concat(mentionResolution.ambiguous.map((entry) => entry.label)).concat(explicitTargetCandidates.filter((targetId) => !validTargets.includes(targetId)));
16111
16111
  const messageId = `m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 6)}`;
16112
16112
  const speechText = input.shouldSpeak ? stripScoutAgentSelectorLabels(input.body) : "";
16113
- const returnAddress = buildScoutReturnAddress(broker.snapshot, senderId, {
16113
+ const returnAddress = buildScoutReturnAddress2(broker.snapshot, senderId, {
16114
16114
  conversationId: conversation.id,
16115
16115
  replyToMessageId: messageId
16116
16116
  });
@@ -16662,20 +16662,26 @@ async function createOpenScoutWebServer(options) {
16662
16662
  }
16663
16663
  const sourceRoots = (body.sourceRoots ?? []).map((entry) => entry?.trim()).filter((entry) => Boolean(entry && entry.length > 0));
16664
16664
  const harness = body.defaultHarness === "codex" ? "codex" : "claude";
16665
- await writeOpenScoutSettings({
16666
- discovery: {
16667
- contextRoot,
16668
- workspaceRoots: sourceRoots
16669
- },
16670
- agents: { defaultHarness: harness }
16671
- });
16672
- const result = await initializeOpenScoutSetup({
16673
- currentDirectory: contextRoot
16674
- });
16675
- return c.json({
16676
- ok: true,
16677
- projectConfigPath: result.currentProjectConfigPath
16678
- });
16665
+ try {
16666
+ await writeOpenScoutSettings({
16667
+ discovery: {
16668
+ contextRoot,
16669
+ workspaceRoots: sourceRoots
16670
+ },
16671
+ agents: { defaultHarness: harness }
16672
+ });
16673
+ const result = await initializeOpenScoutSetup({
16674
+ currentDirectory: contextRoot
16675
+ });
16676
+ return c.json({
16677
+ ok: true,
16678
+ projectConfigPath: result.currentProjectConfigPath
16679
+ });
16680
+ } catch (err) {
16681
+ const message = err instanceof Error ? err.message : String(err);
16682
+ console.error("[onboarding/project]", message);
16683
+ return c.json({ error: message }, 500);
16684
+ }
16679
16685
  });
16680
16686
  app.post("/api/onboarding/init", async (c) => {
16681
16687
  const body = await c.req.json().catch(() => ({}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openscout/scout",
3
- "version": "0.2.50",
3
+ "version": "0.2.51",
4
4
  "description": "Published Scout package that installs the `scout` command",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -23,6 +23,6 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "@openscout/runtime": "0.2.50"
26
+ "@openscout/runtime": "0.2.51"
27
27
  }
28
28
  }