@wasm-oj/organizer 0.2.0 → 0.2.2
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/README.md +10 -1
- package/THIRD_PARTY_NOTICES.md +57 -30
- package/dist/index.d.ts +246 -2
- package/dist/index.js +2176 -444
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# `@wasm-oj/organizer`
|
|
2
2
|
|
|
3
|
-
Schemas and
|
|
3
|
+
Schemas and repository validation utilities for problem collections, contest projections, and immutable
|
|
4
4
|
judge packages. The Organizer boundary validates schema, paths, size, digest, and deployability; it
|
|
5
5
|
does not compile, run, score, or assess a reference solution.
|
|
6
|
+
|
|
7
|
+
Contest output uses only `wasm-oj-platform/contests/v2`. Authoring presets are expanded into
|
|
8
|
+
canonical typed rules before synchronization; contest v1 and unknown properties are rejected.
|
|
9
|
+
|
|
10
|
+
## Upgrading from 0.2.0
|
|
11
|
+
|
|
12
|
+
Managed collection parsers have been removed. Use `parseRepositoryRoot`,
|
|
13
|
+
`parseRepositoryProblems`, `parseRepositoryContests`, and `validateRepositoryCatalog` for the
|
|
14
|
+
repository-authored catalog. `wasm-oj.json` and its exact Git commit define catalog content.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -65,13 +65,39 @@ package. The generated dependency report covers every package in the pinned
|
|
|
65
65
|
normal Cargo dependency graph selected for `wasm32-unknown-unknown`; its compact
|
|
66
66
|
inventory binds all 332 package identities and the exact HTML report digest.
|
|
67
67
|
|
|
68
|
+
### QuickJS guest Node standard I/O libraries
|
|
69
|
+
|
|
70
|
+
The generated guest prelude in `src/runtime/quickjs/stdlib.generated.ts` bundles
|
|
71
|
+
the following exact npm releases. `scripts/build-quickjs-stdlib.mjs` builds this
|
|
72
|
+
prelude from the locked packages and the WASM-OJ standard I/O adapters.
|
|
73
|
+
|
|
74
|
+
| Component | Source release | License |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| buffer 6.0.3 | <https://github.com/feross/buffer/tree/v6.0.3> | MIT |
|
|
77
|
+
| readable-stream 4.7.0 | <https://github.com/nodejs/readable-stream/tree/v4.7.0> | MIT |
|
|
78
|
+
| events 3.3.0 | <https://github.com/Gozala/events/tree/v3.3.0> | MIT |
|
|
79
|
+
| abort-controller 3.0.0 | <https://github.com/mysticatea/abort-controller/tree/v3.0.0> | MIT |
|
|
80
|
+
| event-target-shim 5.0.1 | <https://github.com/mysticatea/event-target-shim/tree/v5.0.1> | MIT |
|
|
81
|
+
| base64-js 1.5.1 | <https://github.com/beatgammit/base64-js/tree/v1.5.1> | MIT |
|
|
82
|
+
| ieee754 1.2.1 | <https://github.com/feross/ieee754/tree/v1.2.1> | BSD-3-Clause |
|
|
83
|
+
| string_decoder 1.3.0 | <https://github.com/nodejs/string_decoder/tree/v1.3.0> | MIT |
|
|
84
|
+
| safe-buffer 5.2.1 | <https://github.com/feross/safe-buffer/tree/v5.2.1> | MIT |
|
|
85
|
+
|
|
86
|
+
The complete upstream license texts, including the Node-derived stream and
|
|
87
|
+
decoder notices, are reproduced in `licenses/quickjs-node-stdlib-LICENSES.txt`
|
|
88
|
+
(SHA-256 `38e42dcb48e476e4e836552c814c911eb5464d80b56b970d87aa07b88c7b28f8`).
|
|
89
|
+
`licenses/components.json` binds each release to the generated bundle digest;
|
|
90
|
+
`pnpm-lock.yaml` pins all package integrity values. The Buffer declarations are
|
|
91
|
+
also copied from the same buffer 6.0.3 release. These guest libraries implement
|
|
92
|
+
the supported byte buffers and standard streams; they do not include Node.js.
|
|
93
|
+
|
|
68
94
|
## Distributed toolchain assets
|
|
69
95
|
|
|
70
96
|
### TypeScript-Go
|
|
71
97
|
|
|
72
98
|
- Distributed asset: `typescript-7.0.2.wasm.gz.bin`
|
|
73
|
-
- Compressed SHA-256: `
|
|
74
|
-
- Expanded Wasm SHA-256: `
|
|
99
|
+
- Compressed SHA-256: `29c6ee0e46151e2644049ae96162b1b1d46dcb13310e2a928114bb9030c3ea92`
|
|
100
|
+
- Expanded Wasm SHA-256: `01cea8c18841b73e0601d31859be1dcd323e61d83e7cfb15523dd051fc78c8da`
|
|
75
101
|
- Source revision: `microsoft/typescript-go@2bd066d87f5bafd315be9f40889d0a60b9e58e0b`
|
|
76
102
|
- Source: <https://github.com/microsoft/typescript-go/tree/2bd066d87f5bafd315be9f40889d0a60b9e58e0b>
|
|
77
103
|
- Build runtime: Go 1.26.3 standard library (`GOOS=wasip1`, `GOARCH=wasm`)
|
|
@@ -101,29 +127,29 @@ byte-identical to `go/LICENSE` in the exact Go 1.26.5 source distribution.
|
|
|
101
127
|
|
|
102
128
|
### Java compiler toolchain
|
|
103
129
|
|
|
104
|
-
- Distributed assets: `java-teavm-0.13.1.
|
|
130
|
+
- Distributed assets: `java-teavm-0.13.1.compiler.wasm`,
|
|
105
131
|
`java-teavm-0.13.1.compile-classlib.bin`, and
|
|
106
132
|
`java-teavm-0.13.1.runtime-classlib.bin`
|
|
107
133
|
- TeaVM Java compiler source: <https://github.com/konsoletyper/teavm-javac/tree/7e4a44cf521694a4e326e33850dd8aec165eb5c9>
|
|
108
134
|
- TeaVM core source: `konsoletyper/teavm@b3a245b7d9034ff35cdfab2def057a3d4f256efb`
|
|
109
|
-
|
|
110
|
-
- Compiler
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
with source patches and build provenance in `tools/java-client/`
|
|
136
|
+
- Compiler SHA-256: `8c37bce1c6fceeaffeffe93e10834309b67c8b6fb58c6f8a24547afe8be67f5d`
|
|
137
|
+
- Android Scanner and Spliterators source: `platform/libcore@de876a01b29230b877c9f408348c38a90ee724a5`
|
|
138
|
+
- Licenses: TeaVM Apache-2.0; OpenJDK and Android class libraries GPL-2.0
|
|
139
|
+
with Classpath exception
|
|
140
|
+
- License material: `licenses/Apache-2.0.txt`,
|
|
141
|
+
`licenses/openjdk-21-GPL-2.0-with-Classpath-exception.txt`, and
|
|
142
|
+
`licenses/android-libcore-GPL-2.0-with-Classpath-exception.txt`
|
|
143
|
+
|
|
144
|
+
The WasmGC compiler uses statically packaged JavaScript bindings and emits
|
|
145
|
+
standalone `wasip1` student modules. TeaVM links reachable class-library code
|
|
146
|
+
into those modules; the full class-library archives are compiler inputs.
|
|
121
147
|
|
|
122
148
|
### QuickJS-ng
|
|
123
149
|
|
|
124
150
|
- Distributed asset: `quickjs-0.15.1.wasm.gz.bin`
|
|
125
|
-
- Compressed SHA-256: `
|
|
126
|
-
- Expanded Wasm SHA-256: `
|
|
151
|
+
- Compressed SHA-256: `dc6e02e8610269e61b341331661515616451cec929fd534fa96d1c4f47fbcc9a`
|
|
152
|
+
- Expanded Wasm SHA-256: `a098db08592626781f6ad6e63f1b8a36da6d03b85b530dc94c441a348426b20b`
|
|
127
153
|
- Source revision: `quickjs-ng/quickjs@fd0a0210b7be00957751871e7e01b8291268fc29`
|
|
128
154
|
- Source: <https://github.com/quickjs-ng/quickjs/tree/fd0a0210b7be00957751871e7e01b8291268fc29>
|
|
129
155
|
- Build SDK: [WASI SDK 24.0 release archive for arm64 macOS](https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-arm64-macos.tar.gz),
|
|
@@ -240,25 +266,25 @@ source trees, so the inventory reuses the exact digest-bound `b9ef79d7` copies;
|
|
|
240
266
|
the revision-specific root and musl-fts notices remain separate. The generated
|
|
241
267
|
WebC and pinned command manifests do not relicense those payloads.
|
|
242
268
|
|
|
243
|
-
### CPython 3.14.
|
|
269
|
+
### CPython 3.14.7 for WASI P1
|
|
244
270
|
|
|
245
|
-
- Distributed assets: `python-3.14.
|
|
246
|
-
manifest `python-3.14.
|
|
247
|
-
- Official source archive: <https://www.python.org/ftp/python/3.14.
|
|
248
|
-
SHA-256 `
|
|
249
|
-
- Official SPDX document: <https://www.python.org/ftp/python/3.14.
|
|
250
|
-
SHA-256 `
|
|
271
|
+
- Distributed assets: `python-3.14.7-wasip1.webc.gz.bin` and its provenance
|
|
272
|
+
manifest `python-3.14.7-wasip1.manifest.json`
|
|
273
|
+
- Official source archive: <https://www.python.org/ftp/python/3.14.7/Python-3.14.7.tar.xz>,
|
|
274
|
+
SHA-256 `3b48dac8fb59f62eaa67ac83c1eb12bda1b7a08406dd286e252c11a66be27f81`
|
|
275
|
+
- Official SPDX document: <https://www.python.org/ftp/python/3.14.7/Python-3.14.7.tar.xz.spdx.json>,
|
|
276
|
+
SHA-256 `87f55ca6c59fe159fa8c47ba2d7d8bec39cc649b1d3f47c667f34025a2ca9a68`
|
|
251
277
|
- Expanded WebC SHA-256:
|
|
252
|
-
`
|
|
278
|
+
`a42c98f5f00582638c8e445440c506bbf94d5e55b3415d1f8d82d11c56cd4b56`
|
|
253
279
|
- Distributed gzip SHA-256:
|
|
254
|
-
`
|
|
280
|
+
`10027f0e32c77dfa0ce1c413b6cb27307d6744fe5e18e6da8cea738bd020260c`
|
|
255
281
|
- Provenance manifest SHA-256:
|
|
256
|
-
`
|
|
282
|
+
`53a24b258363a8494af164121111a34b49c85fa0e054627fe131feba6f359cd5`
|
|
257
283
|
- Deterministically exported `WOJFS002` runtime archive SHA-256:
|
|
258
|
-
`
|
|
284
|
+
`c1acac884af1c86833db5b65f8cc0a2304fce74dea0a05d9b40bde0a4e3e7c0e`
|
|
259
285
|
- CPython license: Python Software Foundation License Version 2 and the
|
|
260
286
|
historical notices reproduced with it
|
|
261
|
-
- License text: `licenses/cpython-3.14.
|
|
287
|
+
- License text: `licenses/cpython-3.14.7-PSF-2.0.txt`
|
|
262
288
|
- Bundled third-party source: Expat 2.8.1 (MIT), HACL* revision
|
|
263
289
|
`8ba599b2f6c9701b3dc961db895b0856a2210f76` (MIT), and libmpdec 2.5.1
|
|
264
290
|
(BSD-2-Clause); their exact notices are
|
|
@@ -270,7 +296,8 @@ WebC and pinned command manifests do not relicense those payloads.
|
|
|
270
296
|
`26a1d6601d727a96f4301d0d8647b5a42760ae0c`, and wasi-libc revision
|
|
271
297
|
`b9ef79d7dbd47c6c5bafdae760823467c2f60b70`.
|
|
272
298
|
|
|
273
|
-
WASM-OJ compiles this package from the pinned official sources
|
|
299
|
+
WASM-OJ compiles this package from the pinned official sources with a 4 MiB C
|
|
300
|
+
stack and 16 MiB initial linear memory, retaining `--stack-first`, disables
|
|
274
301
|
`_socket`, removes test/development-only standard-library roots, canonicalizes
|
|
275
302
|
build-only sysconfig paths, and packages the complete source SPDX document and
|
|
276
303
|
applicable CPython, third-party, compiler-rt, WASI SDK, and wasi-libc notices
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,249 @@
|
|
|
1
|
-
export { BROWSER_COLLECTION_SCHEMA, BROWSER_PROBLEM_SCHEMA,
|
|
1
|
+
export { BROWSER_COLLECTION_SCHEMA, BROWSER_PROBLEM_SCHEMA, parseProblemCollectionIndex, parseStandaloneProblemBundle, problemCollectionRevision, verifyProblemBundleBytes, verifyProblemCollectionRevision } from '@wasm-oj/core';
|
|
2
|
+
import { BuiltinLanguage as BuiltinLanguage$1, TargetAbi, OptimizationLevel } from '@wasm-oj/contracts';
|
|
2
3
|
|
|
3
4
|
declare function runCollectionCli(arguments_: readonly string[]): Promise<void>;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
declare const LANGUAGES: readonly ["c", "cpp", "rust", "python", "javascript", "typescript", "go"];
|
|
7
|
+
type BuiltinLanguage = (typeof LANGUAGES)[number];
|
|
8
|
+
|
|
9
|
+
declare const SUBMISSION_VERDICTS: readonly ["accepted", "wrong-answer", "runtime-error", "instruction-limit", "memory-limit", "output-limit", "filesystem-limit", "logical-time-limit", "wall-time-limit", "compile-error", "judge-error", "cancelled"];
|
|
10
|
+
type SubmissionVerdict = typeof SUBMISSION_VERDICTS[number];
|
|
11
|
+
|
|
12
|
+
type ContestEvidenceAt = "input-admitted" | "generated-source-ready" | "judge-terminal";
|
|
13
|
+
interface GlobalContestClock {
|
|
14
|
+
readonly kind: "global";
|
|
15
|
+
readonly registrationOpensAt: string;
|
|
16
|
+
readonly registrationClosesAt: string;
|
|
17
|
+
readonly startsAt: string;
|
|
18
|
+
readonly durationSeconds: number;
|
|
19
|
+
}
|
|
20
|
+
interface IndividualContestClock {
|
|
21
|
+
readonly kind: "individual";
|
|
22
|
+
readonly enrollmentOpensAt: string;
|
|
23
|
+
readonly enrollmentClosesAt: string;
|
|
24
|
+
readonly durationSeconds: number;
|
|
25
|
+
}
|
|
26
|
+
type ContestClock = GlobalContestClock | IndividualContestClock;
|
|
27
|
+
interface CodeOfficialTrack {
|
|
28
|
+
readonly kind: "code";
|
|
29
|
+
readonly aiAssist: "allowed" | "disabled";
|
|
30
|
+
}
|
|
31
|
+
interface PromptCompilerPin {
|
|
32
|
+
readonly configId: string;
|
|
33
|
+
readonly configDigest: string;
|
|
34
|
+
}
|
|
35
|
+
interface PromptProgramLimits {
|
|
36
|
+
readonly promptBytes: number;
|
|
37
|
+
readonly inputTokens: number;
|
|
38
|
+
readonly outputTokens: number;
|
|
39
|
+
readonly generatedSourceBytes: number;
|
|
40
|
+
readonly timeoutSeconds: number;
|
|
41
|
+
}
|
|
42
|
+
interface PromptAttemptPolicy {
|
|
43
|
+
readonly consumeOn: "model-response-received";
|
|
44
|
+
readonly terminalInfrastructureFailure: "release-reservation";
|
|
45
|
+
}
|
|
46
|
+
interface PromptProgramOfficialTrack {
|
|
47
|
+
readonly kind: "prompt-program";
|
|
48
|
+
readonly compiler: PromptCompilerPin;
|
|
49
|
+
readonly limits: PromptProgramLimits;
|
|
50
|
+
readonly attemptPolicy: PromptAttemptPolicy;
|
|
51
|
+
readonly disclosure: "private" | "best-after-end";
|
|
52
|
+
}
|
|
53
|
+
interface ContestProblemRuleBase {
|
|
54
|
+
readonly slug: string;
|
|
55
|
+
readonly batch: number;
|
|
56
|
+
readonly releaseAfterSeconds: number;
|
|
57
|
+
readonly submissionClosesAfterSeconds: number;
|
|
58
|
+
readonly points: number;
|
|
59
|
+
readonly attemptLimit: number;
|
|
60
|
+
}
|
|
61
|
+
interface CodeContestProblemRule extends ContestProblemRuleBase {
|
|
62
|
+
readonly output?: never;
|
|
63
|
+
}
|
|
64
|
+
interface PromptProgramOutputProfile {
|
|
65
|
+
readonly language: BuiltinLanguage$1;
|
|
66
|
+
readonly target: TargetAbi;
|
|
67
|
+
readonly optimization: OptimizationLevel;
|
|
68
|
+
readonly entry: string;
|
|
69
|
+
}
|
|
70
|
+
interface PromptProgramContestProblemRule extends ContestProblemRuleBase {
|
|
71
|
+
readonly output: PromptProgramOutputProfile;
|
|
72
|
+
}
|
|
73
|
+
type ScoreTieBreak = "fully-passed-cases" | "deterministic-cost" | "peak-memory" | "final-best-achieved-at";
|
|
74
|
+
interface ScoreContestScoring {
|
|
75
|
+
readonly kind: "score";
|
|
76
|
+
readonly tieBreaks: readonly ScoreTieBreak[];
|
|
77
|
+
}
|
|
78
|
+
type IcpcTieBreak = "last-solve-at" | "deterministic-cost" | "peak-memory";
|
|
79
|
+
interface IcpcContestScoring {
|
|
80
|
+
readonly kind: "icpc";
|
|
81
|
+
readonly wrongAttemptPenaltyMinutes: number;
|
|
82
|
+
readonly penalizedVerdicts: readonly SubmissionVerdict[];
|
|
83
|
+
readonly tieBreaks: readonly IcpcTieBreak[];
|
|
84
|
+
}
|
|
85
|
+
type ProgressTieBreak = "fully-passed-cases" | "deterministic-cost" | "peak-memory" | "final-best-achieved-at";
|
|
86
|
+
interface ProgressContestScoring {
|
|
87
|
+
readonly kind: "progress";
|
|
88
|
+
readonly tieBreaks: readonly ProgressTieBreak[];
|
|
89
|
+
}
|
|
90
|
+
type ContestScoring = ScoreContestScoring | IcpcContestScoring | ProgressContestScoring;
|
|
91
|
+
type ContestCheckpointScope = {
|
|
92
|
+
readonly kind: "all-released";
|
|
93
|
+
} | {
|
|
94
|
+
readonly kind: "batch";
|
|
95
|
+
readonly batch: number;
|
|
96
|
+
} | {
|
|
97
|
+
readonly kind: "problems";
|
|
98
|
+
readonly slugs: readonly string[];
|
|
99
|
+
};
|
|
100
|
+
interface ContestCheckpointThreshold {
|
|
101
|
+
readonly minimumSolved: number | null;
|
|
102
|
+
readonly minimumScore: number | null;
|
|
103
|
+
}
|
|
104
|
+
type ContestCheckpointRanking = {
|
|
105
|
+
readonly kind: "top-k";
|
|
106
|
+
readonly count: number;
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: "top-percent";
|
|
109
|
+
readonly percent: number;
|
|
110
|
+
} | null;
|
|
111
|
+
interface ContestCheckpointRule {
|
|
112
|
+
readonly id: string;
|
|
113
|
+
readonly atSeconds: number;
|
|
114
|
+
readonly scope: ContestCheckpointScope;
|
|
115
|
+
readonly threshold: ContestCheckpointThreshold;
|
|
116
|
+
readonly ranking: ContestCheckpointRanking;
|
|
117
|
+
readonly settlement: "provisional" | "pause-until-terminal";
|
|
118
|
+
}
|
|
119
|
+
type ContestLeaderboardRule = {
|
|
120
|
+
readonly kind: "live";
|
|
121
|
+
} | {
|
|
122
|
+
readonly kind: "freeze";
|
|
123
|
+
readonly atSeconds: number;
|
|
124
|
+
} | {
|
|
125
|
+
readonly kind: "hidden-until-end";
|
|
126
|
+
};
|
|
127
|
+
interface ContestRulesBase {
|
|
128
|
+
readonly clock: ContestClock;
|
|
129
|
+
readonly evidenceAt: ContestEvidenceAt;
|
|
130
|
+
readonly scoring: ContestScoring;
|
|
131
|
+
readonly checkpoints: readonly ContestCheckpointRule[];
|
|
132
|
+
readonly leaderboard: ContestLeaderboardRule;
|
|
133
|
+
}
|
|
134
|
+
interface CodeContestRules extends ContestRulesBase {
|
|
135
|
+
readonly officialTrack: CodeOfficialTrack;
|
|
136
|
+
readonly problems: readonly CodeContestProblemRule[];
|
|
137
|
+
}
|
|
138
|
+
interface PromptProgramContestRules extends ContestRulesBase {
|
|
139
|
+
readonly officialTrack: PromptProgramOfficialTrack;
|
|
140
|
+
readonly problems: readonly PromptProgramContestProblemRule[];
|
|
141
|
+
}
|
|
142
|
+
type ContestRules = CodeContestRules | PromptProgramContestRules;
|
|
143
|
+
|
|
144
|
+
declare const REPOSITORY_SCHEMA = "wasm-oj-platform/repository/v1";
|
|
145
|
+
declare const PROBLEMS_SCHEMA = "wasm-oj-platform/problems/v1";
|
|
146
|
+
declare const CONTESTS_SCHEMA = "wasm-oj-platform/contests/v2";
|
|
147
|
+
interface RepositoryObjectDescriptor {
|
|
148
|
+
readonly path: string;
|
|
149
|
+
readonly bytes: number;
|
|
150
|
+
readonly sha256: string;
|
|
151
|
+
}
|
|
152
|
+
interface LocalizedText {
|
|
153
|
+
readonly "zh-TW": string;
|
|
154
|
+
readonly en: string;
|
|
155
|
+
}
|
|
156
|
+
interface RepositoryRootManifest {
|
|
157
|
+
readonly schema: typeof REPOSITORY_SCHEMA;
|
|
158
|
+
readonly problems: string;
|
|
159
|
+
readonly contests: string;
|
|
160
|
+
}
|
|
161
|
+
interface RepositoryProblem {
|
|
162
|
+
readonly slug: string;
|
|
163
|
+
readonly order: number;
|
|
164
|
+
readonly title: LocalizedText;
|
|
165
|
+
readonly summary: LocalizedText;
|
|
166
|
+
readonly practiceEnabled: boolean;
|
|
167
|
+
readonly practiceBundle: RepositoryObjectDescriptor;
|
|
168
|
+
readonly contestBundle: RepositoryObjectDescriptor;
|
|
169
|
+
readonly judgePackage: RepositoryObjectDescriptor;
|
|
170
|
+
}
|
|
171
|
+
interface RepositoryProblemsManifest {
|
|
172
|
+
readonly schema: typeof PROBLEMS_SCHEMA;
|
|
173
|
+
readonly problems: readonly RepositoryProblem[];
|
|
174
|
+
}
|
|
175
|
+
type RepositoryContestStatus = "draft" | "published" | "archived";
|
|
176
|
+
type RepositoryContestAccessMode = "public" | "invite";
|
|
177
|
+
interface RepositoryContest {
|
|
178
|
+
readonly slug: string;
|
|
179
|
+
readonly status: RepositoryContestStatus;
|
|
180
|
+
readonly title: string;
|
|
181
|
+
readonly description: string;
|
|
182
|
+
readonly accessMode: RepositoryContestAccessMode;
|
|
183
|
+
readonly rules: ContestRules;
|
|
184
|
+
}
|
|
185
|
+
interface RepositoryContestsManifest {
|
|
186
|
+
readonly schema: typeof CONTESTS_SCHEMA;
|
|
187
|
+
readonly contests: readonly RepositoryContest[];
|
|
188
|
+
}
|
|
189
|
+
interface RepositoryCatalog {
|
|
190
|
+
readonly root: RepositoryRootManifest;
|
|
191
|
+
readonly problems: RepositoryProblemsManifest;
|
|
192
|
+
readonly contests: RepositoryContestsManifest;
|
|
193
|
+
}
|
|
194
|
+
declare function parseRepositoryRootValue(value: unknown): RepositoryRootManifest;
|
|
195
|
+
declare function parseRepositoryRoot(bytes: Uint8Array): RepositoryRootManifest;
|
|
196
|
+
declare function parseRepositoryProblemsValue(value: unknown): RepositoryProblemsManifest;
|
|
197
|
+
declare function parseRepositoryProblems(bytes: Uint8Array): RepositoryProblemsManifest;
|
|
198
|
+
declare function parseRepositoryContestsValue(value: unknown): RepositoryContestsManifest;
|
|
199
|
+
declare function parseRepositoryContests(bytes: Uint8Array): RepositoryContestsManifest;
|
|
200
|
+
declare function validateRepositoryCatalog(root: RepositoryRootManifest, problems: RepositoryProblemsManifest, contests: RepositoryContestsManifest): RepositoryCatalog;
|
|
201
|
+
|
|
202
|
+
interface JudgeAllowedProfile {
|
|
203
|
+
readonly target: "wasip1" | "wasix";
|
|
204
|
+
readonly optimization: "debug" | "release";
|
|
205
|
+
}
|
|
206
|
+
type JudgeAllowedProfiles = Readonly<Partial<Record<BuiltinLanguage, JudgeAllowedProfile>>>;
|
|
207
|
+
|
|
208
|
+
type TrustedJudgeRuntimeProfile = "c-wasip1-release" | "cpp-wasip1-release" | "rust-wasip1-release" | "go-wasip1-release";
|
|
209
|
+
|
|
210
|
+
declare const REPOSITORY_AUTHORING_JUDGES_SCHEMA = "wasm-oj-platform/repository-authoring-judges/v1";
|
|
211
|
+
interface RepositorySourceObject {
|
|
212
|
+
readonly path: string;
|
|
213
|
+
readonly bytes: number;
|
|
214
|
+
readonly sha256: string;
|
|
215
|
+
}
|
|
216
|
+
interface RepositorySourceArtifact extends RepositorySourceObject {
|
|
217
|
+
readonly runtimeProfile: TrustedJudgeRuntimeProfile;
|
|
218
|
+
}
|
|
219
|
+
interface RepositorySourceAsset extends RepositorySourceObject {
|
|
220
|
+
readonly guestPath: string;
|
|
221
|
+
}
|
|
222
|
+
type RepositorySourceJudge = {
|
|
223
|
+
readonly kind: "text";
|
|
224
|
+
} | {
|
|
225
|
+
readonly kind: "checker";
|
|
226
|
+
readonly artifact: RepositorySourceArtifact;
|
|
227
|
+
readonly assets: readonly RepositorySourceAsset[];
|
|
228
|
+
readonly args: readonly string[];
|
|
229
|
+
} | {
|
|
230
|
+
readonly kind: "interactive";
|
|
231
|
+
readonly artifact: RepositorySourceArtifact;
|
|
232
|
+
readonly assets: readonly RepositorySourceAsset[];
|
|
233
|
+
readonly args: readonly string[];
|
|
234
|
+
readonly inputPath: string;
|
|
235
|
+
};
|
|
236
|
+
interface RepositoryAuthoringJudgeProblem {
|
|
237
|
+
readonly slug: string;
|
|
238
|
+
readonly allowedProfiles: JudgeAllowedProfiles;
|
|
239
|
+
readonly judge: RepositorySourceJudge;
|
|
240
|
+
}
|
|
241
|
+
interface RepositoryAuthoringJudges {
|
|
242
|
+
readonly schema: typeof REPOSITORY_AUTHORING_JUDGES_SCHEMA;
|
|
243
|
+
readonly problems: readonly RepositoryAuthoringJudgeProblem[];
|
|
244
|
+
}
|
|
245
|
+
/** Author-only input used by collection build; never accepted by the platform sync boundary. */
|
|
246
|
+
declare function parseRepositoryAuthoringJudges(value: unknown): RepositoryAuthoringJudges;
|
|
247
|
+
|
|
248
|
+
export { CONTESTS_SCHEMA, PROBLEMS_SCHEMA, REPOSITORY_AUTHORING_JUDGES_SCHEMA, REPOSITORY_SCHEMA, parseRepositoryAuthoringJudges, parseRepositoryContests, parseRepositoryContestsValue, parseRepositoryProblems, parseRepositoryProblemsValue, parseRepositoryRoot, parseRepositoryRootValue, runCollectionCli, validateRepositoryCatalog };
|
|
249
|
+
export type { RepositoryCatalog, RepositoryContest, RepositoryObjectDescriptor, RepositoryProblem, RepositoryRootManifest };
|