@shipfox/api-agent-access-dto 20.2.0 → 20.3.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/api-agent-access-dto",
3
3
  "license": "MIT",
4
- "version": "20.2.0",
4
+ "version": "20.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -11,25 +11,35 @@
11
11
  "type": "module",
12
12
  "main": "dist/index.js",
13
13
  "types": "dist/index.d.ts",
14
+ "imports": {
15
+ "#test/*": "./test/*",
16
+ "#*": {
17
+ "workspace-source": "./src/*",
18
+ "default": "./dist/*"
19
+ }
20
+ },
14
21
  "exports": {
15
22
  ".": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
23
+ "workspace-source": {
24
+ "types": "./src/index.ts",
25
+ "default": "./src/index.ts"
26
+ },
27
+ "default": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
30
+ }
18
31
  }
19
32
  },
20
33
  "dependencies": {
21
34
  "zod": "^4.4.3"
22
35
  },
23
- "imports": {
24
- "#*": "./dist/*"
25
- },
26
- "shipfox": {
27
- "architecture": {
28
- "schema": 1,
29
- "realm": "source-available",
30
- "kind": "dto",
31
- "context": "agent-access"
32
- }
36
+ "devDependencies": {
37
+ "@shipfox/biome": "1.10.1",
38
+ "@shipfox/depcruise": "1.0.5",
39
+ "@shipfox/swc": "1.2.8",
40
+ "@shipfox/ts-config": "1.3.9",
41
+ "@shipfox/typescript": "1.1.10",
42
+ "@shipfox/vitest": "1.2.6"
33
43
  },
34
44
  "scripts": {
35
45
  "build": "shipfox-swc",
package/src/index.ts CHANGED
@@ -10,3 +10,45 @@ export {
10
10
  agentAccessErrorSchema,
11
11
  agentAccessOutputSchema,
12
12
  } from './schemas/envelope.js';
13
+ export {
14
+ AGENT_ACCESS_ANNOTATION_BODY_MAX_BYTES,
15
+ AGENT_ACCESS_CONNECTION_NAME_MAX_BYTES,
16
+ AGENT_ACCESS_DEFAULT_PAGE_LIMIT,
17
+ AGENT_ACCESS_DIAGNOSTIC_CODE_MAX_BYTES,
18
+ AGENT_ACCESS_DIAGNOSTIC_MAX_ITEMS,
19
+ AGENT_ACCESS_DIAGNOSTIC_MESSAGE_MAX_BYTES,
20
+ AGENT_ACCESS_DIAGNOSTIC_PATH_MAX_BYTES,
21
+ AGENT_ACCESS_PAGE_LIMIT_MAX,
22
+ AGENT_ACCESS_RESPONSE_MAX_BYTES,
23
+ AGENT_ACCESS_TEXT_MAX_BYTES,
24
+ type GetRunAnnotationsInputDto,
25
+ type GetRunAnnotationsResultDto,
26
+ getRunAnnotationsInputJsonSchema,
27
+ getRunAnnotationsInputSchema,
28
+ getRunAnnotationsResultJsonSchema,
29
+ getRunAnnotationsResultSchema,
30
+ type ListProjectsInputDto,
31
+ type ListProjectsResultDto,
32
+ type ListTriggerEventsInputDto,
33
+ type ListTriggerEventsResultDto,
34
+ type ListWorkflowDefinitionsInputDto,
35
+ type ListWorkflowDefinitionsResultDto,
36
+ type ListWorkflowRunsInputDto,
37
+ type ListWorkflowRunsResultDto,
38
+ listProjectsInputJsonSchema,
39
+ listProjectsInputSchema,
40
+ listProjectsResultJsonSchema,
41
+ listProjectsResultSchema,
42
+ listTriggerEventsInputJsonSchema,
43
+ listTriggerEventsInputSchema,
44
+ listTriggerEventsResultJsonSchema,
45
+ listTriggerEventsResultSchema,
46
+ listWorkflowDefinitionsInputJsonSchema,
47
+ listWorkflowDefinitionsInputSchema,
48
+ listWorkflowDefinitionsResultJsonSchema,
49
+ listWorkflowDefinitionsResultSchema,
50
+ listWorkflowRunsInputJsonSchema,
51
+ listWorkflowRunsInputSchema,
52
+ listWorkflowRunsResultJsonSchema,
53
+ listWorkflowRunsResultSchema,
54
+ } from './schemas/paged-tools.js';
@@ -0,0 +1,106 @@
1
+ import {
2
+ AGENT_ACCESS_DEFAULT_PAGE_LIMIT,
3
+ getRunAnnotationsInputSchema,
4
+ getRunAnnotationsResultSchema,
5
+ listProjectsInputSchema,
6
+ listProjectsResultJsonSchema,
7
+ listProjectsResultSchema,
8
+ listTriggerEventsInputSchema,
9
+ listWorkflowDefinitionsResultSchema,
10
+ listWorkflowRunsInputSchema,
11
+ } from './paged-tools.js';
12
+
13
+ const projectId = '00000000-0000-4000-8000-000000000001';
14
+
15
+ describe('paged agent-access schemas', () => {
16
+ test('defaults page size and rejects gateway-owned workspace arguments', () => {
17
+ expect(listProjectsInputSchema.parse({})).toEqual({limit: AGENT_ACCESS_DEFAULT_PAGE_LIMIT});
18
+ expect(listProjectsInputSchema.safeParse({workspace_id: projectId}).success).toBe(false);
19
+ });
20
+
21
+ test('validates date windows and strict list filters', () => {
22
+ expect(
23
+ listWorkflowRunsInputSchema.safeParse({
24
+ project_id: projectId,
25
+ created_from: '2026-08-02T00:00:00.000Z',
26
+ created_to: '2026-08-01T00:00:00.000Z',
27
+ }).success,
28
+ ).toBe(false);
29
+ expect(listTriggerEventsInputSchema.safeParse({source: ['push'], extra: true}).success).toBe(
30
+ false,
31
+ );
32
+ });
33
+
34
+ test('keeps output schemas as one strict object envelope result', () => {
35
+ expect(listProjectsResultJsonSchema).not.toHaveProperty('oneOf');
36
+ expect(listProjectsResultJsonSchema.properties.projects).toBeDefined();
37
+ expect(listProjectsResultSchema.safeParse({projects: [], next_cursor: null}).success).toBe(
38
+ true,
39
+ );
40
+ expect(
41
+ listProjectsResultSchema.safeParse({projects: [], next_cursor: null, workspace_id: projectId})
42
+ .success,
43
+ ).toBe(false);
44
+ });
45
+
46
+ test('requires annotation body truncation metadata to remain a boolean marker and byte count', () => {
47
+ const valid = {
48
+ id: projectId,
49
+ origin_step_id: '00000000-0000-4000-8000-000000000002',
50
+ origin_step_attempt: 1,
51
+ job_execution_id: '00000000-0000-4000-8000-000000000003',
52
+ sequence: 1,
53
+ created_at: '2026-08-01T00:00:00.000Z',
54
+ body: 'body',
55
+ };
56
+ expect(
57
+ getRunAnnotationsResultSchema.safeParse({annotations: [valid], next_cursor: null}).success,
58
+ ).toBe(true);
59
+ const truncated = {...valid, body_truncated: true, body_total_bytes: 8_192};
60
+ expect(
61
+ getRunAnnotationsResultSchema.safeParse({
62
+ annotations: [truncated],
63
+ next_cursor: null,
64
+ }).success,
65
+ ).toBe(true);
66
+ expect(
67
+ getRunAnnotationsResultSchema.safeParse({
68
+ annotations: [{...truncated, body_truncated: false}],
69
+ next_cursor: null,
70
+ }).success,
71
+ ).toBe(false);
72
+ expect(
73
+ getRunAnnotationsResultSchema.safeParse({
74
+ annotations: [{...truncated, body_total_bytes: '8192'}],
75
+ next_cursor: null,
76
+ }).success,
77
+ ).toBe(false);
78
+ expect(getRunAnnotationsInputSchema.safeParse({run_id: projectId, attempt: 0}).success).toBe(
79
+ false,
80
+ );
81
+ });
82
+
83
+ test('keeps definition sync error codes aligned with the producer enum', () => {
84
+ const sync = {
85
+ ref: null,
86
+ status: 'failed' as const,
87
+ last_sync_at: '2026-08-01T00:00:00.000Z',
88
+ started_at: null,
89
+ finished_at: '2026-08-01T00:00:00.000Z',
90
+ last_error_code: 'provider-timeout',
91
+ last_error_message: 'timed out',
92
+ diagnostics: {error_count: 0, warning_count: 0, items: []},
93
+ };
94
+ expect(
95
+ listWorkflowDefinitionsResultSchema.safeParse({definitions: [], sync, next_cursor: null})
96
+ .success,
97
+ ).toBe(true);
98
+ expect(
99
+ listWorkflowDefinitionsResultSchema.safeParse({
100
+ definitions: [],
101
+ sync: {...sync, last_error_code: 'untrusted-instruction'},
102
+ next_cursor: null,
103
+ }).success,
104
+ ).toBe(false);
105
+ });
106
+ });