@aurorajs.dev/catalyst-cli 3.1.2 → 3.1.3
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 +1 -1
- package/dist/ai/domain/skills-scanner.js +7 -2
- package/dist/deploy/domain/curl-config.js +1 -1
- package/dist/deploy/domain/playbook-vars.js +1 -1
- package/dist/generator/domain/frontend-composition.js +4 -4
- package/dist/generator/domain/property-filters.d.ts +8 -0
- package/dist/generator/domain/property-filters.js +17 -6
- package/dist/generator/handlers/front.handler.js +10 -1
- package/dist/sheets/domain/auth.js +10 -5
- package/dist/sheets/sync/sheet-to-yaml.d.ts +1 -0
- package/dist/sheets/sync/sheet-to-yaml.js +19 -3
- package/dist/templates/backend/application/.claude/skills/catalyst-tools/SKILL.md +5 -3
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-catalog-section-reader.spec.ts +4 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.spec.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/application/manual-find-index.handler.ts +2 -1
- package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual-section-reader.port.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual.types.ts +2 -0
- package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual-graphql-schema.spec.ts +10 -2
- package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual.graphql +4 -0
- package/dist/templates/backend/business-rules/business-partner-portal/supplier-document.md +96 -6
- package/dist/templates/backend/business-rules/tools/assistant-usage.md +60 -0
- package/dist/templates/backend/manual/business-partner-portal/CONTEXT.md +5 -5
- package/dist/templates/backend/manual/business-partner-portal/en/purchase-invoice-header.md +5 -1
- package/dist/templates/backend/manual/business-partner-portal/es/purchase-invoice-header.md +5 -1
- package/dist/templates/backend/manual/production-planning/en/planner.md +1 -1
- package/dist/templates/backend/manual/production-planning/en/production-order-position-event.md +8 -5
- package/dist/templates/backend/manual/production-planning/es/planner.md +1 -1
- package/dist/templates/backend/manual/production-planning/es/production-order-position-event.md +8 -5
- package/dist/templates/backend/manual/reporting/en/report.md +40 -0
- package/dist/templates/backend/manual/reporting/es/report.md +40 -0
- package/dist/templates/backend/manual/tools/CONTEXT.md +1 -0
- package/dist/templates/backend/manual/tools/actions.yaml +11 -0
- package/dist/templates/backend/manual/tools/en/assistant-conversation.md +38 -0
- package/dist/templates/backend/manual/tools/en/assistant-usage-policy.md +46 -0
- package/dist/templates/backend/manual/tools/en/assistant-usage.md +28 -0
- package/dist/templates/backend/manual/tools/en/file-storage.md +83 -0
- package/dist/templates/backend/manual/tools/es/assistant-conversation.md +38 -0
- package/dist/templates/backend/manual/tools/es/assistant-usage-policy.md +46 -0
- package/dist/templates/backend/manual/tools/es/assistant-usage.md +28 -0
- package/dist/templates/backend/manual/tools/es/file-storage.md +83 -0
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/infrastructure/business-partner-portal-anthropic-extraction-step-two.service.spec.ts +2 -1
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts +9 -2
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.ts +6 -3
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts +19 -2
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.ts +15 -2
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-map-step-one-answer.function.ts +1 -1
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/anthropic/shared/types/business-partner-portal-anthropic-step-one-answer.types.ts +1 -1
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts +63 -0
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.ts +25 -3
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-empty.service.spec.ts +1 -0
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two.types.ts +5 -0
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts +1 -1
- package/dist/templates/backend/packages/business-partner-portal/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.ts +1 -1
- package/dist/templates/backend/packages/production-planning/src/@app/production-planning/production-order-position/application/get-processes/production-planning-get-processes-production-order-position.handler.spec.ts +5 -2
- package/dist/templates/backend/packages/production-planning/src/@app/production-planning/production-order-position/application/get-processes/production-planning-get-processes-production-order-position.handler.ts +4 -0
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-create-report.dto.ts +0 -21
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-report.dto.ts +3 -3
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-report-by-id.dto.ts +0 -48
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/dto/reporting-update-reports.dto.ts +0 -48
- package/dist/templates/backend/packages/reporting/src/@api/reporting/report/graphql/reporting-report.graphql +3 -20
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/create/reporting-create-report.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/reporting-report.payload-types.ts +33 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.handler.spec.ts +77 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-report-by-id.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update/reporting-update-reports.service.ts +2 -2
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/application/update-execution-cache/reporting-update-report-execution-cache.handler.spec.ts +35 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/domain/reporting-report.field-schema.ts +7 -0
- package/dist/templates/backend/packages/reporting/src/@app/reporting/report/index.ts +5 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-assistant-conversation.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversation-by-id.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/dto/tools-update-assistant-conversations.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-conversation/graphql/tools-assistant-conversation.graphql +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/controllers/tools-ask-assistant-assistant-usage.controller.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-ask-assistant.dto.ts +47 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-answer.dto.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-assistant-usage.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usage-by-id.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/dto/tools-update-assistant-usages.dto.ts +8 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/graphql/tools-assistant-usage.graphql +45 -1
- package/dist/templates/backend/packages/tools/src/@api/tools/assistant-usage/resolvers/tools-ask-assistant-assistant-usage.resolver.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/infrastructure/tools-anthropic-assistant-model.service.spec.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts +145 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.ts +44 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/anthropic/shared/types/tools-anthropic-assistant-answer.types.ts +3 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/domain/tools-assistant-conversation.field-schema.ts +6 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-conversation/infrastructure/drizzle/tools-drizzle-assistant-conversation.schema.ts +1 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.spec.ts +105 -5
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.ts +40 -23
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-errors.function.ts +8 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.spec.ts +257 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.ts +200 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.spec.ts +7 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/application/quota/tools-assistant-quota.service.ts +7 -2
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-model.port.ts +44 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/domain/tools-assistant-usage.field-schema.ts +6 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.spec.ts +25 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.repository.ts +3 -0
- package/dist/templates/backend/packages/tools/src/@app/tools/assistant-usage/infrastructure/drizzle/tools-drizzle-assistant-usage.schema.ts +1 -0
- package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-ask.e2e-spec.ts +16 -1
- package/dist/templates/backend/packages/tools/test/acceptance/tools/assistant-usage-increment.e2e-spec.ts +52 -5
- package/dist/templates/codegen/frontend/module/__module_name__/features/__module_name__-list.component.ts.eta +7 -1
- package/dist/templates/codegen/frontend/module/__module_name__/features/index.ts.eta +1 -1
- package/dist/templates/frontend/application/.claude/skills/catalyst-project-structure/SKILL.md +3 -0
- package/dist/templates/frontend/application/libs/ui/command/src/lib/hlm-command-item.ts +1 -1
- package/dist/templates/frontend/application/src/@aurora/modules/assisted-form/README.md +2 -0
- package/dist/templates/frontend/application/src/@aurora/modules/command-palette/command-palette-trigger.component.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/README.md +4 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.spec.ts +69 -0
- package/dist/templates/frontend/application/src/@aurora/modules/guided-action/guided-action-runner.service.ts +13 -4
- package/dist/templates/frontend/application/src/@aurora/modules/index.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/manual/manual.graphql.ts +1 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/README.md +36 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/index.ts +2 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.spec.ts +137 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.service.ts +60 -0
- package/dist/templates/frontend/application/src/@aurora/modules/screen-context/screen-context.types.ts +47 -0
- package/dist/templates/frontend/application/src/app/domains/admin/layout/site-header.ts +1 -1
- package/dist/templates/frontend/application/tsconfig.json +1 -0
- package/dist/templates/frontend/navigation-i18n/reporting/en.json +1 -1
- package/dist/templates/frontend/navigation-i18n/reporting/es.json +1 -1
- package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/index.ts +0 -1
- package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/state-machine-history-list.component.ts +0 -13
- package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/en.json +11 -0
- package/dist/templates/frontend/packages/business-partner-portal/public/i18n/business-partner-portal/es.json +11 -0
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review-context.derive.spec.ts +420 -0
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review-context.derive.ts +237 -0
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.spec.ts +181 -26
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/data-access/purchase-invoice-review.derive.ts +143 -25
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-detail.component.spec.ts +42 -0
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-detail.component.ts +32 -8
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-form.component.ts +32 -1
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/features/purchase-invoice-header-list-actions-cell.component.ts +4 -1
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/ui/purchase-invoice-breakdown.component.ts +7 -32
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-header/ui/purchase-invoice-lines-grid.component.ts +12 -8
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/index.ts +0 -1
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/purchase-invoice-trace-list.component.ts +0 -13
- package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.spec.ts +26 -1
- package/dist/templates/frontend/packages/identity/src/app/domains/admin/apps/iam/account/features/account-form.component.ts +45 -0
- package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/en.json +15 -4
- package/dist/templates/frontend/packages/production-planning/public/i18n/production-planning/es.json +15 -4
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/index.ts +1 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.spec.ts +57 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner-process-weights.derive.ts +39 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.spec.ts +15 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.derive.ts +7 -3
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/data-access/planner.graphql.ts +23 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner-process-weights-dialog.component.ts +137 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/planner/features/planner.component.ts +41 -4
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.derive.spec.ts +0 -30
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.derive.ts +0 -21
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.resolvers.spec.ts +24 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/data-access/production-dashboard.resolvers.ts +3 -1
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/batch-detail-sheet.component.ts +22 -10
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-form-sheet.component.spec.ts +142 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-form-sheet.component.ts +95 -59
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/event-list.component.ts +121 -123
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-dashboard/features/production-dashboard.component.ts +52 -19
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position/features/production-order-position-list.component.ts +8 -2
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/features/production-order-position-event-list.component.ts +4 -0
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/production-order-position-event.columns.spec.ts +104 -4
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/production-order-position-event/production-order-position-event.columns.ts +121 -69
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/finish-event-dialog.component.ts +3 -3
- package/dist/templates/frontend/packages/production-planning/src/app/domains/admin/apps/production-planning/shared/dialogs/weight-input-dialog.component.ts +3 -3
- package/dist/templates/frontend/packages/reporting/public/i18n/reporting/en.json +1 -1
- package/dist/templates/frontend/packages/reporting/public/i18n/reporting/es.json +1 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.detail-config.ts +1 -2
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/data-access/report.graphql.ts +0 -14
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.spec.ts +96 -0
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-form.component.ts +46 -69
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/features/report-list.component.ts +2 -22
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/report/report.columns.ts +0 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting-icons.providers.ts +2 -1
- package/dist/templates/frontend/packages/reporting/src/app/domains/admin/apps/reporting/reporting.navigation.ts +7 -0
- package/dist/templates/frontend/packages/tools/public/i18n/tools/en.json +4 -2
- package/dist/templates/frontend/packages/tools/public/i18n/tools/es.json +4 -2
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts +82 -7
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.ts +12 -2
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/assistant-conversation.columns.ts +13 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/data-access/assistant-conversation.graphql.ts +1 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-form.component.ts +18 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list.component.ts +0 -13
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/index.ts +0 -1
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/assistant-usage.columns.ts +13 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/data-access/assistant-usage.graphql.ts +2 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-form.component.ts +18 -0
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list.component.ts +0 -13
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/index.ts +0 -1
- package/dist/templates/monorepo/.claude/commands/business-rules/promote.md +5 -1
- package/dist/templates/monorepo/.claude/hooks/__fixtures__/br-hr-regression-baseline.txt +2 -2
- package/dist/templates/monorepo/.claude/hooks/check-required-setup.ts +4 -4
- package/dist/templates/monorepo/.claude/hooks/inject-prompt-context.ts +1 -1
- package/dist/templates/monorepo/.claude/scripts/generate-skills-index.test.ts +29 -1
- package/dist/templates/monorepo/.claude/scripts/generate-skills-index.ts +7 -1
- package/dist/templates/monorepo/.claude/skills/REGISTRY.md +2 -2
- package/dist/templates/monorepo/.claude/skills/catalyst-backlog/SKILL.md +19 -4
- package/dist/templates/monorepo/.claude/skills/catalyst-backlog/frontier-worker-addendum.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/SKILL.md +8 -5
- package/dist/templates/monorepo/.claude/skills/catalyst-business-rules-guard/references/workflow.md +10 -6
- package/dist/templates/monorepo/.claude/skills/catalyst-delegation/SKILL.md +1 -1
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/SKILL.md +6 -6
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/enforcement.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-harness-rules-guard/references/format.md +3 -3
- package/dist/templates/monorepo/.claude/skills/catalyst-update-skill-registry/SKILL.md +4 -4
- package/dist/templates/monorepo/.claude/skills/catalyst-user-manual/SKILL.md +48 -2
- package/dist/templates/monorepo/.claude/skills/openspec-apply-change/SKILL.md +28 -10
- package/dist/templates/monorepo/.claude/skills/openspec-archive-change/SKILL.md +52 -13
- package/dist/templates/monorepo/.claude/skills/openspec-explore/SKILL.md +59 -14
- package/dist/templates/monorepo/.claude/skills/openspec-propose/SKILL.md +38 -12
- package/dist/templates/monorepo/.claude/skills/openspec-sync-specs/SKILL.md +31 -3
- package/dist/templates/monorepo/CLAUDE.md +14 -14
- package/dist/templates/monorepo/docs/business-rules/ARCHITECTURE.md +16 -13
- package/dist/templates/monorepo/docs/business-rules/MIGRATION.md +5 -5
- package/dist/templates/monorepo/docs/manual/en/04-asistente.md +71 -0
- package/dist/templates/monorepo/docs/manual/es/04-asistente.md +71 -0
- package/dist/templates/monorepo/openspec/config.yaml +25 -5
- package/dist/templates/monorepo/package.json +3 -1
- package/dist/templates/monorepo/scripts/backlog/prompt.test.ts +5 -5
- package/dist/templates/monorepo/scripts/backlog/prompt.ts +1 -1
- package/dist/templates/monorepo/scripts/business-rules/audit.ts +1 -1
- package/dist/templates/monorepo/scripts/manual/compile.test.ts +78 -0
- package/dist/templates/monorepo/scripts/manual/compile.ts +36 -9
- package/dist/templates/monorepo/scripts/worktree/prune.test.ts +517 -0
- package/dist/templates/monorepo/scripts/worktree/prune.ts +331 -0
- package/oclif.manifest.json +85 -85
- package/package.json +15 -17
- package/dist/templates/frontend/packages/automation/src/app/domains/admin/apps/automation/state-machine-history/features/state-machine-history-list-actions-cell.component.ts +0 -44
- package/dist/templates/frontend/packages/business-partner-portal/src/app/domains/admin/apps/business-partner-portal/purchase-invoice-trace/features/purchase-invoice-trace-list-actions-cell.component.ts +0 -44
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-conversation/features/assistant-conversation-list-actions-cell.component.ts +0 -44
- package/dist/templates/frontend/packages/tools/src/app/domains/admin/apps/tools/assistant-usage/features/assistant-usage-list-actions-cell.component.ts +0 -43
- package/dist/templates/monorepo/.claude/commands/opsx/apply.md +0 -184
- package/dist/templates/monorepo/.claude/commands/opsx/archive.md +0 -225
- package/dist/templates/monorepo/.claude/commands/opsx/explore.md +0 -196
- package/dist/templates/monorepo/.claude/commands/opsx/propose.md +0 -145
- package/dist/templates/monorepo/.claude/commands/opsx/sync.md +0 -258
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ $ npm install -g @aurorajs.dev/catalyst-cli
|
|
|
41
41
|
$ catalyst COMMAND
|
|
42
42
|
running command...
|
|
43
43
|
$ catalyst (--version)
|
|
44
|
-
@aurorajs.dev/catalyst-cli/3.1.
|
|
44
|
+
@aurorajs.dev/catalyst-cli/3.1.3 darwin-arm64 node-v26.13.0
|
|
45
45
|
$ catalyst --help [COMMAND]
|
|
46
46
|
USAGE
|
|
47
47
|
$ catalyst COMMAND
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
2
2
|
import { join, relative, sep } from 'node:path';
|
|
3
3
|
const IGNORED_DIRS = new Set(['docs', 'logs', 'scripts']);
|
|
4
4
|
function catOrder(k) {
|
|
@@ -22,7 +22,12 @@ export function scanMdFiles(dir, baseDir) {
|
|
|
22
22
|
const topDir = rel.split(sep)[0];
|
|
23
23
|
if (IGNORED_DIRS.has(topDir))
|
|
24
24
|
continue;
|
|
25
|
-
|
|
25
|
+
// OpenSpec 2.0 installs its skills as directory symlinks into `.agents/skills/`,
|
|
26
|
+
// and `Dirent.isDirectory()` is false for a symlink: stat the target instead.
|
|
27
|
+
const isDir = entry.isSymbolicLink()
|
|
28
|
+
? statSync(fullPath, { throwIfNoEntry: false })?.isDirectory() === true
|
|
29
|
+
: entry.isDirectory();
|
|
30
|
+
if (isDir) {
|
|
26
31
|
results.push(...scanMdFiles(fullPath, baseDir));
|
|
27
32
|
}
|
|
28
33
|
else if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
@@ -6,7 +6,7 @@ const API_PATH = /^[\dA-Za-z][\w./-]*(?:\?[\w.=&-]*)?$/;
|
|
|
6
6
|
/** Escapes a value for a double-quoted string of a curl config file (`\\`, `"`, and control characters). */
|
|
7
7
|
export function escapeCurlConfig(value) {
|
|
8
8
|
return value
|
|
9
|
-
.replaceAll('\\',
|
|
9
|
+
.replaceAll('\\', String.raw `\\`)
|
|
10
10
|
.replaceAll('"', String.raw `\"`)
|
|
11
11
|
.replaceAll('\n', String.raw `\n`)
|
|
12
12
|
.replaceAll('\r', String.raw `\r`)
|
|
@@ -4,13 +4,13 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { deployIdentity } from './deploy-identity.js';
|
|
6
6
|
import { assertDeployKeyEntry } from './deploy-key.js';
|
|
7
|
+
const identityOf = (environment) => deployIdentity(environment.project.name, environment.name);
|
|
7
8
|
function buildBackupVars(target, destination) {
|
|
8
9
|
const scheduled = target.environments.filter((environment) => environment.backups);
|
|
9
10
|
const unscheduled = target.environments.filter((environment) => !environment.backups);
|
|
10
11
|
// One aurora.yaml is one project: every environment of the server carries the same name.
|
|
11
12
|
const [first] = scheduled;
|
|
12
13
|
const knownHosts = destination?.type === 'sftp' && first ? [{ line: destination.hostKey, project: first.project.name }] : [];
|
|
13
|
-
const identityOf = (environment) => deployIdentity(environment.project.name, environment.name);
|
|
14
14
|
/* eslint-disable camelcase -- Ansible variable names are snake_case */
|
|
15
15
|
return {
|
|
16
16
|
backup_known_hosts: knownHosts,
|
|
@@ -108,6 +108,10 @@ ${entries} {
|
|
|
108
108
|
] satisfies Routes;
|
|
109
109
|
`;
|
|
110
110
|
}
|
|
111
|
+
const section = (key, boundedContexts, projectKey) => arrayProperty(INDENT, key, [
|
|
112
|
+
...boundedContexts.map((boundedContext) => `...${toCamelCase(boundedContext)}Navigation`),
|
|
113
|
+
`...projectNavigation.${projectKey}`,
|
|
114
|
+
], ' satisfies NavItem[]');
|
|
111
115
|
/** `navigation-data.ts`: each sidebar section and the icons of every navigation entry. */
|
|
112
116
|
export function generateNavigationData(manifests) {
|
|
113
117
|
const ordered = orderPackageManifests(manifests);
|
|
@@ -126,10 +130,6 @@ export function generateNavigationData(manifests) {
|
|
|
126
130
|
imports.add(`./apps/${kebab}`, `${camel}Navigation`);
|
|
127
131
|
imports.add(`./apps/${kebab}/${kebab}-icons.providers`, `${camel}Icons`);
|
|
128
132
|
}
|
|
129
|
-
const section = (key, boundedContexts, projectKey) => arrayProperty(INDENT, key, [
|
|
130
|
-
...boundedContexts.map((boundedContext) => `...${toCamelCase(boundedContext)}Navigation`),
|
|
131
|
-
`...projectNavigation.${projectKey}`,
|
|
132
|
-
], ' satisfies NavItem[]');
|
|
133
133
|
const icons = [
|
|
134
134
|
...iconContexts.map((boundedContext) => `${INDENT}...${toCamelCase(boundedContext)}Icons,\n`),
|
|
135
135
|
`${INDENT}...projectNavigationIcons,\n`,
|
|
@@ -386,6 +386,14 @@ export declare function isFormComponentEmitted(schema: ExcludedOperationsSource
|
|
|
386
386
|
* and its routes all depend on it.
|
|
387
387
|
*/
|
|
388
388
|
export declare function isDetailAvailable(schema: ExcludedOperationsSource): boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Whether the row actions menu has at least one entry: `deleteById`, or
|
|
391
|
+
* `updateById` with the detail side available (Edit opens it). The list
|
|
392
|
+
* template, the file planner and the features barrel share this predicate for
|
|
393
|
+
* the actions column, `<mod>-list-actions-cell.component.ts` and its export.
|
|
394
|
+
* The cell template keeps its own two gates to hide each item.
|
|
395
|
+
*/
|
|
396
|
+
export declare function hasRowActions(schema: ExcludedOperationsSource): boolean;
|
|
389
397
|
/**
|
|
390
398
|
* Whether `<mod>-list.component.ts` is emitted. `<MOD>_LIST_CONFIG` omits
|
|
391
399
|
* `queryPagination` when `paginate` is excluded from the `ui` layer, and
|
|
@@ -76,7 +76,7 @@ export const hasTimestampProperties = (props) => props
|
|
|
76
76
|
.some((p) => p.type === 'timestamp');
|
|
77
77
|
export const hasIndexProperties = (props) => props?.some((p) => (p.index === 'index' || p.index === 'unique') && !p.isI18n);
|
|
78
78
|
export const hasIndexI18nProperties = (props) => props?.some((p) => (p.index === 'index' || p.index === 'unique') && p.isI18n);
|
|
79
|
-
export const hasPivotProperties = (props) => props?.some(isPivot);
|
|
79
|
+
export const hasPivotProperties = (props) => props?.some((p) => isPivot(p));
|
|
80
80
|
export const hasCompositePrimaryKeys = (props) => props.filter((p) => p.primaryKey).length > 1;
|
|
81
81
|
/**
|
|
82
82
|
* True when at least one property owns a physical FK column — many-to-one or
|
|
@@ -87,10 +87,10 @@ export const hasCompositePrimaryKeys = (props) => props.filter((p) => p.primaryK
|
|
|
87
87
|
*/
|
|
88
88
|
export const hasDrizzleForeignKeyColumnProperties = (props) => props?.some((p) => (isDrizzleColumn(p) && p.relationship?.type === 'one-to-one') ||
|
|
89
89
|
(isDrizzleColumn(p) && p.relationship?.type === 'many-to-one'));
|
|
90
|
-
export const hasDrizzleManyToManyRelationProperties = (props) => props?.some(isDrizzleManyToManyRelation);
|
|
91
|
-
export const hasDrizzleManyRelationProperties = (props) => props?.some(isDrizzleManyRelation);
|
|
92
|
-
export const hasDrizzleOneRelationInverseProperties = (props) => props?.some(isDrizzleOneRelationInverse);
|
|
93
|
-
export const hasDrizzleOneRelationOwnerProperties = (props) => props?.some(isDrizzleOneRelationOwner);
|
|
90
|
+
export const hasDrizzleManyToManyRelationProperties = (props) => props?.some((p) => isDrizzleManyToManyRelation(p));
|
|
91
|
+
export const hasDrizzleManyRelationProperties = (props) => props?.some((p) => isDrizzleManyRelation(p));
|
|
92
|
+
export const hasDrizzleOneRelationInverseProperties = (props) => props?.some((p) => isDrizzleOneRelationInverse(p));
|
|
93
|
+
export const hasDrizzleOneRelationOwnerProperties = (props) => props?.some((p) => isDrizzleOneRelationOwner(p));
|
|
94
94
|
export const getI18nProperties = (props) => props?.filter((p) => p.isI18n);
|
|
95
95
|
/**
|
|
96
96
|
* `getI18nProperties` minus masked-on-read types (`password`/`secret`/`encrypted`) — the queryable
|
|
@@ -212,7 +212,7 @@ export const getWithRelationshipManyToOneProperties = (props) => props?.filter((
|
|
|
212
212
|
*/
|
|
213
213
|
export const isForeignKeyRelationshipProperty = (p) => p.relationship?.type === 'many-to-one' ||
|
|
214
214
|
(p.relationship?.type === 'one-to-one' && Boolean(p.relationship.field));
|
|
215
|
-
export const getWithForeignKeyRelationshipProperties = (props) => props?.filter(isForeignKeyRelationshipProperty);
|
|
215
|
+
export const getWithForeignKeyRelationshipProperties = (props) => props?.filter((p) => isForeignKeyRelationshipProperty(p));
|
|
216
216
|
export const hasForeignKeyRelationshipProperties = (props) => Boolean(getWithForeignKeyRelationshipProperties(props)?.length);
|
|
217
217
|
export const getWithRelationshipOneToManyProperties = (props) => props?.filter((p) => p.relationship?.type === 'one-to-many');
|
|
218
218
|
export const getPrimaryKeyPropertiesFromPivotTable = (props) => hasPivotProperties(props) ? getPrimaryKeyProperties(props) : [];
|
|
@@ -695,6 +695,17 @@ export function isFormComponentEmitted(schema) {
|
|
|
695
695
|
export function isDetailAvailable(schema) {
|
|
696
696
|
return !isOperationExcluded(schema, 'findById', 'ui');
|
|
697
697
|
}
|
|
698
|
+
/**
|
|
699
|
+
* Whether the row actions menu has at least one entry: `deleteById`, or
|
|
700
|
+
* `updateById` with the detail side available (Edit opens it). The list
|
|
701
|
+
* template, the file planner and the features barrel share this predicate for
|
|
702
|
+
* the actions column, `<mod>-list-actions-cell.component.ts` and its export.
|
|
703
|
+
* The cell template keeps its own two gates to hide each item.
|
|
704
|
+
*/
|
|
705
|
+
export function hasRowActions(schema) {
|
|
706
|
+
return (!isOperationExcluded(schema, 'deleteById', 'ui') ||
|
|
707
|
+
(!isOperationExcluded(schema, 'updateById', 'ui') && isDetailAvailable(schema)));
|
|
708
|
+
}
|
|
698
709
|
/**
|
|
699
710
|
* Whether `<mod>-list.component.ts` is emitted. `<MOD>_LIST_CONFIG` omits
|
|
700
711
|
* `queryPagination` when `paginate` is excluded from the `ui` layer, and
|
|
@@ -7,7 +7,7 @@ import { join } from 'node:path';
|
|
|
7
7
|
import { APP_CONTAINER, DASHBOARD_CONTAINER, DASHBOARD_TRANSLATIONS, DETAIL_MODE, } from '../domain/config.js';
|
|
8
8
|
import { buildPivotSchema } from '../domain/model.js';
|
|
9
9
|
import { getStandardOperationNames } from '../domain/operation-names.js';
|
|
10
|
-
import { getAdditionalApiMutations, getAdditionalApiQueries, getFormDetailFieldsProperties, getManyToManyRelationshipProperties, getMixedFormTabIds, getPivotFrontendExcludedFiles, getPivotFrontendKeptFiles, hasFormTabsProperties, hasI18nProperties, isAllowFile, isDetailAvailable, isDetailComponentEmitted, isFormComponentEmitted, isListComponentEmitted, isOperationExcluded, isRelationSectionProperty, } from '../domain/property-filters.js';
|
|
10
|
+
import { getAdditionalApiMutations, getAdditionalApiQueries, getFormDetailFieldsProperties, getManyToManyRelationshipProperties, getMixedFormTabIds, getPivotFrontendExcludedFiles, getPivotFrontendKeptFiles, hasFormTabsProperties, hasI18nProperties, hasRowActions, isAllowFile, isDetailAvailable, isDetailComponentEmitted, isFormComponentEmitted, isListComponentEmitted, isOperationExcluded, isRelationSectionProperty, } from '../domain/property-filters.js';
|
|
11
11
|
import { loadSchema } from '../domain/schema-loader.js';
|
|
12
12
|
import { WidgetType } from '../domain/widget-type.js';
|
|
13
13
|
import { CodeWriter } from '../engine/code-writer/code-writer.js';
|
|
@@ -120,6 +120,15 @@ export async function generateModuleFiles(ctx, result) {
|
|
|
120
120
|
`${modKebab}-list.component.ts`,
|
|
121
121
|
];
|
|
122
122
|
}
|
|
123
|
+
// With neither row action the actions column is not emitted, so the cell
|
|
124
|
+
// component would be dead. The list template and the barrel consume the same
|
|
125
|
+
// predicate.
|
|
126
|
+
if (!hasRowActions(schema)) {
|
|
127
|
+
options.excludedFiles = [
|
|
128
|
+
...(options.excludedFiles ?? []),
|
|
129
|
+
`${modKebab}-list-actions-cell.component.ts`,
|
|
130
|
+
];
|
|
131
|
+
}
|
|
123
132
|
// Dialog mode has no detail shell, so the predicate is false there too.
|
|
124
133
|
if (!isDetailComponentEmitted(schema)) {
|
|
125
134
|
options.excludedFiles = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { config as dotenvConfig } from 'dotenv';
|
|
2
|
-
import {
|
|
2
|
+
import { JWT } from 'google-auth-library';
|
|
3
3
|
import { google } from 'googleapis';
|
|
4
4
|
import { createRateLimitSpinnerNotifier, createSheetsRetryConfig } from './retry.js';
|
|
5
5
|
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets'];
|
|
@@ -29,10 +29,15 @@ export async function initializeSheetsApi(onRateLimitWait) {
|
|
|
29
29
|
'Then run: aurora env decrypt (if using SOPS)');
|
|
30
30
|
}
|
|
31
31
|
const credentials = JSON.parse(Buffer.from(base64Credentials, 'base64').toString());
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
// Building the client by type, instead of handing the parsed JSON to
|
|
33
|
+
// GoogleAuth, stops a credential of another type from being loaded.
|
|
34
|
+
// `fromJSON` checks client_email and private_key and keeps the key id,
|
|
35
|
+
// projects and universe of the key, as the GoogleAuth path did.
|
|
36
|
+
if (credentials.type !== 'service_account') {
|
|
37
|
+
throw new Error('GOOGLE_SERVICE_ACCOUNT must hold a service account key (type "service_account").');
|
|
38
|
+
}
|
|
39
|
+
const auth = new JWT({ scopes: SCOPES });
|
|
40
|
+
auth.fromJSON(credentials);
|
|
36
41
|
// The retry policy rides on the client options, so EVERY call of every
|
|
37
42
|
// sheets command inherits it — no per-call wrapping in the sync layer.
|
|
38
43
|
return google.sheets({
|
|
@@ -34,6 +34,7 @@ export declare function splitSheetRows(rows: string[][]): {
|
|
|
34
34
|
pivots: Map<string, AuroraPivot>;
|
|
35
35
|
propertyRows: string[][];
|
|
36
36
|
};
|
|
37
|
+
export declare function normalizeYamlForComparison(content: string): string;
|
|
37
38
|
/** Merge a YAML property with the same property pulled from the sheet, honoring sheet-controlled fields. */
|
|
38
39
|
/**
|
|
39
40
|
* Fold one sheet row over the property as it stands in the YAML. Only the fields
|
|
@@ -70,7 +70,6 @@ export async function pullBoundedContext(context, options = {}) {
|
|
|
70
70
|
lineWidth: 500,
|
|
71
71
|
noRefs: true,
|
|
72
72
|
quoteStyle: 'double',
|
|
73
|
-
sortKeys: false,
|
|
74
73
|
});
|
|
75
74
|
yamlContent = convertArraysToInlineFormat(yamlContent);
|
|
76
75
|
if (existingYamlContent && existingSchema) {
|
|
@@ -534,14 +533,31 @@ function normalizeText(text) {
|
|
|
534
533
|
return '';
|
|
535
534
|
return text.replaceAll(/\s+/g, ' ').trim();
|
|
536
535
|
}
|
|
537
|
-
function
|
|
536
|
+
function mappingKeyText(key) {
|
|
537
|
+
return key.kind === 'scalar' ? String(key.value) : '';
|
|
538
|
+
}
|
|
539
|
+
export function normalizeYamlForComparison(content) {
|
|
538
540
|
try {
|
|
539
541
|
const parsed = jsYaml.load(content);
|
|
540
542
|
return jsYaml.dump(parsed, {
|
|
541
543
|
indent: 2,
|
|
542
544
|
lineWidth: -1,
|
|
543
545
|
noRefs: true,
|
|
544
|
-
sortKeys: true
|
|
546
|
+
// Same order as the deprecated `sortKeys: true`: code-unit comparison of
|
|
547
|
+
// the stringified key, non-scalar keys sorting as ''. NOT `localeCompare`.
|
|
548
|
+
transform(documents) {
|
|
549
|
+
jsYaml.visit(documents, (node) => {
|
|
550
|
+
if (node.kind !== 'mapping')
|
|
551
|
+
return;
|
|
552
|
+
node.items.sort((a, b) => {
|
|
553
|
+
const x = mappingKeyText(a.key);
|
|
554
|
+
const y = mappingKeyText(b.key);
|
|
555
|
+
if (x < y)
|
|
556
|
+
return -1;
|
|
557
|
+
return x > y ? 1 : 0;
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
},
|
|
545
561
|
});
|
|
546
562
|
}
|
|
547
563
|
catch {
|
|
@@ -795,9 +795,11 @@ not read at boot, so a project that never turns the assistant on boots without i
|
|
|
795
795
|
variable fails that question as a provider error, with no provider call and no usage recorded.
|
|
796
796
|
|
|
797
797
|
**Write the ledger: the atomic `increment`.** `ToolsDrizzleAssistantUsageRepository.increment({
|
|
798
|
-
accountId, period, inputTokens, outputTokens })` is a single `INSERT … ON CONFLICT
|
|
799
|
-
period) DO UPDATE` that adds to the counters, so concurrent records are both counted and a
|
|
800
|
-
creates its row.
|
|
798
|
+
accountId, accountUsername, period, inputTokens, outputTokens })` is a single `INSERT … ON CONFLICT
|
|
799
|
+
(account_id, period) DO UPDATE` that adds to the counters, so concurrent records are both counted and a
|
|
800
|
+
new period creates its row. `accountUsername` is the token account's username, copied as the label of
|
|
801
|
+
the usage list (no `iam` read): the conflict refreshes it, so only the current period's row follows a
|
|
802
|
+
rename. It is the only writer; never update the row by read-modify-write.
|
|
801
803
|
|
|
802
804
|
**Check the quota: `ToolsAssistantQuotaService`** (in `assistant-usage`, exported from
|
|
803
805
|
`@app/tools/assistant-usage/index.js` with the module's services). `check({ accountId, roleIds })`
|
|
@@ -6,6 +6,7 @@ const action = (
|
|
|
6
6
|
permission: string | null,
|
|
7
7
|
prefill: { field: string; options: string[] }[] = [],
|
|
8
8
|
kind: 'open' | 'create' = 'open',
|
|
9
|
+
detailMode?: 'view' | 'dialog',
|
|
9
10
|
) => ({
|
|
10
11
|
id,
|
|
11
12
|
route: `/${id}`,
|
|
@@ -13,6 +14,7 @@ const action = (
|
|
|
13
14
|
label: `Label ${id}`,
|
|
14
15
|
permission,
|
|
15
16
|
prefill,
|
|
17
|
+
...(detailMode ? { detailMode } : {}),
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
const section = (
|
|
@@ -50,6 +52,7 @@ const language: ManualLanguage = {
|
|
|
50
52
|
{ field: 'isUrgent', options: ['true', 'false'] },
|
|
51
53
|
],
|
|
52
54
|
'create',
|
|
55
|
+
'dialog',
|
|
53
56
|
),
|
|
54
57
|
]),
|
|
55
58
|
section('roles', 'iam.role.get'),
|
|
@@ -99,6 +102,7 @@ describe('ManualCatalogSectionReader', () => {
|
|
|
99
102
|
route: '/create-order',
|
|
100
103
|
kind: 'create',
|
|
101
104
|
label: 'Label create-order',
|
|
105
|
+
detailMode: 'dialog',
|
|
102
106
|
prefill: [
|
|
103
107
|
{ field: 'priority', options: ['NORMAL', 'EXPRESS'] },
|
|
104
108
|
{ field: 'isUrgent', options: ['true', 'false'] },
|
|
@@ -16,6 +16,7 @@ const ACTION: ManualActionRecord = {
|
|
|
16
16
|
label: 'Create an account',
|
|
17
17
|
permission: 'iam.account.get',
|
|
18
18
|
prefill: [{ field: 'priority', options: ['NORMAL', 'EXPRESS'] }],
|
|
19
|
+
detailMode: 'view',
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
const entry = (
|
|
@@ -104,6 +105,7 @@ describe('ManualFindIndexHandler', () => {
|
|
|
104
105
|
kind: 'create',
|
|
105
106
|
tourId: 'accounts',
|
|
106
107
|
label: 'Create an account',
|
|
108
|
+
detailMode: 'view',
|
|
107
109
|
},
|
|
108
110
|
],
|
|
109
111
|
});
|
|
@@ -33,12 +33,13 @@ export class ManualFindIndexHandler {
|
|
|
33
33
|
title,
|
|
34
34
|
route,
|
|
35
35
|
tour,
|
|
36
|
-
actions: actions.map(({ id, route, kind, tourId, label }) => ({
|
|
36
|
+
actions: actions.map(({ id, route, kind, tourId, label, detailMode }) => ({
|
|
37
37
|
id,
|
|
38
38
|
route,
|
|
39
39
|
kind,
|
|
40
40
|
tourId,
|
|
41
41
|
label,
|
|
42
|
+
detailMode,
|
|
42
43
|
})),
|
|
43
44
|
}));
|
|
44
45
|
}
|
|
@@ -14,6 +14,8 @@ export interface ManualReadAction {
|
|
|
14
14
|
label: string;
|
|
15
15
|
/** Fields the assistant may fill when it opens this action, with the values each accepts. */
|
|
16
16
|
prefill: { field: string; options: string[] }[];
|
|
17
|
+
/** How the creation form opens; absent when the action declares none. */
|
|
18
|
+
detailMode?: 'view' | 'dialog';
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export interface ManualReadSection {
|
package/dist/templates/backend/application/src/@aurora/modules/manual/domain/manual.types.ts
CHANGED
|
@@ -14,6 +14,8 @@ export interface ManualActionRecord {
|
|
|
14
14
|
permission: string | null;
|
|
15
15
|
/** Fields the assistant may fill with the values each accepts, computed by the compile from the module YAML; empty when nothing is fillable. */
|
|
16
16
|
prefill: ManualPrefillFieldRecord[];
|
|
17
|
+
/** How the creation form opens (`view`: its own page at `<route>/new`; `dialog`: over the list), read by the compile from `front.detailMode`; absent on `open` actions and on routes with no module YAML. */
|
|
18
|
+
detailMode?: 'view' | 'dialog';
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/** Options are wire strings: the enum literals, or `'true'`/`'false'` for a boolean. */
|
|
@@ -39,15 +39,23 @@ describe('manual.graphql', () => {
|
|
|
39
39
|
expect(String(actions.type)).toBe('[ManualIndexAction!]!');
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
it('describes a ManualIndexAction with id, route, kind, label and an optional tourId, and no permission', () => {
|
|
42
|
+
it('describes a ManualIndexAction with id, route, kind, label and an optional tourId and detailMode, and no permission', () => {
|
|
43
43
|
const actionType = schema.getType('ManualIndexAction') as GraphQLObjectType;
|
|
44
44
|
const fields = actionType.getFields();
|
|
45
45
|
|
|
46
|
-
expect(Object.keys(fields).sort()).toEqual([
|
|
46
|
+
expect(Object.keys(fields).sort()).toEqual([
|
|
47
|
+
'detailMode',
|
|
48
|
+
'id',
|
|
49
|
+
'kind',
|
|
50
|
+
'label',
|
|
51
|
+
'route',
|
|
52
|
+
'tourId',
|
|
53
|
+
]);
|
|
47
54
|
expect(String(fields.id.type)).toBe('ID!');
|
|
48
55
|
expect(String(fields.route.type)).toBe('String!');
|
|
49
56
|
expect(String(fields.kind.type)).toBe('String!');
|
|
50
57
|
expect(String(fields.label.type)).toBe('String!');
|
|
51
58
|
expect(String(fields.tourId.type)).toBe('String');
|
|
59
|
+
expect(String(fields.detailMode.type)).toBe('String');
|
|
52
60
|
});
|
|
53
61
|
});
|
package/dist/templates/backend/application/src/@aurora/modules/manual/graphql/manual.graphql
CHANGED
|
@@ -45,6 +45,10 @@ type ManualIndexAction {
|
|
|
45
45
|
Id of the guided tour the action may start; null when it declares none.
|
|
46
46
|
"""
|
|
47
47
|
tourId: String
|
|
48
|
+
"""
|
|
49
|
+
How the creation form opens: `view` (its own page) or `dialog`; null when the action declares none.
|
|
50
|
+
"""
|
|
51
|
+
detailMode: String
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
type ManualIndexChapter {
|
|
@@ -3,7 +3,7 @@ bounded_contexts:
|
|
|
3
3
|
- business-partner-portal
|
|
4
4
|
aggregates:
|
|
5
5
|
- business-partner-portal/supplier-document
|
|
6
|
-
last_updated: 2026-11-
|
|
6
|
+
last_updated: 2026-11-16
|
|
7
7
|
keywords:
|
|
8
8
|
- supplier document
|
|
9
9
|
- documento de proveedor
|
|
@@ -1928,9 +1928,9 @@ La cola de extracción reintenta un job fallido con backoff exponencial; los int
|
|
|
1928
1928
|
|
|
1929
1929
|
| Campo | Valor |
|
|
1930
1930
|
| ---------- | ----- |
|
|
1931
|
-
| Estado | `
|
|
1931
|
+
| Estado | `derogated` |
|
|
1932
1932
|
| Severidad | `blocking` |
|
|
1933
|
-
| Origen | Backlog T-391 (Azure no detectaba los descuentos: 0 de 5 en la medición de doc-15) |
|
|
1933
|
+
| Origen | Backlog T-391 (Azure no detectaba los descuentos: 0 de 5 en la medición de doc-15); derogada por BR-BPP-SUPPLIER-DOCUMENT-030 |
|
|
1934
1934
|
| Trigger en | business-partner-portal/supplier-document (job de extracción) |
|
|
1935
1935
|
| Efecto en | business-partner-portal/purchase-invoice-position (`description`, `quantity`, `unitPrice`, `subtotal`, `positionTotal`), purchase-invoice-position-tax, purchase-invoice-header (`extractedData`) |
|
|
1936
1936
|
|
|
@@ -1952,9 +1952,9 @@ La petición del paso 1 ordena al modelo leer un descuento o una comisión globa
|
|
|
1952
1952
|
|
|
1953
1953
|
### Tests
|
|
1954
1954
|
|
|
1955
|
-
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-
|
|
1956
|
-
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-
|
|
1957
|
-
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-
|
|
1955
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'keeps the commission as a negative line, with its description as printed and its tax'`
|
|
1956
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'passes the tax-inclusive conversion with the negative line: the net amounts add up to the subtotal'`
|
|
1957
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'gives the commission no special treatment: no discount on the header or on the position'`
|
|
1958
1958
|
|
|
1959
1959
|
### Reglas relacionadas
|
|
1960
1960
|
|
|
@@ -1962,4 +1962,94 @@ La petición del paso 1 ordena al modelo leer un descuento o una comisión globa
|
|
|
1962
1962
|
- **BR-BPP-PURCHASE-INVOICE-HEADER-074** — las sumas de la validación de impuestos no tienen término de descuento de cabecera.
|
|
1963
1963
|
- **BR-BPP-PURCHASE-INVOICE-HEADER-018** — la derivación de la revisión suma las líneas tal como están.
|
|
1964
1964
|
|
|
1965
|
+
### Derogación
|
|
1966
|
+
|
|
1967
|
+
Derogada el 2026-11-16 por **BR-BPP-SUPPLIER-DOCUMENT-030** (Backlog T-411).
|
|
1968
|
+
Razón: el anticipo o depósito ya facturado y deducido no se deja fuera de `lines`, porque entonces las líneas no cuadran con la base impresa (factura 105/26 de Euroforum). La regla se conserva para las citas históricas.
|
|
1969
|
+
|
|
1965
1970
|
---
|
|
1971
|
+
|
|
1972
|
+
## BR-BPP-SUPPLIER-DOCUMENT-030 — Sustituye a BR-BPP-SUPPLIER-DOCUMENT-029: un descuento, una comisión global o un anticipo ya facturado y deducido en la factura se lee como una línea más, con importe y precio unitario negativos, su descripción tal como se imprime y su impuesto; una línea negativa no recibe trato especial
|
|
1973
|
+
|
|
1974
|
+
| Campo | Valor |
|
|
1975
|
+
| ---------- | ----- |
|
|
1976
|
+
| Estado | `active` |
|
|
1977
|
+
| Severidad | `blocking` |
|
|
1978
|
+
| Origen | Backlog T-411 (factura 105/26 de Euroforum: el anticipo «PAGO FACTURA DEPOSITO D24/26», al 10 %, −16.625 €, se dejaba fuera de las líneas y la factura daba `TAX_ERROR`); sustituye a BR-BPP-SUPPLIER-DOCUMENT-029 |
|
|
1979
|
+
| Trigger en | business-partner-portal/supplier-document (job de extracción) |
|
|
1980
|
+
| Efecto en | business-partner-portal/purchase-invoice-position (`description`, `quantity`, `unitPrice`, `subtotal`, `positionTotal`), purchase-invoice-position-tax, purchase-invoice-header (`extractedData`) |
|
|
1981
|
+
|
|
1982
|
+
### Enunciado
|
|
1983
|
+
|
|
1984
|
+
La petición del paso 1 ordena al modelo leer un descuento o una comisión global que la factura deduce, y también un anticipo o depósito ya facturado y deducido en esa factura, como UNA entrada más de `lines`: su descripción tal como se imprime, importe y precio unitario NEGATIVOS, cantidad 1 y el porcentaje del impuesto que le corresponde; nunca como un campo aparte ni dejándolo fuera. La respuesta del modelo no tiene ningún campo de descuento de cabecera, y la cabecera de la factura de compra no tiene `discountAmount`. El mapeo conserva esa línea como cualquier otra: una posición con `positionTotal` negativo y su impuesto, que entra en la conciliación de importes de línea (BR-BPP-SUPPLIER-DOCUMENT-027) y en las sumas de la validación y de la revisión (BR-BPP-PURCHASE-INVOICE-HEADER-074 y BR-BPP-PURCHASE-INVOICE-HEADER-018) sin ningún caso especial; una línea negativa no es por sí sola un descuento (un abono tiene líneas negativas). Un descuento de una línea queda en su importe neto (`positionTotal`); `discountPercent` y `discountAmount` de la posición valen siempre 0. El `subtotal` que lee el modelo es la base imponible tras el descuento, la comisión o el anticipo, y el `total` lo que la factura cobra. Una factura con una comisión cuyo resumen de impuestos impreso la ignora no cuadra con sus líneas: salta la comprobación de duda (BR-BPP-SUPPLIER-DOCUMENT-027) y va al paso 2.
|
|
1985
|
+
|
|
1986
|
+
### Casos exhaustivos
|
|
1987
|
+
|
|
1988
|
+
| # | Factura | Resultado |
|
|
1989
|
+
| - | ------- | --------- |
|
|
1990
|
+
| 1 | Comisión global «Agency commission» de −29 con IVA 10 % | Una posición con la descripción impresa, `quantity` 1, `unitPrice` −29, `subtotal` −29 y un impuesto del 10 %; la cabecera no tiene descuento |
|
|
1991
|
+
| 2 | Líneas con el impuesto incluido, 290 y −29 (total 261, subtotal 237,27) | La conversión a neto incluye la línea negativa: `positionTotal` 263,63 y −26,36, que suman el subtotal |
|
|
1992
|
+
| 3 | La línea negativa y las demás posiciones | `discountPercent` y `discountAmount` a 0 en todas: no hay trato especial |
|
|
1993
|
+
| 4 | Una línea con descuento propio | Su importe neto va en `positionTotal`; `discountPercent` y `discountAmount` a 0 |
|
|
1994
|
+
| 5 | Un anticipo o depósito ya facturado y deducido (Euroforum 105/26: «PAGO FACTURA DEPOSITO D24/26», 10 %, −16.625 €) | Una posición con la descripción impresa, `quantity` 1, `unitPrice` y `positionTotal` negativos y su impuesto; entra en la conciliación de líneas como cualquier otra, de modo que las líneas cuadran con la base impresa |
|
|
1995
|
+
| 6 | Un abono con líneas negativas | Líneas normales; ninguna se trata como descuento |
|
|
1996
|
+
| 7 | Comisión cuyo resumen de impuestos impreso la ignora | `TOTALS_MISMATCH`: documento `DOUBTFUL`, con el paso 2 como revisión |
|
|
1997
|
+
|
|
1998
|
+
### Tests
|
|
1999
|
+
|
|
2000
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts:'asks for a deducted advance or deposit as one more negative line, never to leave it out'`
|
|
2001
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts:'asks for a global commission or discount as a negative line with its own tax'`
|
|
2002
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-one-request.function.spec.ts:'bumps the prompt version when the advance becomes a negative line'`
|
|
2003
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'keeps the commission as a negative line, with its description as printed and its tax'`
|
|
2004
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'passes the tax-inclusive conversion with the negative line: the net amounts add up to the subtotal'`
|
|
2005
|
+
- `backend/src/@app/business-partner-portal/shared/purchase-invoice-extraction/business-partner-portal-map-invoice-ocr-result-to-purchase-invoice.function.spec.ts:'a global commission or discount (BR-BPP-SUPPLIER-DOCUMENT-030)' > 'gives the commission no special treatment: no discount on the header or on the position'`
|
|
2006
|
+
|
|
2007
|
+
### Reglas relacionadas
|
|
2008
|
+
|
|
2009
|
+
- **BR-BPP-SUPPLIER-DOCUMENT-029** — derogada por esta regla: misma redacción, salvo que el anticipo ya facturado y deducido se dejaba fuera de `lines`.
|
|
2010
|
+
- **BR-BPP-SUPPLIER-DOCUMENT-027** — la conciliación de líneas y la comprobación de duda que recorren la línea negativa.
|
|
2011
|
+
- **BR-BPP-PURCHASE-INVOICE-HEADER-074** — las sumas de la validación de impuestos no tienen término de descuento de cabecera.
|
|
2012
|
+
- **BR-BPP-PURCHASE-INVOICE-HEADER-018** — la derivación de la revisión suma las líneas tal como están.
|
|
2013
|
+
|
|
2014
|
+
---
|
|
2015
|
+
|
|
2016
|
+
## BR-BPP-SUPPLIER-DOCUMENT-031 — La petición del paso 2 lleva el id fiscal de NUESTRA empresa, leído del maestro de la sociedad del documento, y le dice al modelo que es el cliente y nunca el proveedor; sin sociedad no hay frase
|
|
2017
|
+
|
|
2018
|
+
| Campo | Valor |
|
|
2019
|
+
| ---------- | ----- |
|
|
2020
|
+
| Estado | `active` |
|
|
2021
|
+
| Severidad | `blocking` |
|
|
2022
|
+
| Origen | Backlog T-411 (factura 105/26 de Euroforum: el paso 2 cambió el id fiscal del emisor A78914223 por el de nuestra empresa ESA84523505, y la factura pasó a `SEVERAL_SUPPLIERS` en vez de `WITHOUT_SUPPLIER`) |
|
|
2023
|
+
| Trigger en | business-partner-portal/supplier-document (paso 2 de la extracción) |
|
|
2024
|
+
| Efecto en | business-partner-portal/purchase-invoice-header (`supplierTaxId` y los campos que el paso 2 relee) |
|
|
2025
|
+
|
|
2026
|
+
### Enunciado
|
|
2027
|
+
|
|
2028
|
+
El contexto del paso 2 lee el documento original de la factura y, con el `legalEntityId` de ese documento, lee el maestro de la sociedad: su `tin` viaja en la petición como `legalEntityTin`. Nunca se usa el `legalEntityTin` guardado en la cabecera de la factura, que es el valor leído por el OCR y puede ser el equivocado. El texto de usuario de la petición (no el prompt de sistema, que es el prefijo cacheable) añade, tras los campos pedidos, la frase «The tax id of our company is <tin>: it is the customer, never the supplier.»; así el modelo no confunde nuestro id fiscal con el del proveedor al releer un campo. Sin `legalEntityId`, o con una sociedad que ya no existe, `legalEntityTin` es `null` y la frase no se escribe; el modelo se llama igualmente. Cuando no hay nada que pedir y no se lee el documento, tampoco se lee la sociedad y `legalEntityTin` es `null`.
|
|
2029
|
+
|
|
2030
|
+
### Casos exhaustivos
|
|
2031
|
+
|
|
2032
|
+
| # | Documento de la factura | Resultado |
|
|
2033
|
+
| - | ----------------------- | --------- |
|
|
2034
|
+
| 1 | Con `legalEntityId` y la sociedad existe | `legalEntityTin` es el `tin` del maestro; el texto de usuario lleva la frase con ese id tras los campos pedidos |
|
|
2035
|
+
| 2 | Con `legalEntityId` y el `tin` de la cabecera difiere del maestro | Se usa el del maestro |
|
|
2036
|
+
| 3 | Sin `legalEntityId` | `legalEntityTin` es `null`, no se lee ninguna sociedad y no hay frase |
|
|
2037
|
+
| 4 | Con `legalEntityId` y la sociedad ya no existe | `legalEntityTin` es `null` y no hay frase |
|
|
2038
|
+
| 5 | Sin campos que pedir ni revisión de duda | No se lee el documento ni la sociedad; `legalEntityTin` es `null` |
|
|
2039
|
+
|
|
2040
|
+
### Tests
|
|
2041
|
+
|
|
2042
|
+
- `backend/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts:'tax id of our company (BR-BPP-SUPPLIER-DOCUMENT-031)' > 'hands the tin of the legal entity master of the document, not the one stored on the header'`
|
|
2043
|
+
- `backend/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts:'tax id of our company (BR-BPP-SUPPLIER-DOCUMENT-031)' > 'hands null when the document has no legal entity, without reading any master'`
|
|
2044
|
+
- `backend/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts:'tax id of our company (BR-BPP-SUPPLIER-DOCUMENT-031)' > 'hands null when the legal entity no longer exists'`
|
|
2045
|
+
- `backend/src/@app/business-partner-portal/shared/extraction-step-two/business-partner-portal-extraction-step-two-context.service.spec.ts:'tax id of our company (BR-BPP-SUPPLIER-DOCUMENT-031)' > 'hands null when there is nothing to ask, without reading the document'`
|
|
2046
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts:'gives the tax id of our own company in the user text so it is never read as the supplier'`
|
|
2047
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts:'writes no sentence about our company without a tax id'`
|
|
2048
|
+
- `backend/src/@app/business-partner-portal/anthropic/shared/functions/business-partner-portal-anthropic-build-step-two-request.function.spec.ts:'doubt review' > 'bumps the prompt version when the request carries the tax id of our company'`
|
|
2049
|
+
|
|
2050
|
+
### Reglas relacionadas
|
|
2051
|
+
|
|
2052
|
+
- **BR-BPP-SUPPLIER-DOCUMENT-027** — el paso 1 recibe el mismo id fiscal de la sociedad con la misma frase; el paso 2 lo hace igual.
|
|
2053
|
+
- **BR-BPP-PURCHASE-INVOICE-HEADER-069** — cada cambio del prompt del paso 2 sube su versión, que la lectura registra.
|
|
2054
|
+
- **BR-BPP-PURCHASE-INVOICE-HEADER-070** — decide cuándo se hace la llamada del paso 2 y qué campos lee.
|
|
2055
|
+
- **BR-BPP-PURCHASE-INVOICE-HEADER-071** — el contrato de la revisión de la duda que comparte la misma petición.
|
|
@@ -351,3 +351,63 @@ Con cada pregunta hecha desde un formulario abierto, el chat envía una foto del
|
|
|
351
351
|
- **BR-TOOLS-ASSISTANT-USAGE-003** — gobierna la ventana de turnos previos; la foto pertenece a la pregunta actual y no se guarda en el turno, así que nunca entra en esa ventana (caso 6).
|
|
352
352
|
- **BR-TOOLS-ASSISTANT-CONVERSATION-001** — la retención y la lectura de turnos no cambian: la foto no es parte del turno.
|
|
353
353
|
- **BR-TOOLS-ASSISTANT-USAGE-004** — el `prefill` de una acción de alta escribe a través del mismo parche validado del registro.
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## BR-TOOLS-ASSISTANT-USAGE-006 — Con cada pregunta hecha desde una pantalla que publica su contexto, el asistente recibe solo lo que esa pantalla muestra, validado y acotado antes de la cuota; no lo guarda en el turno ni lo registra, y no ejecuta ninguna acción de la pantalla
|
|
358
|
+
|
|
359
|
+
| Campo | Valor |
|
|
360
|
+
| --------- | ------------------------------------------------------------------------------ |
|
|
361
|
+
| Estado | `active` |
|
|
362
|
+
| Severidad | `blocking` |
|
|
363
|
+
| Origen | `openspec/changes/archive/2026-11-16-add-assistant-screen-context/proposal.md` |
|
|
364
|
+
|
|
365
|
+
### Enunciado
|
|
366
|
+
|
|
367
|
+
Con cada pregunta hecha desde una pantalla que publica su contexto, el chat envía lo que esa pantalla muestra en un vocabulario cerrado (estado, incidencias, acciones con las condiciones que les faltan, hechos y filas con avisos). El backend lo valida y aplica los límites por sección antes de la cuota: un contexto inválido o que supera un límite rechaza la pregunta entera y nunca se recorta. El contexto no se guarda en el turno ni se registra en el log, y el asistente no puede elegir ni ejecutar una acción de la pantalla.
|
|
368
|
+
|
|
369
|
+
### Casos exhaustivos
|
|
370
|
+
|
|
371
|
+
| # | Situación | Resultado |
|
|
372
|
+
| --- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
373
|
+
| 1 | Pregunta hecha desde una pantalla que aporta secciones | La pregunta lleva `screen` con el id de la pantalla y las secciones aportadas; se lee al enviar la pregunta, no antes |
|
|
374
|
+
| 2 | Pregunta hecha desde una pantalla que no aporta nada | La clave `screen` se omite y el modelo no recibe bloque de pantalla |
|
|
375
|
+
| 3 | Pregunta hecha con un formulario abierto en una pantalla que aporta secciones | Viajan juntos `form` y `screen` |
|
|
376
|
+
| 4 | Dos componentes aportan la misma sección, o una pantalla con otro id aporta a la vez | El registro lanza un error que nombra la sección o los dos ids, y no guarda nada de la aportación que falla |
|
|
377
|
+
| 5 | `screen` no tiene la forma del vocabulario (clave desconocida, tipo erróneo, id sin `bc.module`) | Respuesta 400 `assistantInvalidScreen` con la sección culpable, antes de la cuota, del proveedor y de cualquier escritura (también por REST) |
|
|
378
|
+
| 6 | Una sección supera su límite de elementos o de caracteres | Se rechaza igual que el caso 5; nunca se recorta |
|
|
379
|
+
| 7 | Se guarda el turno | El contexto de pantalla no forma parte del turno ni se registra en el log; nunca entra en la ventana de turnos previos |
|
|
380
|
+
| 8 | La pantalla publica una acción que no se muestra | El modelo la recibe como «not shown» con sus condiciones que faltan y la explica con ellas |
|
|
381
|
+
| 9 | La pantalla publica una acción que se muestra | El modelo la recibe como «shown» y no promete que vaya a funcionar |
|
|
382
|
+
| 10 | El modelo elige una acción de la pantalla | Las acciones de pantalla no llevan id y el backend descarta toda acción no ofrecida por las secciones |
|
|
383
|
+
| 11 | Un valor del contexto contiene instrucciones o saltos de línea | Cada valor va entre comillas en una sola línea y el prompt declara el bloque como datos, nunca instrucciones |
|
|
384
|
+
| 12 | La respuesta sale solo del bloque de pantalla | Declara `ANSWERED` sin secciones citadas |
|
|
385
|
+
|
|
386
|
+
### Tests
|
|
387
|
+
|
|
388
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'carries the sections of two components of one screen under the screen id'`
|
|
389
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'withdraws only the sections of the destroyed component'`
|
|
390
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'throws naming section and screen on a held section, and the first contribution still reads'`
|
|
391
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'stores nothing of a contribution that throws'`
|
|
392
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'throws naming both ids on a contribution for another screen'`
|
|
393
|
+
- `frontend/src/@aurora/modules/screen-context/screen-context.service.spec.ts:'runs the readers on each snapshot'`
|
|
394
|
+
- `frontend/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts:'sends the screen snapshot with the question'`
|
|
395
|
+
- `frontend/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts:'omits the screen key when nothing is contributed'`
|
|
396
|
+
- `frontend/src/app/domains/admin/apps/tools/assistant/tools-assistant.service.spec.ts:'sends form and screen together'`
|
|
397
|
+
- `backend/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.spec.ts:'limits: the value at the limit passes and limit + 1 names its section'`
|
|
398
|
+
- `backend/src/@app/tools/assistant-usage/application/ask-assistant/tools-assistant-read-screen.function.spec.ts:'malformed shapes'`
|
|
399
|
+
- `backend/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.spec.ts:'refuses %s before the quota, the provider and any write'`
|
|
400
|
+
- `backend/src/@app/tools/assistant-usage/application/ask-assistant/tools-ask-assistant-assistant-usage.handler.spec.ts:'stores and logs nothing of the screen text'`
|
|
401
|
+
- `backend/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts:'sends no screen block when the screen publishes nothing'`
|
|
402
|
+
- `backend/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts:'renders the facts of two screens with the same line shape'`
|
|
403
|
+
- `backend/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts:'keeps a value with a newline and a quote on one line'`
|
|
404
|
+
- `backend/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts:'never puts the screen in a previous turn'`
|
|
405
|
+
- `backend/src/@app/tools/anthropic/shared/functions/tools-anthropic-build-assistant-request.function.spec.ts:'describes coverage and citations so an answer from the screen block alone is ANSWERED'`
|
|
406
|
+
|
|
407
|
+
### Reglas relacionadas
|
|
408
|
+
|
|
409
|
+
- **BR-TOOLS-ASSISTANT-USAGE-001** — una pregunta con contexto de pantalla se cobra y se rechaza por cuota igual que cualquier otra; una pantalla inválida se rechaza antes de la cuota y no gasta nada (casos 5, 6).
|
|
410
|
+
- **BR-TOOLS-ASSISTANT-USAGE-003** — el contexto pertenece a la pregunta actual y nunca entra en la ventana de turnos previos (caso 7).
|
|
411
|
+
- **BR-TOOLS-ASSISTANT-USAGE-004** — las acciones de pantalla son contexto, no acciones guiadas: el modelo no puede elegirlas (caso 10).
|
|
412
|
+
- **BR-TOOLS-ASSISTANT-USAGE-005** — la foto del formulario viaja junto al contexto de pantalla sin cambiar (caso 3).
|
|
413
|
+
- **BR-TOOLS-ASSISTANT-CONVERSATION-001** — el contexto de pantalla no forma parte del turno (caso 7).
|