{"owner":"wanasit","repo":"chrono","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# Agent Documentation - Project Setup & Architecture\n\nThis document provides a guide for AI agents working on `chrono` (chrono-node) to quickly understand the project context, layout, testing commands, and implementation constraints.\n\n## Project Overview\n`chrono` is a natural language date parser written in JavaScript/TypeScript. It extracts dates, times, and relative date expressions from free text.\n\n---\n\n## Technical Stack & Setup\n- **Language**: TypeScript / JavaScript (ES6 Modules and CommonJS outputs)\n- **Dependency Manager**: `npm`\n- **Testing Framework**: `jest`\n\n### Running Tests\nTo run the full test suite, execute:\n```bash\nnpm test\n```\nTo run tests silently:\n```bash\nnpm run test:silent\n```\n\n---\n\n## Directory Structure & Architecture\n\n```\nsrc/\n├── index.ts              # Main entry point and locale shortcut exports\n├── chrono.ts             # Main orchestrator class (Chrono, Parser, Refiner, Configuration)\n├── results.ts            # Core result models (ParsingResult, ParsingComponents)\n├── types.ts              # Global type definitions (ParsedResult, ParsingOption, ParsingReference)\n├── calculation/          # Arithmetic helpers (duration, weekdays)\n├── common/               # Locale-agnostic base parsers and refiners\n├── locales/              # Language-specific configurations, parsers, and refiners\n│   ├── de/\n│   ├── en/\n│   ├── zh/\n│   │   ├── hans/\n│   │   └── hant/\n│   └── ...\n└── utils/                # General utility functions\n```\n\n### Core Concepts\n1. **Parsers (`Parser`)**:\n   Implement `innerPattern()` to return the regular expression pattern, and `innerExtract(context, match)` to process matching strings and return a `ParsingResult`.\n2. **Refiners (`Refiner`)**:\n   Post-process and merge/filter the parsed results (e.g., merging separate date and time components, or resolving overlapping date ranges).\n3. **ParsingComponents (`ParsingComponents`)**:\n   Stores date and time elements (e.g., year, month, day, hour). Elements are marked as either explicitly assigned (`assign`) or implied (`imply`).\n\n---\n\n## Key Context & Caveats\n\n1. **Modular Parsers**:\n   Avoid overloading a single parser with multiple disparate concepts (e.g. mixing \"after/within\" with \"ago/before\"). Instead, introduce distinct, small parsers for each concern (e.g., `ZHHansDeadlineFormatParser` and `ZHHansAgoFormatParser`).\n\n2. **Locale Symmetry & Chinese (zh) Special Case**:\n   - The Chinese locale is a special case where we want Simplified (`zh.hans`) and Traditional (`zh.hant`) components to remain exactly synchronized. When implementing a parser/refiner or a test for Simplified Chinese (`zh.hans`), always implement the equivalent for Traditional Chinese (`zh.hant`) if relevant, translating characters accordingly (e.g., `几` vs `幾`, `个` vs `個`, `钟` vs `鐘`).\n   - English (`en`) is the most advanced locale in the library. Other locales are modeled after English but often lag behind.\n\n3. **Relative Date Arithmetic**:\n   Use helpers from `src/calculation/duration.ts` such as `addDuration` and `reverseDuration` to perform date calculations. When handling \"ago/before\" expressions, calculate the positive duration first, then reverse it using `reverseDuration`.\n\n4. **Abstract Parsers**:\n   Inherit from `AbstractParserWithWordBoundaryChecking` (or `AbstractParserWithLeftBoundaryChecking`) to inherit word boundary detection and clean regex boundary matching.\n\n5. **Testing Conventions**:\n   - Always pass a clear reference date (`refDate`) to `testSingleCase` to ensure deterministic execution of relative time tests.\n   - Assert the matched index (`result.index`) and text boundaries (`result.text`) to check for correct extraction when the text is embedded within sentences.\n   - The `result.index` check can be skipped if it is trivial (e.g., the input string is exactly equal to the expected matched text `result.text`).\n   - The `result.text` check may also be intentionally omitted on vague edge cases.\n\n---\n\n## Git & Commit Message Format\n\nFollow the Conventional Commits specification:\n```\n<type>(<scope>): <description>\n```\n- Example: `feat(zh): support past-tense relative time expressions (e.g. \"1小时前\")`\n- Example: `fix(en): support 'of' connector in weekday postfix`\n\n### Pre-commit Formatting\nRun the formatter before staging by executing:\n```bash\nnpm run prettier\n```\n*Note: Git commit runs `npm run prettier` and `npm run test:silent` automatically as a pre-commit hook.*\n\n---\n\n## AI Agent Tool & Command Guidelines\n\nTo ensure secure, auditable, and standard operations:\n- **Network Requests**: Do not run arbitrary commands to execute network calls. Use sandboxed tools or curl commands if external documentation is needed.\n- **Verification**: Always run `npm test` inside the workspace directory rather than trying to run temporary JS code blocks elsewhere to verify behaviors.\n"},"files":{"AGENTS.md":"# Agent Documentation - Project Setup & Architecture\n\nThis document provides a guide for AI agents working on `chrono` (chrono-node) to quickly understand the project context, layout, testing commands, and implementation constraints.\n\n## Project Overview\n`chrono` is a natural language date parser written in JavaScript/TypeScript. It extracts dates, times, and relative date expressions from free text.\n\n---\n\n## Technical Stack & Setup\n- **Language**: TypeScript / JavaScript (ES6 Modules and CommonJS outputs)\n- **Dependency Manager**: `npm`\n- **Testing Framework**: `jest`\n\n### Running Tests\nTo run the full test suite, execute:\n```bash\nnpm test\n```\nTo run tests silently:\n```bash\nnpm run test:silent\n```\n\n---\n\n## Directory Structure & Architecture\n\n```\nsrc/\n├── index.ts              # Main entry point and locale shortcut exports\n├── chrono.ts             # Main orchestrator class (Chrono, Parser, Refiner, Configuration)\n├── results.ts            # Core result models (ParsingResult, ParsingComponents)\n├── types.ts              # Global type definitions (ParsedResult, ParsingOption, ParsingReference)\n├── calculation/          # Arithmetic helpers (duration, weekdays)\n├── common/               # Locale-agnostic base parsers and refiners\n├── locales/              # Language-specific configurations, parsers, and refiners\n│   ├── de/\n│   ├── en/\n│   ├── zh/\n│   │   ├── hans/\n│   │   └── hant/\n│   └── ...\n└── utils/                # General utility functions\n```\n\n### Core Concepts\n1. **Parsers (`Parser`)**:\n   Implement `innerPattern()` to return the regular expression pattern, and `innerExtract(context, match)` to process matching strings and return a `ParsingResult`.\n2. **Refiners (`Refiner`)**:\n   Post-process and merge/filter the parsed results (e.g., merging separate date and time components, or resolving overlapping date ranges).\n3. **ParsingComponents (`ParsingComponents`)**:\n   Stores date and time elements (e.g., year, month, day, hour). Elements are marked as either explicitly assigned (`assign`) or implied (`imply`).\n\n---\n\n## Key Context & Caveats\n\n1. **Modular Parsers**:\n   Avoid overloading a single parser with multiple disparate concepts (e.g. mixing \"after/within\" with \"ago/before\"). Instead, introduce distinct, small parsers for each concern (e.g., `ZHHansDeadlineFormatParser` and `ZHHansAgoFormatParser`).\n\n2. **Locale Symmetry & Chinese (zh) Special Case**:\n   - The Chinese locale is a special case where we want Simplified (`zh.hans`) and Traditional (`zh.hant`) components to remain exactly synchronized. When implementing a parser/refiner or a test for Simplified Chinese (`zh.hans`), always implement the equivalent for Traditional Chinese (`zh.hant`) if relevant, translating characters accordingly (e.g., `几` vs `幾`, `个` vs `個`, `钟` vs `鐘`).\n   - English (`en`) is the most advanced locale in the library. Other locales are modeled after English but often lag behind.\n\n3. **Relative Date Arithmetic**:\n   Use helpers from `src/calculation/duration.ts` such as `addDuration` and `reverseDuration` to perform date calculations. When handling \"ago/before\" expressions, calculate the positive duration first, then reverse it using `reverseDuration`.\n\n4. **Abstract Parsers**:\n   Inherit from `AbstractParserWithWordBoundaryChecking` (or `AbstractParserWithLeftBoundaryChecking`) to inherit word boundary detection and clean regex boundary matching.\n\n5. **Testing Conventions**:\n   - Always pass a clear reference date (`refDate`) to `testSingleCase` to ensure deterministic execution of relative time tests.\n   - Assert the matched index (`result.index`) and text boundaries (`result.text`) to check for correct extraction when the text is embedded within sentences.\n   - The `result.index` check can be skipped if it is trivial (e.g., the input string is exactly equal to the expected matched text `result.text`).\n   - The `result.text` check may also be intentionally omitted on vague edge cases.\n\n---\n\n## Git & Commit Message Format\n\nFollow the Conventional Commits specification:\n```\n<type>(<scope>): <description>\n```\n- Example: `feat(zh): support past-tense relative time expressions (e.g. \"1小时前\")`\n- Example: `fix(en): support 'of' connector in weekday postfix`\n\n### Pre-commit Formatting\nRun the formatter before staging by executing:\n```bash\nnpm run prettier\n```\n*Note: Git commit runs `npm run prettier` and `npm run test:silent` automatically as a pre-commit hook.*\n\n---\n\n## AI Agent Tool & Command Guidelines\n\nTo ensure secure, auditable, and standard operations:\n- **Network Requests**: Do not run arbitrary commands to execute network calls. Use sandboxed tools or curl commands if external documentation is needed.\n- **Verification**: Always run `npm test` inside the workspace directory rather than trying to run temporary JS code blocks elsewhere to verify behaviors.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# Agent Documentation - Project Setup & Architecture\n\nThis document provides a guide for AI agents working on `chrono` (chrono-node) to quickly understand the project context, layout, testing commands, and implementation constraints.\n\n## Project Overview\n`chrono` is a natural language date parser written in JavaScript/TypeScript. It extracts dates, times, and relative date expressions from free text.\n\n---\n\n## Technical Stack & Setup\n- **Language**: TypeScript / JavaScript (ES6 Modules and CommonJS outputs)\n- **Dependency Manager**: `npm`\n- **Testing Framework**: `jest`\n\n### Running Tests\nTo run the full test suite, execute:\n```bash\nnpm test\n```\nTo run tests silently:\n```bash\nnpm run test:silent\n```\n\n---\n\n## Directory Structure & Architecture\n\n```\nsrc/\n├── index.ts              # Main entry point and locale shortcut exports\n├── chrono.ts             # Main orchestrator class (Chrono, Parser, Refiner, Configuration)\n├── results.ts            # Core result models (ParsingResult, ParsingComponents)\n├── types.ts              # Global type definitions (ParsedResult, ParsingOption, ParsingReference)\n├── calculation/          # Arithmetic helpers (duration, weekdays)\n├── common/               # Locale-agnostic base parsers and refiners\n├── locales/              # Language-specific configurations, parsers, and refiners\n│   ├── de/\n│   ├── en/\n│   ├── zh/\n│   │   ├── hans/\n│   │   └── hant/\n│   └── ...\n└── utils/                # General utility functions\n```\n\n### Core Concepts\n1. **Parsers (`Parser`)**:\n   Implement `innerPattern()` to return the regular expression pattern, and `innerExtract(context, match)` to process matching strings and return a `ParsingResult`.\n2. **Refiners (`Refiner`)**:\n   Post-process and merge/filter the parsed results (e.g., merging separate date and time components, or resolving overlapping date ranges).\n3. **ParsingComponents (`ParsingComponents`)**:\n   Stores date and time elements (e.g., year, month, day, hour). Elements are marked as either explicitly assigned (`assign`) or implied (`imply`).\n\n---\n\n## Key Context & Caveats\n\n1. **Modular Parsers**:\n   Avoid overloading a single parser with multiple disparate concepts (e.g. mixing \"after/within\" with \"ago/before\"). Instead, introduce distinct, small parsers for each concern (e.g., `ZHHansDeadlineFormatParser` and `ZHHansAgoFormatParser`).\n\n2. **Locale Symmetry & Chinese (zh) Special Case**:\n   - The Chinese locale is a special case where we want Simplified (`zh.hans`) and Traditional (`zh.hant`) components to remain exactly synchronized. When implementing a parser/refiner or a test for Simplified Chinese (`zh.hans`), always implement the equivalent for Traditional Chinese (`zh.hant`) if relevant, translating characters accordingly (e.g., `几` vs `幾`, `个` vs `個`, `钟` vs `鐘`).\n   - English (`en`) is the most advanced locale in the library. Other locales are modeled after English but often lag behind.\n\n3. **Relative Date Arithmetic**:\n   Use helpers from `src/calculation/duration.ts` such as `addDuration` and `reverseDuration` to perform date calculations. When handling \"ago/before\" expressions, calculate the positive duration first, then reverse it using `reverseDuration`.\n\n4. **Abstract Parsers**:\n   Inherit from `AbstractParserWithWordBoundaryChecking` (or `AbstractParserWithLeftBoundaryChecking`) to inherit word boundary detection and clean regex boundary matching.\n\n5. **Testing Conventions**:\n   - Always pass a clear reference date (`refDate`) to `testSingleCase` to ensure deterministic execution of relative time tests.\n   - Assert the matched index (`result.index`) and text boundaries (`result.text`) to check for correct extraction when the text is embedded within sentences.\n   - The `result.index` check can be skipped if it is trivial (e.g., the input string is exactly equal to the expected matched text `result.text`).\n   - The `result.text` check may also be intentionally omitted on vague edge cases.\n\n---\n\n## Git & Commit Message Format\n\nFollow the Conventional Commits specification:\n```\n<type>(<scope>): <description>\n```\n- Example: `feat(zh): support past-tense relative time expressions (e.g. \"1小时前\")`\n- Example: `fix(en): support 'of' connector in weekday postfix`\n\n### Pre-commit Formatting\nRun the formatter before staging by executing:\n```bash\nnpm run prettier\n```\n*Note: Git commit runs `npm run prettier` and `npm run test:silent` automatically as a pre-commit hook.*\n\n---\n\n## AI Agent Tool & Command Guidelines\n\nTo ensure secure, auditable, and standard operations:\n- **Network Requests**: Do not run arbitrary commands to execute network calls. Use sandboxed tools or curl commands if external documentation is needed.\n- **Verification**: Always run `npm test` inside the workspace directory rather than trying to run temporary JS code blocks elsewhere to verify behaviors.\n","category":"root","tokens":1209}]}