@authorbot/domain 0.1.38 → 0.1.40

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/CHANGELOG.md CHANGED
@@ -9,6 +9,48 @@ Every published package shares this version. A tag builds, tests, and publishes
9
9
  all of them together, so `@authorbot/cli@0.1.15` and `@authorbot/api@0.1.15` are
10
10
  always the same commit.
11
11
 
12
+ ## 0.1.40
13
+
14
+ - **Character details open correctly from hosted and local chapter pages.**
15
+ The 0.1.39 packed publisher could erase Web Awesome's runtime drawer import
16
+ when a book built outside the Authorbot workspace. Character links still
17
+ fetched their detail page, but the unregistered element stayed invisible.
18
+ The drawer now has an explicit runtime registration boundary, a browser
19
+ regression, and a packed-tarball build check that exercises the same
20
+ consumer context used by book CI.
21
+ - The README and publisher architecture docs now state the browser contract
22
+ directly: hosted and local-dev modes include progressive-enhancement
23
+ JavaScript, while an API-less build remains script-free and readable.
24
+ - The mobile header now contains its scrollable navigation at 320px, and
25
+ keyboard-created notes receive focus only after their anchored gutter layout
26
+ is visible.
27
+ - This hotfix adds no D1 or book-format migration.
28
+
29
+ ## 0.1.39
30
+
31
+ - **The hosted and local authoring UI now share the dogfooded reading
32
+ experience.** Chapter and summary editing load in place without clearing the
33
+ manuscript, reader controls can hide notes and use the available reading
34
+ width, and character links open full details in a right-side drawer.
35
+ Outline, timeline, and character editing use the same compact controls and
36
+ in-place loading behavior.
37
+ - **Chapter history now reads as a seamless layer over the manuscript.** The
38
+ revision rail stays beside the page, selected revision controls occupy the
39
+ notes column, and word- and sentence-level changes render in the normal
40
+ prose surface with semantic inserted and deleted colors. Revision loading
41
+ preserves the current view until the replacement is ready.
42
+ - **Notes and discussions are denser and more capable.** Anchored comments
43
+ follow the manuscript without covering it, collapsed notes retain the
44
+ author and text, reply and thread promotion create Work with the discussion
45
+ text intact, and editor/comment handoffs preserve selections and unsaved
46
+ input.
47
+ - **The browser UI now uses focused lightweight primitives where they help.**
48
+ Lit owns reader controls, Web Awesome supplies the character drawer, and
49
+ Floating UI positions anchored annotation surfaces; the rest remains
50
+ progressive-enhancement custom elements over static reading HTML.
51
+ - This release adds D1 migration `0014_reply_work_promotion.sql` and no
52
+ book-format migration.
53
+
12
54
  ## 0.1.38
13
55
 
14
56
  - **Authorbot now has a complete local authoring mode.** `authorbot dev` runs
package/dist/index.d.ts CHANGED
@@ -18,8 +18,8 @@ export { DECISION_RESULTS, DECISION_SUPPORT_CHANGED_EVENT, decisionResultSchema,
18
18
  export type { DecisionResult, SupportChangeOutcome, SupportChangeTransition, } from "./decision-support.js";
19
19
  export { PHASE3_WORK_ITEM_STATUSES, WORK_ITEM_STATUSES, WORK_ITEM_TRANSITIONS, canTransitionWorkItem, isPhase3WorkItemStatus, transitionWorkItem, } from "./work-item-state.js";
20
20
  export type { WorkItemStatus, WorkItemTransitionDenialReason, } from "./work-item-state.js";
21
- export { FORCE_CREATE_RULE_VERSION, MAX_OVERRIDE_REASON_LENGTH, MIN_OVERRIDE_REASON_LENGTH, authorizeCancelWorkItem, authorizeForceCreateWorkItem, authorizeRejectSuggestion, authorizeReopenSuggestion, cancelWorkItemCommandSchema, forceCreateWorkItemCommandSchema, overrideReasonSchema, rejectSuggestionCommandSchema, reopenSuggestionCommandSchema, } from "./overrides.js";
22
- export type { AnnotationPromotionDenialReason, CancelWorkItemCommand, ForceCreateWorkItemCommand, RejectSuggestionCommand, ReopenSuggestionCommand, SuggestionOverrideDenialReason, WorkItemOverrideDenialReason, } from "./overrides.js";
21
+ export { FORCE_CREATE_RULE_VERSION, MAX_OVERRIDE_REASON_LENGTH, MIN_OVERRIDE_REASON_LENGTH, authorizeCancelWorkItem, authorizeForceCreateReplyWorkItem, authorizeForceCreateWorkItem, authorizeRejectSuggestion, authorizeReopenSuggestion, cancelWorkItemCommandSchema, forceCreateReplyWorkItemCommandSchema, forceCreateWorkItemCommandSchema, overrideReasonSchema, rejectSuggestionCommandSchema, reopenSuggestionCommandSchema, } from "./overrides.js";
22
+ export type { AnnotationPromotionDenialReason, CancelWorkItemCommand, ForceCreateWorkItemCommand, ForceCreateReplyWorkItemCommand, RejectSuggestionCommand, ReopenSuggestionCommand, ReplyPromotionDenialReason, SuggestionOverrideDenialReason, WorkItemOverrideDenialReason, } from "./overrides.js";
23
23
  export { AGENT_TOKEN_PREFIX, AGENT_TOKEN_REGEX, AGENT_TOKEN_SECRET_LENGTH, DEFAULT_TOKEN_TTL_DAYS, LAST_USED_UPDATE_INTERVAL_MS, MAX_TOKEN_TTL_DAYS, SESSION_ID_LENGTH, SESSION_ID_REGEX, SESSION_TTL_DAYS, agentTokenSchema, checkTokenActive, isAgentTokenFormat, isSessionIdFormat, parseAgentToken, resolveSessionExpiry, resolveTokenExpiry, sessionIdSchema, shouldUpdateLastUsed, toTimestamp, } from "./token.js";
24
24
  export type { AgentTokenParseFailure, AgentTokenParseResult, TokenExpiryResult, TokenInactiveReason, } from "./token.js";
25
25
  export { DEFAULT_LEASE_CONFIG, LEASE_DURATION_MS, LEASE_MAX_TOTAL_DURATION_MS, LEASE_RENEWAL_DURATION_MS, LEASE_RENEWAL_PROMPT_BEFORE_MS, checkLeaseActive, checkLeaseRenewable, checkWorkItemClaimable, isLeaseExpired, leaseConfigSchema, parseIsoDuration, renewalPromptAt, resolveLeaseExpiry, shouldExpireLease, } from "./lease.js";
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ export { MAX_BODY_BYTES, MAX_TOKEN_NAME_LENGTH, bodySchema, normalizeBody, creat
8
8
  export { VOTE_VALUES, authorizeVote, castVoteCommandSchema, clearVoteCommandSchema, voteValueSchema, } from "./vote.js";
9
9
  export { DECISION_RESULTS, DECISION_SUPPORT_CHANGED_EVENT, decisionResultSchema, resolveSupportChange, } from "./decision-support.js";
10
10
  export { PHASE3_WORK_ITEM_STATUSES, WORK_ITEM_STATUSES, WORK_ITEM_TRANSITIONS, canTransitionWorkItem, isPhase3WorkItemStatus, transitionWorkItem, } from "./work-item-state.js";
11
- export { FORCE_CREATE_RULE_VERSION, MAX_OVERRIDE_REASON_LENGTH, MIN_OVERRIDE_REASON_LENGTH, authorizeCancelWorkItem, authorizeForceCreateWorkItem, authorizeRejectSuggestion, authorizeReopenSuggestion, cancelWorkItemCommandSchema, forceCreateWorkItemCommandSchema, overrideReasonSchema, rejectSuggestionCommandSchema, reopenSuggestionCommandSchema, } from "./overrides.js";
11
+ export { FORCE_CREATE_RULE_VERSION, MAX_OVERRIDE_REASON_LENGTH, MIN_OVERRIDE_REASON_LENGTH, authorizeCancelWorkItem, authorizeForceCreateReplyWorkItem, authorizeForceCreateWorkItem, authorizeRejectSuggestion, authorizeReopenSuggestion, cancelWorkItemCommandSchema, forceCreateReplyWorkItemCommandSchema, forceCreateWorkItemCommandSchema, overrideReasonSchema, rejectSuggestionCommandSchema, reopenSuggestionCommandSchema, } from "./overrides.js";
12
12
  export { AGENT_TOKEN_PREFIX, AGENT_TOKEN_REGEX, AGENT_TOKEN_SECRET_LENGTH, DEFAULT_TOKEN_TTL_DAYS, LAST_USED_UPDATE_INTERVAL_MS, MAX_TOKEN_TTL_DAYS, SESSION_ID_LENGTH, SESSION_ID_REGEX, SESSION_TTL_DAYS, agentTokenSchema, checkTokenActive, isAgentTokenFormat, isSessionIdFormat, parseAgentToken, resolveSessionExpiry, resolveTokenExpiry, sessionIdSchema, shouldUpdateLastUsed, toTimestamp, } from "./token.js";
13
13
  export { DEFAULT_LEASE_CONFIG, LEASE_DURATION_MS, LEASE_MAX_TOTAL_DURATION_MS, LEASE_RENEWAL_DURATION_MS, LEASE_RENEWAL_PROMPT_BEFORE_MS, checkLeaseActive, checkLeaseRenewable, checkWorkItemClaimable, isLeaseExpired, leaseConfigSchema, parseIsoDuration, renewalPromptAt, resolveLeaseExpiry, shouldExpireLease, } from "./lease.js";
14
14
  export { LEASE_TOKEN_PREFIX, LEASE_TOKEN_REGEX, LEASE_TOKEN_SECRET_LENGTH, isLeaseTokenFormat, leaseTokenSchema, parseLeaseToken, } from "./lease-token.js";
@@ -45,8 +45,16 @@ export declare const forceCreateWorkItemCommandSchema: z.ZodObject<{
45
45
  reason: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
46
46
  }, z.core.$strict>;
47
47
  export type ForceCreateWorkItemCommand = z.infer<typeof forceCreateWorkItemCommandSchema>;
48
+ /** Force-create Work from one reply without promoting its whole annotation. */
49
+ export declare const forceCreateReplyWorkItemCommandSchema: z.ZodObject<{
50
+ annotationId: z.ZodString;
51
+ replyId: z.ZodString;
52
+ reason: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
53
+ }, z.core.$strict>;
54
+ export type ForceCreateReplyWorkItemCommand = z.infer<typeof forceCreateReplyWorkItemCommandSchema>;
48
55
  export type SuggestionOverrideDenialReason = "not-maintainer" | "not-a-suggestion" | "illegal-transition";
49
56
  export type AnnotationPromotionDenialReason = "not-maintainer" | "illegal-transition";
57
+ export type ReplyPromotionDenialReason = "not-maintainer" | "illegal-transition";
50
58
  /** Reject an open suggestion (`open -> rejected`). */
51
59
  export declare function authorizeRejectSuggestion(input: {
52
60
  actorRole: Role;
@@ -76,4 +84,9 @@ export declare function authorizeForceCreateWorkItem(input: {
76
84
  annotationKind: AnnotationKind;
77
85
  annotationStatus: AnnotationStatus;
78
86
  }): Decision<AnnotationPromotionDenialReason>;
87
+ /** Promote one committed, open reply without changing the parent annotation. */
88
+ export declare function authorizeForceCreateReplyWorkItem(input: {
89
+ actorRole: Role;
90
+ replyStatus: "pending_git" | "open" | "withdrawn";
91
+ }): Decision<ReplyPromotionDenialReason>;
79
92
  //# sourceMappingURL=overrides.d.ts.map
package/dist/overrides.js CHANGED
@@ -46,6 +46,12 @@ export const forceCreateWorkItemCommandSchema = z.strictObject({
46
46
  annotationId: uuidv7Schema,
47
47
  reason: overrideReasonSchema.optional(),
48
48
  });
49
+ /** Force-create Work from one reply without promoting its whole annotation. */
50
+ export const forceCreateReplyWorkItemCommandSchema = z.strictObject({
51
+ annotationId: uuidv7Schema,
52
+ replyId: uuidv7Schema,
53
+ reason: overrideReasonSchema.optional(),
54
+ });
49
55
  function requireMaintainer(actorRole) {
50
56
  if (actorRole !== "maintainer") {
51
57
  return denied("not-maintainer", "only a maintainer may perform overrides");
@@ -106,4 +112,14 @@ export function authorizeForceCreateWorkItem(input) {
106
112
  }
107
113
  return ALLOWED;
108
114
  }
115
+ /** Promote one committed, open reply without changing the parent annotation. */
116
+ export function authorizeForceCreateReplyWorkItem(input) {
117
+ const maintainer = requireMaintainer(input.actorRole);
118
+ if (!maintainer.allowed)
119
+ return maintainer;
120
+ if (input.replyStatus !== "open") {
121
+ return denied("illegal-transition", `a reply with status "${input.replyStatus}" cannot receive a work item (only "open")`);
122
+ }
123
+ return ALLOWED;
124
+ }
109
125
  //# sourceMappingURL=overrides.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authorbot/domain",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "Pure domain logic for Authorbot: role/scope authorization, annotation and Git-operation state machines, command validators, and token/session value rules (Phase 2 contract section 3)",
5
5
  "keywords": [
6
6
  "authorbot",
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "zod": "^4.0.0",
43
- "@authorbot/schemas": "0.1.38"
43
+ "@authorbot/schemas": "0.1.40"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^22.0.0",