chofex-cli 0.1.17 → 0.1.18

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 (3) hide show
  1. package/README.md +7 -0
  2. package/dist/index.js +26 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,13 @@ chofex status
17
17
  chofex requirements
18
18
  ```
19
19
 
20
+ For agent or script input, `chofex schema --stage application` and
21
+ `chofex schema --stage acceptance` print complete templates containing every
22
+ accepted JSON key. Local validation errors include `acceptedFields` in JSON
23
+ mode. The `status` response already includes both the registration and its
24
+ requirements; use `requirements` only when requirements-only human output is
25
+ preferred.
26
+
20
27
  Run `chofex login` to authenticate. For automation, provide an OAuth access
21
28
  token with `CHOFEX_TOKEN`.
22
29
 
package/dist/index.js CHANGED
@@ -30822,7 +30822,7 @@ var ShirtSize = exports_Schema.Literals([
30822
30822
  "3xl",
30823
30823
  "prefer_not_to_say"
30824
30824
  ]);
30825
- var ApplicationInput = exports_Schema.Struct({
30825
+ var applicationInputFields = {
30826
30826
  firstName: nonBlank(100),
30827
30827
  lastName: nonBlank(100),
30828
30828
  pronouns: optionalText(50),
@@ -30842,8 +30842,10 @@ var ApplicationInput = exports_Schema.Struct({
30842
30842
  codeOfConductAccepted: exports_Schema.Literal(true),
30843
30843
  privacyPolicyAccepted: exports_Schema.Literal(true),
30844
30844
  mediaConsent: exports_Schema.optional(exports_Schema.Boolean)
30845
- });
30846
- var AcceptedDetailsInput = exports_Schema.Struct({
30845
+ };
30846
+ var applicationInputFieldNames = Object.keys(applicationInputFields);
30847
+ var ApplicationInput = exports_Schema.Struct(applicationInputFields);
30848
+ var acceptedDetailsInputFields = {
30847
30849
  phone: nonBlank(32),
30848
30850
  dateOfBirth: exports_Schema.String.pipe(exports_Schema.check(exports_Schema.isPattern(/^\d{4}-\d{2}-\d{2}$/, {
30849
30851
  message: "Must use YYYY-MM-DD format"
@@ -30855,7 +30857,9 @@ var AcceptedDetailsInput = exports_Schema.Struct({
30855
30857
  emergencyContactName: nonBlank(200),
30856
30858
  emergencyContactPhone: nonBlank(32),
30857
30859
  mediaConsent: exports_Schema.optional(exports_Schema.Boolean)
30858
- });
30860
+ };
30861
+ var acceptedDetailsInputFieldNames = Object.keys(acceptedDetailsInputFields);
30862
+ var AcceptedDetailsInput = exports_Schema.Struct(acceptedDetailsInputFields);
30859
30863
  var RequirementSchema = exports_Schema.Struct({
30860
30864
  field: exports_Schema.String,
30861
30865
  reason: exports_Schema.String
@@ -31590,8 +31594,9 @@ var readJsonInput = (path4) => exports_Effect.tryPromise({
31590
31594
  },
31591
31595
  catch: (error2) => cliError("INVALID_INPUT_FILE", `Could not read JSON input from ${path4}: ${String(error2)}`)
31592
31596
  });
31593
- var decode2 = (schema, input) => exports_Schema.decodeUnknownEffect(schema, { onExcessProperty: "error" })(input).pipe(exports_Effect.mapError((error2) => cliError("VALIDATION_ERROR", "Input validation failed", false, {
31594
- issues: String(error2)
31597
+ var decode2 = (schema, input, acceptedFields) => exports_Schema.decodeUnknownEffect(schema, { onExcessProperty: "error" })(input).pipe(exports_Effect.mapError((error2) => cliError("VALIDATION_ERROR", "Input validation failed", false, {
31598
+ issues: String(error2),
31599
+ acceptedFields
31595
31600
  })));
31596
31601
  var validateSemantics = (input, requirements) => {
31597
31602
  if (requirements.length === 0)
@@ -31719,8 +31724,8 @@ var inputOrInteractive = (path4, interactive) => {
31719
31724
  return cliError("PROMPT_CANCELLED", "Interactive input was cancelled");
31720
31725
  }));
31721
31726
  };
31722
- var applicationInput = (path4, publicBaseUrl) => inputOrInteractive(path4, interactiveApplication(publicBaseUrl)).pipe(exports_Effect.flatMap((input) => decode2(ApplicationInput, input)), exports_Effect.flatMap((input) => validateSemantics(input, applicationSemanticRequirements(input))));
31723
- var acceptedDetailsInput = (path4, participationMode) => inputOrInteractive(path4, interactiveAcceptedDetails(participationMode)).pipe(exports_Effect.flatMap((input) => decode2(AcceptedDetailsInput, input)), exports_Effect.flatMap((input) => validateSemantics(input, acceptedDetailsSemanticRequirements(input, participationMode))));
31727
+ var applicationInput = (path4, publicBaseUrl) => inputOrInteractive(path4, interactiveApplication(publicBaseUrl)).pipe(exports_Effect.flatMap((input) => decode2(ApplicationInput, input, applicationInputFieldNames)), exports_Effect.flatMap((input) => validateSemantics(input, applicationSemanticRequirements(input))));
31728
+ var acceptedDetailsInput = (path4, participationMode) => inputOrInteractive(path4, interactiveAcceptedDetails(participationMode)).pipe(exports_Effect.flatMap((input) => decode2(AcceptedDetailsInput, input, acceptedDetailsInputFieldNames)), exports_Effect.flatMap((input) => validateSemantics(input, acceptedDetailsSemanticRequirements(input, participationMode))));
31724
31729
 
31725
31730
  // src/output.ts
31726
31731
  var printJson = (value3) => exports_Effect.sync(() => {
@@ -31941,11 +31946,20 @@ var whoamiCommand = exports_Command.make("whoami", {}, exports_Effect.fn("whoami
31941
31946
  var applicationTemplate = {
31942
31947
  firstName: "Ada",
31943
31948
  lastName: "Lovelace",
31949
+ pronouns: "she/her",
31944
31950
  city: "Lima",
31951
+ organization: "Analytical Engines",
31952
+ role: "Programmer",
31953
+ fieldOfStudy: "Computer Science",
31954
+ graduationYear: 2026,
31945
31955
  experienceLevel: "advanced",
31946
31956
  skills: ["TypeScript", "AI"],
31947
31957
  bio: "What I hope to build and contribute.",
31948
- teamPreference: "looking_for_team",
31958
+ githubUrl: "https://github.com/ada-lovelace",
31959
+ linkedInUrl: "https://linkedin.com/in/ada-lovelace",
31960
+ portfolioUrl: "https://example.com",
31961
+ teamPreference: "have_team",
31962
+ teamName: "Analytical Engines",
31949
31963
  codeOfConductAccepted: true,
31950
31964
  privacyPolicyAccepted: true,
31951
31965
  mediaConsent: false
@@ -31955,6 +31969,8 @@ var acceptanceTemplate = {
31955
31969
  dateOfBirth: "1990-01-01",
31956
31970
  nationalIdNumber: "passport-or-national-id",
31957
31971
  shirtSize: "m",
31972
+ dietaryRestrictions: "Vegetarian",
31973
+ accessibilityNeeds: "Wheelchair-accessible workspace",
31958
31974
  emergencyContactName: "Grace Hopper",
31959
31975
  emergencyContactPhone: "+1 555 0100",
31960
31976
  mediaConsent: false
@@ -31968,7 +31984,7 @@ var schemaCommand = exports_Command.make("schema", {
31968
31984
  stage: exports_Flag.choice("stage", ["application", "acceptance"]).pipe(exports_Flag.withDefault("application"))
31969
31985
  }, exports_Effect.fn("schemaCommand")(function* ({ stage }) {
31970
31986
  yield* printJson(templateFor(stage));
31971
- })).pipe(exports_Command.withDescription("Print a machine-readable input template"), exports_Command.withExamples([
31987
+ })).pipe(exports_Command.withDescription("Print a complete machine-readable input template"), exports_Command.withExamples([
31972
31988
  {
31973
31989
  command: "chofex schema --stage acceptance",
31974
31990
  description: "Print the post-acceptance input template"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chofex-cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Command-line client for the Chofex Hackathon",
5
5
  "type": "module",
6
6
  "bin": {