@rudderhq/cli 0.3.4-canary.1 → 0.3.4-canary.10

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/index.js CHANGED
@@ -10,7 +10,7 @@ var __export = (target, all) => {
10
10
  };
11
11
 
12
12
  // ../packages/shared/dist/constants.js
13
- var ORGANIZATION_STATUSES, ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES, ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES, GOAL_LEVELS, GOAL_STATUSES, PROJECT_STATUSES, ORGANIZATION_RESOURCE_KINDS, ORGANIZATION_RESOURCE_SOURCE_TYPES, PROJECT_RESOURCE_ATTACHMENT_ROLES, AUTOMATION_STATUSES, AUTOMATION_CONCURRENCY_POLICIES, AUTOMATION_CATCH_UP_POLICIES, AUTOMATION_OUTPUT_MODES, AUTOMATION_TRIGGER_SIGNING_MODES, PROJECT_COLORS, APPROVAL_TYPES, SECRET_PROVIDERS, STORAGE_PROVIDERS, BILLING_TYPES, FINANCE_EVENT_KINDS, FINANCE_DIRECTIONS, FINANCE_UNITS, BUDGET_SCOPE_TYPES, BUDGET_METRICS, BUDGET_WINDOW_KINDS, BUDGET_INCIDENT_RESOLUTION_ACTIONS, INVITE_JOIN_TYPES, JOIN_REQUEST_TYPES, JOIN_REQUEST_STATUSES, PERMISSION_KEYS, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS, PLUGIN_LAUNCHER_PLACEMENT_ZONES, PLUGIN_LAUNCHER_ACTIONS, PLUGIN_LAUNCHER_BOUNDS, PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS;
13
+ var ORGANIZATION_STATUSES, ORGANIZATION_INTELLIGENCE_PROFILE_PURPOSES, ORGANIZATION_INTELLIGENCE_PROFILE_STATUSES, DEPLOYMENT_MODES, DEPLOYMENT_EXPOSURES, AUTH_BASE_URL_MODES, AGENT_STATUSES, AGENT_RUNTIME_TYPES, AGENT_ROLES, AGENT_ICON_NAMES, AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX, AGENT_AVATAR_BACKGROUND_PRESET_IDS, ISSUE_STATUSES, ISSUE_PRIORITIES, CALENDAR_SOURCE_TYPES, CALENDAR_OWNER_TYPES, CALENDAR_VISIBILITIES, CALENDAR_SOURCE_STATUSES, CALENDAR_EVENT_KINDS, CALENDAR_EVENT_STATUSES, CALENDAR_SOURCE_MODES, CHAT_CONVERSATION_STATUSES, CHAT_ISSUE_CREATION_MODES, CHAT_MESSAGE_ROLES, CHAT_MESSAGE_KINDS, CHAT_MESSAGE_STATUSES, CHAT_CONTEXT_ENTITY_TYPES, GOAL_LEVELS, GOAL_STATUSES, PROJECT_STATUSES, ORGANIZATION_RESOURCE_KINDS, ORGANIZATION_RESOURCE_SOURCE_TYPES, PROJECT_RESOURCE_ATTACHMENT_ROLES, AUTOMATION_STATUSES, AUTOMATION_CONCURRENCY_POLICIES, AUTOMATION_CATCH_UP_POLICIES, AUTOMATION_OUTPUT_MODES, AUTOMATION_TRIGGER_SIGNING_MODES, PROJECT_COLORS, PROJECT_ICONS, APPROVAL_TYPES, SECRET_PROVIDERS, STORAGE_PROVIDERS, BILLING_TYPES, FINANCE_EVENT_KINDS, FINANCE_DIRECTIONS, FINANCE_UNITS, BUDGET_SCOPE_TYPES, BUDGET_METRICS, BUDGET_WINDOW_KINDS, BUDGET_INCIDENT_RESOLUTION_ACTIONS, INVITE_JOIN_TYPES, JOIN_REQUEST_TYPES, JOIN_REQUEST_STATUSES, PERMISSION_KEYS, PLUGIN_STATUSES, PLUGIN_CATEGORIES, PLUGIN_CAPABILITIES, PLUGIN_UI_SLOT_TYPES, PLUGIN_RESERVED_COMPANY_ROUTE_SEGMENTS, PLUGIN_LAUNCHER_PLACEMENT_ZONES, PLUGIN_LAUNCHER_ACTIONS, PLUGIN_LAUNCHER_BOUNDS, PLUGIN_LAUNCHER_RENDER_ENVIRONMENTS, PLUGIN_UI_SLOT_ENTITY_TYPES, PLUGIN_STATE_SCOPE_KINDS;
14
14
  var init_constants = __esm({
15
15
  "../packages/shared/dist/constants.js"() {
16
16
  "use strict";
@@ -186,6 +186,24 @@ var init_constants = __esm({
186
186
  "linear-gradient(135deg, #475569 0%, #0f766e 100%)",
187
187
  "linear-gradient(135deg, #334155 0%, #7c3aed 100%)"
188
188
  ];
189
+ PROJECT_ICONS = [
190
+ "folder",
191
+ "book",
192
+ "plane",
193
+ "globe",
194
+ "code",
195
+ "rocket",
196
+ "target",
197
+ "lightbulb",
198
+ "wrench",
199
+ "shield",
200
+ "database",
201
+ "megaphone",
202
+ "palette",
203
+ "users",
204
+ "calendar",
205
+ "package"
206
+ ];
189
207
  APPROVAL_TYPES = [
190
208
  "hire_agent",
191
209
  "approve_ceo_strategy",
@@ -1571,7 +1589,7 @@ function validateProjectWorkspace(value, ctx) {
1571
1589
  });
1572
1590
  }
1573
1591
  }
1574
- var executionWorkspaceStrategySchema, projectExecutionWorkspacePolicySchema, projectWorkspaceSourceTypeSchema, projectWorkspaceVisibilitySchema, projectWorkspaceFields, projectColorValues, legacyProjectColorSchema, projectColorSchema, createProjectWorkspaceSchema, updateProjectWorkspaceSchema, projectFields, createProjectSchema, updateProjectSchema;
1592
+ var executionWorkspaceStrategySchema, projectExecutionWorkspacePolicySchema, projectWorkspaceSourceTypeSchema, projectWorkspaceVisibilitySchema, projectWorkspaceFields, projectColorValues, legacyProjectColorSchema, projectColorSchema, projectIconSchema, createProjectWorkspaceSchema, updateProjectWorkspaceSchema, projectFields, createProjectSchema, updateProjectSchema;
1575
1593
  var init_project = __esm({
1576
1594
  "../packages/shared/dist/validators/project.js"() {
1577
1595
  "use strict";
@@ -1617,6 +1635,7 @@ var init_project = __esm({
1617
1635
  projectColorValues = new Set(PROJECT_COLORS);
1618
1636
  legacyProjectColorSchema = z13.string().regex(/^#[0-9a-fA-F]{6}$/);
1619
1637
  projectColorSchema = z13.string().refine((value) => legacyProjectColorSchema.safeParse(value).success || projectColorValues.has(value), "Color must be a 6-digit hex value or a supported project gradient");
1638
+ projectIconSchema = z13.enum(PROJECT_ICONS);
1620
1639
  createProjectWorkspaceSchema = z13.object({
1621
1640
  ...projectWorkspaceFields,
1622
1641
  isPrimary: z13.boolean().optional().default(false)
@@ -1635,6 +1654,7 @@ var init_project = __esm({
1635
1654
  leadAgentId: z13.string().uuid().optional().nullable(),
1636
1655
  targetDate: z13.string().optional().nullable(),
1637
1656
  color: projectColorSchema.optional().nullable(),
1657
+ icon: projectIconSchema.optional().nullable(),
1638
1658
  executionWorkspacePolicy: projectExecutionWorkspacePolicySchema.optional().nullable(),
1639
1659
  resourceAttachments: z13.array(projectResourceAttachmentInputSchema).optional(),
1640
1660
  newResources: z13.array(createProjectInlineResourceSchema).optional(),
@@ -1649,12 +1669,12 @@ var init_project = __esm({
1649
1669
 
1650
1670
  // ../packages/shared/dist/validators/issue.js
1651
1671
  import { z as z14 } from "zod";
1652
- var executionWorkspaceStrategySchema2, issueExecutionWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, issueDocumentKeySchema, upsertIssueDocumentSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
1672
+ var runWorkspaceStrategySchema, issueRunWorkspaceSettingsSchema, issueAssigneeAdapterOverridesSchema, createIssueSchema, createIssueLabelSchema, updateIssueLabelSchema, updateIssueSchema, reorderIssueSchema, checkoutIssueSchema, addIssueCommentSchema, updateIssueCommentSchema, reportIssueCommitSchema, linkIssueApprovalSchema, createIssueAttachmentMetadataSchema, createIssueWorkspaceAttachmentSchema, ISSUE_DOCUMENT_FORMATS, issueDocumentFormatSchema, issueDocumentKeySchema, upsertIssueDocumentSchema, createLibraryDocumentSchema, updateLibraryDocumentSchema, restoreLibraryDocumentRevisionSchema;
1653
1673
  var init_issue = __esm({
1654
1674
  "../packages/shared/dist/validators/issue.js"() {
1655
1675
  "use strict";
1656
1676
  init_constants();
1657
- executionWorkspaceStrategySchema2 = z14.object({
1677
+ runWorkspaceStrategySchema = z14.object({
1658
1678
  type: z14.enum(["project_primary", "git_worktree", "adapter_managed", "cloud_sandbox"]).optional(),
1659
1679
  baseRef: z14.string().optional().nullable(),
1660
1680
  branchTemplate: z14.string().optional().nullable(),
@@ -1662,9 +1682,9 @@ var init_issue = __esm({
1662
1682
  provisionCommand: z14.string().optional().nullable(),
1663
1683
  teardownCommand: z14.string().optional().nullable()
1664
1684
  }).strict();
1665
- issueExecutionWorkspaceSettingsSchema = z14.object({
1685
+ issueRunWorkspaceSettingsSchema = z14.object({
1666
1686
  mode: z14.enum(["inherit", "shared_workspace", "isolated_workspace", "operator_branch", "reuse_existing", "agent_default"]).optional(),
1667
- workspaceStrategy: executionWorkspaceStrategySchema2.optional().nullable(),
1687
+ workspaceStrategy: runWorkspaceStrategySchema.optional().nullable(),
1668
1688
  workspaceRuntime: z14.record(z14.unknown()).optional().nullable()
1669
1689
  }).strict();
1670
1690
  issueAssigneeAdapterOverridesSchema = z14.object({
@@ -1687,7 +1707,19 @@ var init_issue = __esm({
1687
1707
  requestDepth: z14.number().int().nonnegative().optional().default(0),
1688
1708
  billingCode: z14.string().optional().nullable(),
1689
1709
  assigneeAgentRuntimeOverrides: issueAssigneeAdapterOverridesSchema.optional().nullable(),
1710
+ runWorkspaceId: z14.string().uuid().optional().nullable(),
1711
+ runWorkspacePreference: z14.enum([
1712
+ "inherit",
1713
+ "shared_workspace",
1714
+ "isolated_workspace",
1715
+ "operator_branch",
1716
+ "reuse_existing",
1717
+ "agent_default"
1718
+ ]).optional().nullable(),
1719
+ runWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
1720
+ /** @deprecated Use runWorkspaceId. */
1690
1721
  executionWorkspaceId: z14.string().uuid().optional().nullable(),
1722
+ /** @deprecated Use runWorkspacePreference. */
1691
1723
  executionWorkspacePreference: z14.enum([
1692
1724
  "inherit",
1693
1725
  "shared_workspace",
@@ -1696,7 +1728,8 @@ var init_issue = __esm({
1696
1728
  "reuse_existing",
1697
1729
  "agent_default"
1698
1730
  ]).optional().nullable(),
1699
- executionWorkspaceSettings: issueExecutionWorkspaceSettingsSchema.optional().nullable(),
1731
+ /** @deprecated Use runWorkspaceSettings. */
1732
+ executionWorkspaceSettings: issueRunWorkspaceSettingsSchema.optional().nullable(),
1700
1733
  labelIds: z14.array(z14.string().uuid()).optional()
1701
1734
  });
1702
1735
  createIssueLabelSchema = z14.object({
@@ -1814,6 +1847,8 @@ var init_work_product = __esm({
1814
1847
  ]);
1815
1848
  createIssueWorkProductSchema = z15.object({
1816
1849
  projectId: z15.string().uuid().optional().nullable(),
1850
+ runWorkspaceId: z15.string().uuid().optional().nullable(),
1851
+ /** @deprecated Use runWorkspaceId. */
1817
1852
  executionWorkspaceId: z15.string().uuid().optional().nullable(),
1818
1853
  runtimeServiceId: z15.string().uuid().optional().nullable(),
1819
1854
  type: issueWorkProductTypeSchema,
@@ -1835,19 +1870,19 @@ var init_work_product = __esm({
1835
1870
 
1836
1871
  // ../packages/shared/dist/validators/execution-workspace.js
1837
1872
  import { z as z16 } from "zod";
1838
- var executionWorkspaceStatusSchema, updateExecutionWorkspaceSchema;
1873
+ var runWorkspaceStatusSchema, updateRunWorkspaceSchema;
1839
1874
  var init_execution_workspace = __esm({
1840
1875
  "../packages/shared/dist/validators/execution-workspace.js"() {
1841
1876
  "use strict";
1842
- executionWorkspaceStatusSchema = z16.enum([
1877
+ runWorkspaceStatusSchema = z16.enum([
1843
1878
  "active",
1844
1879
  "idle",
1845
1880
  "in_review",
1846
1881
  "archived",
1847
1882
  "cleanup_failed"
1848
1883
  ]);
1849
- updateExecutionWorkspaceSchema = z16.object({
1850
- status: executionWorkspaceStatusSchema.optional(),
1884
+ updateRunWorkspaceSchema = z16.object({
1885
+ status: runWorkspaceStatusSchema.optional(),
1851
1886
  cleanupEligibleAt: z16.string().datetime().optional().nullable(),
1852
1887
  cleanupReason: z16.string().optional().nullable(),
1853
1888
  metadata: z16.record(z16.unknown()).optional().nullable()
@@ -2713,7 +2748,7 @@ var init_organization_skill_reference = __esm({
2713
2748
  });
2714
2749
 
2715
2750
  // ../packages/shared/dist/project-mentions.js
2716
- var AGENT_AVATAR_UUID_RE, AGENT_ASSET_ICON_RE, AGENT_DICEBEAR_NOTIONISTS_ICON_RE, PROJECT_COLOR_VALUES, AGENT_AVATAR_BACKGROUND_VALUES;
2751
+ var AGENT_AVATAR_UUID_RE, AGENT_ASSET_ICON_RE, AGENT_DICEBEAR_NOTIONISTS_ICON_RE, PROJECT_COLOR_VALUES, PROJECT_ICON_VALUES, AGENT_AVATAR_BACKGROUND_VALUES;
2717
2752
  var init_project_mentions = __esm({
2718
2753
  "../packages/shared/dist/project-mentions.js"() {
2719
2754
  "use strict";
@@ -2722,12 +2757,13 @@ var init_project_mentions = __esm({
2722
2757
  AGENT_ASSET_ICON_RE = new RegExp(`^asset:${AGENT_AVATAR_UUID_RE}(?:\\?bg=([a-z0-9-]+))?$`, "i");
2723
2758
  AGENT_DICEBEAR_NOTIONISTS_ICON_RE = new RegExp(`^${AGENT_DICEBEAR_NOTIONISTS_ICON_PREFIX}${AGENT_AVATAR_UUID_RE}(?:\\?bg=([a-z0-9-]+))?$`, "i");
2724
2759
  PROJECT_COLOR_VALUES = new Set(PROJECT_COLORS);
2760
+ PROJECT_ICON_VALUES = new Set(PROJECT_ICONS);
2725
2761
  AGENT_AVATAR_BACKGROUND_VALUES = new Set(AGENT_AVATAR_BACKGROUND_PRESET_IDS);
2726
2762
  }
2727
2763
  });
2728
2764
 
2729
2765
  // ../packages/shared/dist/issue-activity.js
2730
- var ISSUE_UPDATE_ACTIVITY_METADATA_KEYS, LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELDS, ISSUE_UPDATE_ACTIVITY_METADATA_KEY_SET, LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELD_SET;
2766
+ var ISSUE_UPDATE_ACTIVITY_METADATA_KEYS, LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELDS, INTERNAL_ISSUE_UPDATE_ACTIVITY_FIELDS, ISSUE_UPDATE_ACTIVITY_METADATA_KEY_SET, LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELD_SET, INTERNAL_ISSUE_UPDATE_ACTIVITY_FIELD_SET;
2731
2767
  var init_issue_activity = __esm({
2732
2768
  "../packages/shared/dist/issue-activity.js"() {
2733
2769
  "use strict";
@@ -2743,8 +2779,19 @@ var init_issue_activity = __esm({
2743
2779
  "normalizedReason"
2744
2780
  ];
2745
2781
  LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELDS = ["description", "title"];
2782
+ INTERNAL_ISSUE_UPDATE_ACTIVITY_FIELDS = [
2783
+ "executionWorkspaceId",
2784
+ "executionWorkspacePreference",
2785
+ "executionWorkspaceSettings",
2786
+ "currentExecutionWorkspace",
2787
+ "runWorkspaceId",
2788
+ "runWorkspacePreference",
2789
+ "runWorkspaceSettings",
2790
+ "currentRunWorkspace"
2791
+ ];
2746
2792
  ISSUE_UPDATE_ACTIVITY_METADATA_KEY_SET = new Set(ISSUE_UPDATE_ACTIVITY_METADATA_KEYS);
2747
2793
  LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELD_SET = new Set(LOW_SIGNAL_ISSUE_UPDATE_ACTIVITY_FIELDS);
2794
+ INTERNAL_ISSUE_UPDATE_ACTIVITY_FIELD_SET = new Set(INTERNAL_ISSUE_UPDATE_ACTIVITY_FIELDS);
2748
2795
  }
2749
2796
  });
2750
2797
 
@@ -10693,7 +10740,7 @@ var AGENT_CLI_CAPABILITIES = [
10693
10740
  id: "issue.documents.put",
10694
10741
  command: "rudder issue documents put <issue> <key> --body-file <path>",
10695
10742
  category: "issue",
10696
- description: "Legacy create or update of a DB-backed issue document; prefer `rudder library file put` for durable project files.",
10743
+ description: "Legacy create or update of a DB-backed issue document; prefer local project Library files under `$RUDDER_PROJECT_LIBRARY_ROOT` for durable project files.",
10697
10744
  mutating: true,
10698
10745
  contract: "compat",
10699
10746
  requiresOrgId: false,
@@ -10765,7 +10812,7 @@ var AGENT_CLI_CAPABILITIES = [
10765
10812
  id: "library.file.list",
10766
10813
  command: "rudder library file list [directory]",
10767
10814
  category: "library",
10768
- description: "List path-based Library files and folders.",
10815
+ description: "List Library files and folders; file rows include `libraryEntryId` when a strong reference can be generated.",
10769
10816
  mutating: false,
10770
10817
  contract: "agent-v1",
10771
10818
  requiresOrgId: true,
@@ -10777,7 +10824,31 @@ var AGENT_CLI_CAPABILITIES = [
10777
10824
  id: "library.file.get",
10778
10825
  command: "rudder library file get <path>",
10779
10826
  category: "library",
10780
- description: "Read one path-based Library file.",
10827
+ description: "Fallback read when local filesystem access is unavailable; JSON includes `mentionHref` and `markdownLink`.",
10828
+ mutating: false,
10829
+ contract: "agent-v1",
10830
+ requiresOrgId: true,
10831
+ requiresAgentId: false,
10832
+ requiresRunId: false,
10833
+ attachesRunIdWhenAvailable: false
10834
+ },
10835
+ {
10836
+ id: "library.file.ref",
10837
+ command: "rudder library file ref <path>",
10838
+ category: "library",
10839
+ description: "Return the stable Markdown reference for one Library file without printing file content.",
10840
+ mutating: false,
10841
+ contract: "agent-v1",
10842
+ requiresOrgId: true,
10843
+ requiresAgentId: false,
10844
+ requiresRunId: false,
10845
+ attachesRunIdWhenAvailable: false
10846
+ },
10847
+ {
10848
+ id: "library.file.link",
10849
+ command: "rudder library file link <path>",
10850
+ category: "library",
10851
+ description: "Compatibility alias for `rudder library file ref <path>`.",
10781
10852
  mutating: false,
10782
10853
  contract: "agent-v1",
10783
10854
  requiresOrgId: true,
@@ -10789,7 +10860,7 @@ var AGENT_CLI_CAPABILITIES = [
10789
10860
  id: "library.file.put",
10790
10861
  command: "rudder library file put <path> --body-file <path>",
10791
10862
  category: "library",
10792
- description: "Create or update one path-based Library file.",
10863
+ description: "Fallback create/update when local filesystem access is unavailable; JSON includes `mentionHref` and `markdownLink`.",
10793
10864
  mutating: true,
10794
10865
  contract: "agent-v1",
10795
10866
  requiresOrgId: true,
@@ -11545,7 +11616,10 @@ function buildIssueListPath(orgId, opts, searchQuery) {
11545
11616
  if (opts.status) params.set("status", opts.status);
11546
11617
  if (opts.assigneeAgentId) params.set("assigneeAgentId", opts.assigneeAgentId);
11547
11618
  if (opts.projectId) params.set("projectId", opts.projectId);
11548
- if (searchQuery?.trim()) params.set("q", searchQuery.trim());
11619
+ if (searchQuery?.trim()) {
11620
+ params.set("q", searchQuery.trim());
11621
+ params.set("searchFields", "title,description,comment");
11622
+ }
11549
11623
  const query = params.toString();
11550
11624
  return `/api/orgs/${orgId}/issues${query ? `?${query}` : ""}`;
11551
11625
  }
@@ -11703,10 +11777,14 @@ var RUDDER_AGENT_OPERATING_CONTRACT = [
11703
11777
  "- Personal skills live under `$AGENT_HOME/skills`.",
11704
11778
  "- Shared organization workspace root lives under `$RUDDER_ORG_WORKSPACE_ROOT`.",
11705
11779
  "- Shared organization skills live under `$RUDDER_ORG_SKILLS_DIR`.",
11706
- '- Library-backed project resources use `sourceType: "library"`; their `locator` points into `library:projects/<project-name>/`.',
11780
+ "- Project Library root lives under `$RUDDER_PROJECT_LIBRARY_ROOT` when the run has project context.",
11781
+ "- Project Library locator lives in `$RUDDER_PROJECT_LIBRARY_PATH` when the run has project context, for example `projects/<project-key>`.",
11782
+ '- Library-backed project resources use `sourceType: "library"`; their `locator` points into `library:projects/<project-key>/`.',
11707
11783
  "- Project Context is explicit operator-curated context, not the whole knowledge boundary. When it is insufficient, inspect broader Library and org workspace know-how before concluding context is missing.",
11708
- "- Durable generated project work files should be written under `library:projects/<project-name>/`.",
11709
- "- When you create or update a durable Library file, always include a user-visible Markdown link to that file in your final chat reply or issue comment. Use `library-file://file?p=<url-encoded-relative-path>&t=<url-encoded-title>` for Library file links.",
11784
+ "- In local trusted runs, durable generated project work files should be written directly under `$RUDDER_PROJECT_LIBRARY_ROOT` with normal filesystem tools.",
11785
+ "- `library:projects/<project-key>/...` is the Rudder product locator for those files, not the Markdown link syntax and not a reason to route ordinary local edits through the CLI.",
11786
+ '- When you create or update a durable Library file, always include a user-visible Markdown link to that file in your final chat reply or issue comment. Use `rudder library file ref "$RUDDER_PROJECT_LIBRARY_PATH/<relative-file>" --json` and paste the returned `markdownLink`; do not pass the absolute `$RUDDER_PROJECT_LIBRARY_ROOT/...` path to `ref`, and do not hand-write `library-entry://...` or `library-file://...` links.',
11787
+ '- If `$RUDDER_PROJECT_LIBRARY_ROOT` is unset or inaccessible, use `rudder library file get/put "$RUDDER_PROJECT_LIBRARY_PATH/<relative-file>"` as the remote or restricted runtime fallback.',
11710
11788
  "- Use `/tmp` only for transient scratch files and temporary verification files; do not put durable work product there.",
11711
11789
  "- Local trusted runtimes may expose the host operator home as `$RUDDER_OPERATOR_HOME`; use it only when a local skill or script intentionally needs operator-owned desktop app or CLI state. Do not replace `$HOME` with it.",
11712
11790
  "",
@@ -11715,6 +11793,18 @@ var RUDDER_AGENT_OPERATING_CONTRACT = [
11715
11793
  "When you write issue comments or chat replies, match the language of the user's or board's most recent substantive message unless they explicitly ask for a different language.",
11716
11794
  "When you mention a web page, issue URL, external dashboard, or other user-openable target in an issue comment or chat reply, write it as a clickable Markdown link with a descriptive label, for example `[NameSilo transfer page](https://www.namesilo.com/account_domain_manage_transfer.php)`. Do not put action URLs in backticks or code blocks unless you are showing literal code or a command.",
11717
11795
  "",
11796
+ "## Rudder Renderable Links",
11797
+ "",
11798
+ "When you mention Rudder entities in any user-visible Markdown output, prefer Rudder's renderable Markdown link syntax over plain IDs, bare URLs, or backticked references so the UI can render chips and navigate correctly.",
11799
+ "",
11800
+ "- Issues: use `[<identifier-or-title>](issue://<issue-id>?r=<identifier>)`; include `&c=<comment-id>` when linking to a specific comment.",
11801
+ "- Agents: use `[<agent-name>](agent://<agent-id>)` for reference-only links. Use `[<agent-name>](agent://<agent-id>?intent=wake)` only when you deliberately want an issue-composer mention to wake that agent.",
11802
+ "- Projects: use `[<project-name>](project://<project-id>)` when citing a Rudder project.",
11803
+ "- Chat threads: use `[<chat-title>](chat://<conversation-id>?t=<url-encoded-title>)` when citing a Rudder chat conversation.",
11804
+ '- Library files: use the `markdownLink` returned by `rudder library file ref "$RUDDER_PROJECT_LIBRARY_PATH/<relative-file>" --json`; do not hand-write `library-entry://...` links, and treat `library-file://...` as legacy path syntax only.',
11805
+ "",
11806
+ "Write these as normal Markdown links, not inside code spans or code blocks, unless you are literally documenting the syntax.",
11807
+ "",
11718
11808
  "Mention-triggered comment wakes arrive with `RUDDER_WAKE_COMMENT_ID`; read that wake comment before acting. Board/operator issue comments can wake an agent with a plain `@AgentName` token or an issue-composer agent mention serialized as `agent://agent-id?intent=wake`. Plain structured links such as `agent://agent-id` are reference-only links for rendering and navigation. Agent-authored issue comments do not fan out peer wakeups by default; use reviewer, assignment, or explicit handoff workflow instead. Mentioning an agent requests attention or collaboration; it does not transfer issue ownership unless the comment also makes an explicit handoff and normal checkout rules allow it.",
11719
11809
  "",
11720
11810
  "When an issue comment, done comment, or blocker comment cites visual evidence from a local screenshot/image path, attach the image with the Rudder CLI `--image <path>` option instead of leaving only the filesystem path in the text.",
@@ -12700,9 +12790,27 @@ function parseCsv5(value) {
12700
12790
  // src/commands/client/library.ts
12701
12791
  import { readFile as readFile6 } from "node:fs/promises";
12702
12792
  import path20 from "node:path";
12793
+ function toLibraryFileLinkResult(detail) {
12794
+ return {
12795
+ filePath: detail.filePath,
12796
+ libraryEntryId: detail.libraryEntryId,
12797
+ mentionHref: detail.mentionHref,
12798
+ markdownLink: detail.markdownLink
12799
+ };
12800
+ }
12801
+ async function printLibraryFileReference(filePath, opts) {
12802
+ const ctx = resolveCommandContext(opts, { requireCompany: true });
12803
+ const search = new URLSearchParams();
12804
+ search.set("path", filePath.trim());
12805
+ const result = await ctx.api.get(
12806
+ `/api/orgs/${ctx.orgId}/workspace/file?${search.toString()}`
12807
+ );
12808
+ if (!result) throw new Error("Library file not found");
12809
+ printOutput(toLibraryFileLinkResult(result), { json: ctx.json });
12810
+ }
12703
12811
  function registerLibraryCommands(program) {
12704
12812
  const library = program.command("library").description("Library file operations");
12705
- const file = library.command("file").description("Path-based Library file operations");
12813
+ const file = library.command("file").description("Library file operations");
12706
12814
  addCommonClientOptions(
12707
12815
  file.command("list").description(getAgentCliCapabilityById("library.file.list").description).argument("[directoryPath]", "Library directory path", "projects").action(async (directoryPath, opts) => {
12708
12816
  try {
@@ -12737,6 +12845,26 @@ function registerLibraryCommands(program) {
12737
12845
  }),
12738
12846
  { includeCompany: true }
12739
12847
  );
12848
+ addCommonClientOptions(
12849
+ file.command("link").description(getAgentCliCapabilityById("library.file.link").description).argument("<filePath>", "Library file path").action(async (filePath, opts) => {
12850
+ try {
12851
+ await printLibraryFileReference(filePath, opts);
12852
+ } catch (err) {
12853
+ handleCommandError(err);
12854
+ }
12855
+ }),
12856
+ { includeCompany: true }
12857
+ );
12858
+ addCommonClientOptions(
12859
+ file.command("ref").description(getAgentCliCapabilityById("library.file.ref").description).argument("<filePath>", "Library file path").action(async (filePath, opts) => {
12860
+ try {
12861
+ await printLibraryFileReference(filePath, opts);
12862
+ } catch (err) {
12863
+ handleCommandError(err);
12864
+ }
12865
+ }),
12866
+ { includeCompany: true }
12867
+ );
12740
12868
  addCommonClientOptions(
12741
12869
  file.command("put").description(getAgentCliCapabilityById("library.file.put").description).argument("<filePath>", "Library file path").option("--body-file <path>", "Read file content from a file, or '-' for stdin").action(async (filePath, opts) => {
12742
12870
  try {