@camerontaylor/paseo-protocol 0.8.0-fork.1

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 (118) hide show
  1. package/README.md +12 -0
  2. package/dist/agent-attention-notification.d.ts +43 -0
  3. package/dist/agent-attention-notification.js +141 -0
  4. package/dist/agent-deep-link.d.ts +8 -0
  5. package/dist/agent-deep-link.js +49 -0
  6. package/dist/agent-labels.d.ts +10 -0
  7. package/dist/agent-labels.js +21 -0
  8. package/dist/agent-lifecycle.d.ts +3 -0
  9. package/dist/agent-lifecycle.js +8 -0
  10. package/dist/agent-state-bucket.d.ts +14 -0
  11. package/dist/agent-state-bucket.js +41 -0
  12. package/dist/agent-title-limits.d.ts +2 -0
  13. package/dist/agent-title-limits.js +2 -0
  14. package/dist/agent-types.d.ts +478 -0
  15. package/dist/agent-types.js +22 -0
  16. package/dist/binary-frames/demux.d.ts +11 -0
  17. package/dist/binary-frames/demux.js +23 -0
  18. package/dist/binary-frames/file-transfer.d.ts +51 -0
  19. package/dist/binary-frames/file-transfer.js +108 -0
  20. package/dist/binary-frames/index.d.ts +4 -0
  21. package/dist/binary-frames/index.js +4 -0
  22. package/dist/binary-frames/terminal.d.ts +35 -0
  23. package/dist/binary-frames/terminal.js +100 -0
  24. package/dist/branch-slug.d.ts +14 -0
  25. package/dist/branch-slug.js +49 -0
  26. package/dist/browser-automation/capabilities.d.ts +7 -0
  27. package/dist/browser-automation/capabilities.js +31 -0
  28. package/dist/browser-automation/rpc-schemas.d.ts +1112 -0
  29. package/dist/browser-automation/rpc-schemas.js +462 -0
  30. package/dist/chat/rpc-schemas.d.ts +158 -0
  31. package/dist/chat/rpc-schemas.js +104 -0
  32. package/dist/chat/types.d.ts +30 -0
  33. package/dist/chat/types.js +23 -0
  34. package/dist/check-traits.d.ts +11 -0
  35. package/dist/check-traits.js +10 -0
  36. package/dist/client-capabilities.d.ts +20 -0
  37. package/dist/client-capabilities.js +47 -0
  38. package/dist/connection-offer.d.ts +36 -0
  39. package/dist/connection-offer.js +53 -0
  40. package/dist/daemon-endpoints.d.ts +47 -0
  41. package/dist/daemon-endpoints.js +201 -0
  42. package/dist/error-utils.d.ts +11 -0
  43. package/dist/error-utils.js +27 -0
  44. package/dist/forge-manifest.d.ts +66 -0
  45. package/dist/forge-manifest.js +92 -0
  46. package/dist/generated/validation/ws-outbound.aot.d.ts +2 -0
  47. package/dist/generated/validation/ws-outbound.aot.js +98097 -0
  48. package/dist/git-remote.d.ts +33 -0
  49. package/dist/git-remote.js +94 -0
  50. package/dist/gitea-status.d.ts +10 -0
  51. package/dist/gitea-status.js +23 -0
  52. package/dist/gitlab-pipeline.d.ts +10 -0
  53. package/dist/gitlab-pipeline.js +17 -0
  54. package/dist/host-connection-schema.d.ts +11 -0
  55. package/dist/host-connection-schema.js +9 -0
  56. package/dist/literal-union.d.ts +2 -0
  57. package/dist/literal-union.js +2 -0
  58. package/dist/loop/rpc-schemas.d.ts +636 -0
  59. package/dist/loop/rpc-schemas.js +164 -0
  60. package/dist/messages.d.ts +60742 -0
  61. package/dist/messages.js +6152 -0
  62. package/dist/paseo-config-schema.d.ts +138 -0
  63. package/dist/paseo-config-schema.js +98 -0
  64. package/dist/paseo-tool-call-detail.d.ts +15 -0
  65. package/dist/paseo-tool-call-detail.js +305 -0
  66. package/dist/path-utils.d.ts +2 -0
  67. package/dist/path-utils.js +16 -0
  68. package/dist/plugin-requirements.d.ts +11 -0
  69. package/dist/plugin-requirements.js +26 -0
  70. package/dist/plugin-source-reference.d.ts +7 -0
  71. package/dist/plugin-source-reference.js +41 -0
  72. package/dist/provider-config.d.ts +139 -0
  73. package/dist/provider-config.js +115 -0
  74. package/dist/provider-icon-names.d.ts +5 -0
  75. package/dist/provider-icon-names.js +54 -0
  76. package/dist/provider-manifest.d.ts +37 -0
  77. package/dist/provider-manifest.js +261 -0
  78. package/dist/provider-snapshot-codec.d.ts +18 -0
  79. package/dist/provider-snapshot-codec.js +71 -0
  80. package/dist/schedule/cadence.d.ts +6 -0
  81. package/dist/schedule/cadence.js +28 -0
  82. package/dist/schedule/cron-expression.d.ts +13 -0
  83. package/dist/schedule/cron-expression.js +97 -0
  84. package/dist/schedule/rpc-schemas.d.ts +568 -0
  85. package/dist/schedule/rpc-schemas.js +155 -0
  86. package/dist/schedule/types.d.ts +201 -0
  87. package/dist/schedule/types.js +68 -0
  88. package/dist/search/text-match.d.ts +71 -0
  89. package/dist/search/text-match.js +291 -0
  90. package/dist/ssh-transport.d.ts +11 -0
  91. package/dist/ssh-transport.js +72 -0
  92. package/dist/terminal-activity.d.ts +21 -0
  93. package/dist/terminal-activity.js +25 -0
  94. package/dist/terminal-input-mode.d.ts +30 -0
  95. package/dist/terminal-input-mode.js +180 -0
  96. package/dist/terminal-key-input.d.ts +13 -0
  97. package/dist/terminal-key-input.js +210 -0
  98. package/dist/terminal-profiles.d.ts +41 -0
  99. package/dist/terminal-profiles.js +270 -0
  100. package/dist/terminal-snapshot.d.ts +3 -0
  101. package/dist/terminal-snapshot.js +184 -0
  102. package/dist/terminal-stream-protocol.d.ts +2 -0
  103. package/dist/terminal-stream-protocol.js +2 -0
  104. package/dist/terminal-subscription-key.d.ts +2 -0
  105. package/dist/terminal-subscription-key.js +9 -0
  106. package/dist/timeline-identity.d.ts +3 -0
  107. package/dist/timeline-identity.js +8 -0
  108. package/dist/tool-call-display.d.ts +11 -0
  109. package/dist/tool-call-display.js +136 -0
  110. package/dist/tool-name-normalization.d.ts +9 -0
  111. package/dist/tool-name-normalization.js +82 -0
  112. package/dist/validation/ws-outbound-schema-metadata.d.ts +11418 -0
  113. package/dist/validation/ws-outbound-schema-metadata.js +3 -0
  114. package/dist/validation/ws-outbound.d.ts +12 -0
  115. package/dist/validation/ws-outbound.js +8 -0
  116. package/dist/workspace-labels.d.ts +9 -0
  117. package/dist/workspace-labels.js +19 -0
  118. package/package.json +44 -0
@@ -0,0 +1,71 @@
1
+ function thinkingSetKey(set) {
2
+ return JSON.stringify(set);
3
+ }
4
+ function compactModel({ provider: _provider, thinkingOptions, defaultThinkingOptionId, ...modelFields }, thinkingSets, thinkingSetIndexes) {
5
+ const compact = modelFields;
6
+ if (thinkingOptions === undefined) {
7
+ if (defaultThinkingOptionId !== undefined) {
8
+ compact.defaultThinkingOptionId = defaultThinkingOptionId;
9
+ }
10
+ return compact;
11
+ }
12
+ const thinkingSet = {
13
+ options: thinkingOptions,
14
+ ...(defaultThinkingOptionId !== undefined ? { defaultOptionId: defaultThinkingOptionId } : {}),
15
+ };
16
+ const key = thinkingSetKey(thinkingSet);
17
+ const existingIndex = thinkingSetIndexes.get(key);
18
+ if (existingIndex !== undefined) {
19
+ compact.thinkingSet = existingIndex;
20
+ return compact;
21
+ }
22
+ const index = thinkingSets.length;
23
+ thinkingSets.push(thinkingSet);
24
+ thinkingSetIndexes.set(key, index);
25
+ compact.thinkingSet = index;
26
+ return compact;
27
+ }
28
+ export function compactProviderSnapshot(entries) {
29
+ const thinkingSets = [];
30
+ const thinkingSetIndexes = new Map();
31
+ const compactEntries = entries.map((entry) => {
32
+ if (entry.models === undefined) {
33
+ return entry;
34
+ }
35
+ return {
36
+ ...entry,
37
+ models: entry.models.map((model) => compactModel(model, thinkingSets, thinkingSetIndexes)),
38
+ };
39
+ });
40
+ return { entries: compactEntries, thinkingSets };
41
+ }
42
+ function expandModel(provider, model, thinkingSets) {
43
+ const { thinkingSet: thinkingSetIndex, ...modelFields } = model;
44
+ if (thinkingSetIndex === undefined) {
45
+ return { provider, ...modelFields };
46
+ }
47
+ const thinkingSet = thinkingSets[thinkingSetIndex];
48
+ if (!thinkingSet) {
49
+ throw new RangeError(`Provider snapshot references missing thinking set ${thinkingSetIndex}`);
50
+ }
51
+ return {
52
+ provider,
53
+ ...modelFields,
54
+ thinkingOptions: thinkingSet.options,
55
+ ...(thinkingSet.defaultOptionId !== undefined
56
+ ? { defaultThinkingOptionId: thinkingSet.defaultOptionId }
57
+ : {}),
58
+ };
59
+ }
60
+ export function expandProviderSnapshot(snapshot) {
61
+ return snapshot.entries.map((entry) => {
62
+ const { models, ...entryFields } = entry;
63
+ if (models === undefined)
64
+ return entryFields;
65
+ return {
66
+ ...entryFields,
67
+ models: models.map((model) => expandModel(entryFields.provider, model, snapshot.thinkingSets)),
68
+ };
69
+ });
70
+ }
71
+ //# sourceMappingURL=provider-snapshot-codec.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Convert an exact rolling interval to an equivalent five-field cron cadence.
3
+ * Returns null when cron's calendar boundaries would change the interval.
4
+ */
5
+ export declare function everyMsToFiveFieldCron(everyMs: number): string | null;
6
+ //# sourceMappingURL=cadence.d.ts.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Convert an exact rolling interval to an equivalent five-field cron cadence.
3
+ * Returns null when cron's calendar boundaries would change the interval.
4
+ */
5
+ export function everyMsToFiveFieldCron(everyMs) {
6
+ const minutes = everyMs / 60000;
7
+ if (!Number.isInteger(minutes) || minutes <= 0) {
8
+ return null;
9
+ }
10
+ if (minutes < 60 && 60 % minutes === 0) {
11
+ return `*/${minutes} * * * *`;
12
+ }
13
+ if (minutes === 60) {
14
+ return "0 * * * *";
15
+ }
16
+ if (minutes % 60 !== 0) {
17
+ return null;
18
+ }
19
+ const hours = minutes / 60;
20
+ if (hours < 24 && 24 % hours === 0) {
21
+ return `0 */${hours} * * *`;
22
+ }
23
+ if (hours === 24) {
24
+ return "0 0 * * *";
25
+ }
26
+ return null;
27
+ }
28
+ //# sourceMappingURL=cadence.js.map
@@ -0,0 +1,13 @@
1
+ export interface CronFieldMatcher {
2
+ matches(value: number): boolean;
3
+ }
4
+ export interface ParsedCronExpression {
5
+ minute: CronFieldMatcher;
6
+ hour: CronFieldMatcher;
7
+ dayOfMonth: CronFieldMatcher;
8
+ month: CronFieldMatcher;
9
+ dayOfWeek: CronFieldMatcher;
10
+ }
11
+ export declare function parseCronExpression(expression: string): ParsedCronExpression;
12
+ export declare function validateCronExpression(expression: string): string | null;
13
+ //# sourceMappingURL=cron-expression.d.ts.map
@@ -0,0 +1,97 @@
1
+ const CRON_FIELD_BOUNDS = [
2
+ { min: 0, max: 59, name: "minute" },
3
+ { min: 0, max: 23, name: "hour" },
4
+ { min: 1, max: 31, name: "day-of-month" },
5
+ { min: 1, max: 12, name: "month" },
6
+ { min: 0, max: 6, name: "day-of-week" },
7
+ ];
8
+ function createRange(start, end, step) {
9
+ const values = [];
10
+ for (let value = start; value <= end; value += step) {
11
+ values.push(value);
12
+ }
13
+ return values;
14
+ }
15
+ function parseStepPart(part, bounds) {
16
+ const stepParts = part.split("/");
17
+ if (stepParts.length > 2) {
18
+ throw new Error(`Invalid cron ${bounds.name} step`);
19
+ }
20
+ const [base, stepSource] = stepParts;
21
+ const normalizedStep = stepSource?.trim();
22
+ const step = normalizedStep === undefined ? 1 : Number.parseInt(normalizedStep, 10);
23
+ if (!Number.isInteger(step) ||
24
+ step <= 0 ||
25
+ (normalizedStep !== undefined && String(step) !== normalizedStep)) {
26
+ throw new Error(`Invalid cron ${bounds.name} step`);
27
+ }
28
+ return { base, step };
29
+ }
30
+ function parseField(source, bounds) {
31
+ const trimmed = source.trim();
32
+ if (!trimmed) {
33
+ throw new Error(`Invalid cron ${bounds.name} field`);
34
+ }
35
+ const allowed = new Set();
36
+ for (const rawPart of trimmed.split(",")) {
37
+ const part = rawPart.trim();
38
+ if (!part) {
39
+ throw new Error(`Invalid cron ${bounds.name} field`);
40
+ }
41
+ const { base, step } = parseStepPart(part, bounds);
42
+ if (base === "*") {
43
+ for (const value of createRange(bounds.min, bounds.max, step)) {
44
+ allowed.add(value);
45
+ }
46
+ continue;
47
+ }
48
+ const rangeMatch = base.match(/^(\d+)-(\d+)$/);
49
+ if (rangeMatch) {
50
+ const start = Number.parseInt(rangeMatch[1], 10);
51
+ const end = Number.parseInt(rangeMatch[2], 10);
52
+ if (start > end || start < bounds.min || end > bounds.max) {
53
+ throw new Error(`Invalid cron ${bounds.name} range`);
54
+ }
55
+ for (const value of createRange(start, end, step)) {
56
+ allowed.add(value);
57
+ }
58
+ continue;
59
+ }
60
+ if (!/^\d+$/.test(base)) {
61
+ throw new Error(`Invalid cron ${bounds.name} value`);
62
+ }
63
+ const value = Number.parseInt(base, 10);
64
+ if (!Number.isInteger(value) || value < bounds.min || value > bounds.max) {
65
+ throw new Error(`Invalid cron ${bounds.name} value`);
66
+ }
67
+ allowed.add(value);
68
+ }
69
+ return {
70
+ matches(value) {
71
+ return allowed.has(value);
72
+ },
73
+ };
74
+ }
75
+ export function parseCronExpression(expression) {
76
+ const parts = expression.trim().split(/\s+/);
77
+ if (parts.length !== 5) {
78
+ throw new Error("Cron expressions must have 5 fields");
79
+ }
80
+ return {
81
+ minute: parseField(parts[0], CRON_FIELD_BOUNDS[0]),
82
+ hour: parseField(parts[1], CRON_FIELD_BOUNDS[1]),
83
+ dayOfMonth: parseField(parts[2], CRON_FIELD_BOUNDS[2]),
84
+ month: parseField(parts[3], CRON_FIELD_BOUNDS[3]),
85
+ dayOfWeek: parseField(parts[4], CRON_FIELD_BOUNDS[4]),
86
+ };
87
+ }
88
+ export function validateCronExpression(expression) {
89
+ try {
90
+ parseCronExpression(expression);
91
+ return null;
92
+ }
93
+ catch (error) {
94
+ return error instanceof Error ? error.message : "Invalid cron expression";
95
+ }
96
+ }
97
+ //# sourceMappingURL=cron-expression.js.map