@run402/runtime-kernel 0.1.5 → 0.1.7

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 (34) hide show
  1. package/README.md +5 -3
  2. package/dist/apply.d.ts.map +1 -1
  3. package/dist/apply.js +35 -10
  4. package/dist/apply.js.map +1 -1
  5. package/dist/archive.d.ts +210 -0
  6. package/dist/archive.d.ts.map +1 -0
  7. package/dist/archive.js +1137 -0
  8. package/dist/archive.js.map +1 -0
  9. package/dist/capabilities.d.ts +30 -2
  10. package/dist/capabilities.d.ts.map +1 -1
  11. package/dist/capabilities.js +44 -2
  12. package/dist/capabilities.js.map +1 -1
  13. package/dist/functions-runtime.d.ts +33 -2
  14. package/dist/functions-runtime.d.ts.map +1 -1
  15. package/dist/functions-runtime.js +77 -1
  16. package/dist/functions-runtime.js.map +1 -1
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/ports.d.ts +4 -1
  22. package/dist/ports.d.ts.map +1 -1
  23. package/package.json +7 -4
  24. package/schemas/project-archive-auth-stubs.v1.schema.json +21 -0
  25. package/schemas/project-archive-database-tables.v1.schema.json +50 -0
  26. package/schemas/project-archive-descriptor.v1.schema.json +50 -0
  27. package/schemas/project-archive-export-report.v1.schema.json +44 -0
  28. package/schemas/project-archive-import-result.v1.schema.json +45 -0
  29. package/schemas/project-archive-index.v1.schema.json +132 -0
  30. package/schemas/project-archive-layout.v1.schema.json +44 -0
  31. package/schemas/project-archive-portability-report.v1.schema.json +61 -0
  32. package/schemas/project-archive-runtime-index.v1.schema.json +42 -0
  33. package/schemas/project-archive-secret-requirements.v1.schema.json +30 -0
  34. package/schemas/project-archive-storage-index.v1.schema.json +35 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-auth-stubs.v1.schema.json",
4
+ "title": "Run402 Project Archive Auth Stubs v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["subject_id", "disabled"],
8
+ "properties": {
9
+ "subject_id": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "disabled": {
14
+ "const": true
15
+ },
16
+ "references": {
17
+ "type": "array",
18
+ "items": { "type": "string", "minLength": 1 }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-database-tables.v1.schema.json",
4
+ "title": "Run402 Project Archive Database Tables v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "tables"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.database_tables.v1"
11
+ },
12
+ "tables": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["id", "name", "copy_path", "row_count"],
18
+ "properties": {
19
+ "id": { "type": "string", "minLength": 1 },
20
+ "schema": { "type": "string" },
21
+ "name": { "type": "string", "minLength": 1 },
22
+ "copy_path": { "type": "string", "minLength": 1 },
23
+ "row_count": { "type": "integer", "minimum": 0 },
24
+ "deterministic_order": { "type": "boolean" },
25
+ "order_by": {
26
+ "type": "array",
27
+ "items": { "type": "string", "minLength": 1 }
28
+ },
29
+ "columns": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["name", "type"],
35
+ "properties": {
36
+ "name": { "type": "string", "minLength": 1 },
37
+ "type": { "type": "string", "minLength": 1 },
38
+ "nullable": { "type": "boolean" }
39
+ }
40
+ }
41
+ },
42
+ "digest": {
43
+ "type": "string",
44
+ "pattern": "^sha256:[0-9a-f]{64}$"
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-descriptor.v1.schema.json",
4
+ "title": "Run402 Project Archive Descriptor v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["mediaType", "digest", "size"],
8
+ "properties": {
9
+ "mediaType": {
10
+ "type": "string",
11
+ "minLength": 1
12
+ },
13
+ "digest": {
14
+ "$ref": "#/$defs/sha256_digest"
15
+ },
16
+ "size": {
17
+ "type": "integer",
18
+ "minimum": 0
19
+ },
20
+ "path": {
21
+ "$ref": "#/$defs/archive_path"
22
+ },
23
+ "annotations": {
24
+ "type": "object",
25
+ "additionalProperties": {
26
+ "type": "string"
27
+ }
28
+ }
29
+ },
30
+ "$defs": {
31
+ "sha256_digest": {
32
+ "type": "string",
33
+ "pattern": "^sha256:[0-9a-f]{64}$"
34
+ },
35
+ "archive_path": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "not": {
39
+ "anyOf": [
40
+ { "pattern": "^/" },
41
+ { "pattern": "\\\\" },
42
+ { "pattern": "(^|/)\\.\\.(/|$)" },
43
+ { "pattern": "(^|/)\\.(/|$)" },
44
+ { "pattern": "//" },
45
+ { "pattern": "[\\u0000-\\u001f\\u007f]" }
46
+ ]
47
+ }
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-export-report.v1.schema.json",
4
+ "title": "Run402 Project Archive Export Report v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "export_scope", "auth_export", "consistency"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.export_report.v1"
11
+ },
12
+ "export_scope": {
13
+ "const": "portable-runtime-v1"
14
+ },
15
+ "auth_export": {
16
+ "enum": ["none", "stubs"]
17
+ },
18
+ "consistency": {
19
+ "enum": ["cloud_write_pause_v1", "core_fixture_v1"]
20
+ },
21
+ "omitted_sensitive_resource_count": {
22
+ "type": "integer",
23
+ "minimum": 0
24
+ },
25
+ "unsupported_resource_count": {
26
+ "type": "integer",
27
+ "minimum": 0
28
+ },
29
+ "counts": {
30
+ "type": "object",
31
+ "additionalProperties": {
32
+ "type": "integer",
33
+ "minimum": 0
34
+ }
35
+ },
36
+ "bytes": {
37
+ "type": "object",
38
+ "additionalProperties": {
39
+ "type": "integer",
40
+ "minimum": 0
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-import-result.v1.schema.json",
4
+ "title": "Run402 Project Archive Import Result v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "status", "archive_digest", "diagnostics"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.import_result.v1"
11
+ },
12
+ "status": {
13
+ "enum": ["verified", "dry_run", "imported", "blocked", "failed"]
14
+ },
15
+ "project_id": {
16
+ "type": "string"
17
+ },
18
+ "project_name": {
19
+ "type": "string"
20
+ },
21
+ "archive_digest": {
22
+ "type": ["string", "null"],
23
+ "pattern": "^sha256:[0-9a-f]{64}$"
24
+ },
25
+ "release_id": {
26
+ "type": ["string", "null"]
27
+ },
28
+ "required_secrets": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "additionalProperties": true
33
+ }
34
+ },
35
+ "diagnostics": {
36
+ "type": "array",
37
+ "items": {
38
+ "$ref": "https://run402.com/schemas/project-archive-portability-report.v1.schema.json#/$defs/entry"
39
+ }
40
+ },
41
+ "next_action": {
42
+ "$ref": "https://run402.com/schemas/project-archive-portability-report.v1.schema.json#/$defs/next_action"
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-index.v1.schema.json",
4
+ "title": "Run402 Project Archive Index v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "archive_version",
10
+ "mediaType",
11
+ "core_compatibility",
12
+ "source",
13
+ "required_capabilities",
14
+ "identity_descriptors",
15
+ "descriptors"
16
+ ],
17
+ "properties": {
18
+ "schema_version": {
19
+ "const": "run402.project_archive.index.v1"
20
+ },
21
+ "archive_version": {
22
+ "const": "run402-project-archive.v1"
23
+ },
24
+ "mediaType": {
25
+ "const": "application/vnd.run402.project-archive.index.v1+json"
26
+ },
27
+ "archive_digest": {
28
+ "$ref": "#/$defs/sha256_digest"
29
+ },
30
+ "core_compatibility": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["runtime_kernel", "release_spec"],
34
+ "properties": {
35
+ "runtime_kernel": { "type": "string", "minLength": 1 },
36
+ "release_spec": { "type": "string", "minLength": 1 }
37
+ }
38
+ },
39
+ "source": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["platform"],
43
+ "properties": {
44
+ "platform": {
45
+ "enum": ["run402-cloud", "run402-core", "run402-core-fixture"]
46
+ },
47
+ "label": {
48
+ "type": "string"
49
+ }
50
+ }
51
+ },
52
+ "required_capabilities": {
53
+ "type": "array",
54
+ "items": { "type": "string", "minLength": 1 },
55
+ "uniqueItems": true
56
+ },
57
+ "identity_descriptors": {
58
+ "type": "array",
59
+ "items": { "type": "string", "minLength": 1 },
60
+ "uniqueItems": true
61
+ },
62
+ "descriptors": {
63
+ "type": "object",
64
+ "additionalProperties": {
65
+ "$ref": "https://run402.com/schemas/project-archive-descriptor.v1.schema.json"
66
+ }
67
+ },
68
+ "consistency": {
69
+ "$ref": "#/$defs/consistency"
70
+ },
71
+ "annotations": {
72
+ "type": "object",
73
+ "additionalProperties": { "type": "string" }
74
+ }
75
+ },
76
+ "$defs": {
77
+ "sha256_digest": {
78
+ "type": "string",
79
+ "pattern": "^sha256:[0-9a-f]{64}$"
80
+ },
81
+ "consistency": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["mode"],
85
+ "properties": {
86
+ "mode": {
87
+ "enum": ["cloud_write_pause_v1", "core_fixture_v1"]
88
+ },
89
+ "pinned_release_id": {
90
+ "type": ["string", "null"]
91
+ },
92
+ "started_at": {
93
+ "type": "string",
94
+ "format": "date-time"
95
+ },
96
+ "completed_at": {
97
+ "type": "string",
98
+ "format": "date-time"
99
+ },
100
+ "database": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "postgres_version": { "type": "string" },
105
+ "snapshot": { "type": ["string", "null"] },
106
+ "wal_lsn": { "type": ["string", "null"] }
107
+ }
108
+ },
109
+ "storage": {
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "required": ["mutation_pause"],
113
+ "properties": {
114
+ "mutation_pause": {
115
+ "enum": ["not_applicable", "paused", "unavailable"]
116
+ }
117
+ }
118
+ },
119
+ "runtime": {
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": ["artifact_capture"],
123
+ "properties": {
124
+ "artifact_capture": {
125
+ "enum": ["captured", "not_applicable", "unavailable"]
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-layout.v1.schema.json",
4
+ "title": "Run402 Project Archive Layout v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "archive_version",
10
+ "mediaType",
11
+ "index",
12
+ "blobs",
13
+ "transports",
14
+ "checksum_lists_authoritative"
15
+ ],
16
+ "properties": {
17
+ "schema_version": {
18
+ "const": "run402.project_archive.layout.v1"
19
+ },
20
+ "archive_version": {
21
+ "const": "run402-project-archive.v1"
22
+ },
23
+ "mediaType": {
24
+ "const": "application/vnd.run402.project-archive.layout.v1+json"
25
+ },
26
+ "index": {
27
+ "const": "index.json"
28
+ },
29
+ "blobs": {
30
+ "const": "blobs/sha256"
31
+ },
32
+ "transports": {
33
+ "type": "array",
34
+ "contains": { "const": "directory" },
35
+ "items": {
36
+ "enum": ["directory", "tar"]
37
+ },
38
+ "uniqueItems": true
39
+ },
40
+ "checksum_lists_authoritative": {
41
+ "const": false
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-portability-report.v1.schema.json",
4
+ "title": "Run402 Project Archive Portability Report v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "entries"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.portability_report.v1"
11
+ },
12
+ "entries": {
13
+ "type": "array",
14
+ "items": { "$ref": "#/$defs/entry" }
15
+ }
16
+ },
17
+ "$defs": {
18
+ "entry": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["code", "severity", "resource_type", "message", "next_action", "retryable"],
22
+ "properties": {
23
+ "code": { "type": "string", "minLength": 1 },
24
+ "severity": { "enum": ["info", "warning", "blocking"] },
25
+ "resource_type": { "type": "string", "minLength": 1 },
26
+ "resource_id": { "type": "string" },
27
+ "path": { "type": "string" },
28
+ "message": { "type": "string", "minLength": 1 },
29
+ "next_action": { "$ref": "#/$defs/next_action" },
30
+ "retryable": { "type": "boolean" },
31
+ "context": {
32
+ "type": "object",
33
+ "additionalProperties": true
34
+ }
35
+ }
36
+ },
37
+ "next_action": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["type"],
41
+ "properties": {
42
+ "type": {
43
+ "enum": [
44
+ "run_command",
45
+ "set_secret",
46
+ "change_export_scope",
47
+ "remove_unsupported_feature",
48
+ "retry_later",
49
+ "contact_support",
50
+ "read_docs",
51
+ "none"
52
+ ]
53
+ },
54
+ "command": { "type": "string" },
55
+ "env_var": { "type": "string" },
56
+ "docs_url": { "type": "string", "format": "uri" },
57
+ "message": { "type": "string" }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-runtime-index.v1.schema.json",
4
+ "title": "Run402 Project Archive Runtime Index v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.runtime_index.v1"
11
+ },
12
+ "functions": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["name", "runtime", "artifact_digest", "artifact_path"],
18
+ "properties": {
19
+ "name": { "type": "string", "minLength": 1 },
20
+ "runtime": { "const": "node22" },
21
+ "entrypoint": { "type": "string" },
22
+ "artifact_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
23
+ "artifact_path": { "type": "string", "minLength": 1 },
24
+ "required_secrets": {
25
+ "type": "array",
26
+ "items": { "type": "string", "minLength": 1 }
27
+ },
28
+ "class": { "enum": ["standard", "ssr"] }
29
+ }
30
+ }
31
+ },
32
+ "astro_ssr": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["enabled"],
36
+ "properties": {
37
+ "enabled": { "type": "boolean" },
38
+ "function": { "type": "string" }
39
+ }
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-secret-requirements.v1.schema.json",
4
+ "title": "Run402 Project Archive Secret Requirements v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "secrets"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.secret_requirements.v1"
11
+ },
12
+ "secrets": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["name", "required"],
18
+ "properties": {
19
+ "name": { "type": "string", "minLength": 1 },
20
+ "required": { "type": "boolean" },
21
+ "targets": {
22
+ "type": "array",
23
+ "items": { "type": "string", "minLength": 1 }
24
+ },
25
+ "description": { "type": "string" }
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://run402.com/schemas/project-archive-storage-index.v1.schema.json",
4
+ "title": "Run402 Project Archive Storage Index v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "objects"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "const": "run402.project_archive.storage_index.v1"
11
+ },
12
+ "objects": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["key", "visibility", "content_type", "size", "digest", "blob_path"],
18
+ "properties": {
19
+ "key": { "type": "string", "minLength": 1 },
20
+ "visibility": { "enum": ["public", "private"] },
21
+ "content_type": { "type": "string", "minLength": 1 },
22
+ "cache_control": { "type": "string" },
23
+ "immutable": { "type": "boolean" },
24
+ "size": { "type": "integer", "minimum": 0 },
25
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
26
+ "blob_path": { "type": "string", "minLength": 1 },
27
+ "metadata": {
28
+ "type": "object",
29
+ "additionalProperties": true
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }