dsh-live-teams 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/LICENSE +176 -0
  2. package/NOTICE +11 -0
  3. package/README.md +85 -0
  4. package/cordis.patch.yml +25 -0
  5. package/lib/binding.d.ts +18 -0
  6. package/lib/binding.js +42 -0
  7. package/lib/changed-paths.d.ts +26 -0
  8. package/lib/changed-paths.js +69 -0
  9. package/lib/client.js +6753 -0
  10. package/lib/command-queue.d.ts +60 -0
  11. package/lib/command-queue.js +185 -0
  12. package/lib/compatibility.js +109 -0
  13. package/lib/context-provider.d.ts +110 -0
  14. package/lib/context-provider.js +249 -0
  15. package/lib/dispatch.d.ts +174 -0
  16. package/lib/dispatch.js +624 -0
  17. package/lib/errors.d.ts +36 -0
  18. package/lib/errors.js +103 -0
  19. package/lib/git-artifacts.d.ts +50 -0
  20. package/lib/git-artifacts.js +242 -0
  21. package/lib/index.d.ts +14 -0
  22. package/lib/index.js +14 -0
  23. package/lib/mailbox.d.ts +274 -0
  24. package/lib/mailbox.js +721 -0
  25. package/lib/member-tools.d.ts +57 -0
  26. package/lib/member-tools.js +1265 -0
  27. package/lib/migrations.d.ts +17 -0
  28. package/lib/migrations.js +47 -0
  29. package/lib/plugin.d.ts +106 -0
  30. package/lib/plugin.js +1003 -0
  31. package/lib/roles.d.ts +35 -0
  32. package/lib/roles.js +284 -0
  33. package/lib/routes.d.ts +586 -0
  34. package/lib/routes.js +2816 -0
  35. package/lib/scope.d.ts +62 -0
  36. package/lib/scope.js +133 -0
  37. package/lib/session-bridge.d.ts +76 -0
  38. package/lib/session-bridge.js +147 -0
  39. package/lib/session-title.js +35 -0
  40. package/lib/storage.d.ts +9 -0
  41. package/lib/storage.js +65 -0
  42. package/lib/task-store.d.ts +729 -0
  43. package/lib/task-store.js +2205 -0
  44. package/lib/team-store.d.ts +216 -0
  45. package/lib/team-store.js +765 -0
  46. package/lib/tree-snapshot.d.ts +28 -0
  47. package/lib/tree-snapshot.js +80 -0
  48. package/lib/types/client/TeamView.d.ts +26 -0
  49. package/lib/types/client/TeamView.dom.test.d.ts +1 -0
  50. package/lib/types/client/api.d.ts +522 -0
  51. package/lib/types/client/api.test.d.ts +1 -0
  52. package/lib/types/client/attention.d.ts +65 -0
  53. package/lib/types/client/attention.test.d.ts +1 -0
  54. package/lib/types/client/index.d.ts +31 -0
  55. package/lib/types/client/locales.d.ts +577 -0
  56. package/lib/types/client/member-name.d.ts +14 -0
  57. package/lib/types/client/member-name.test.d.ts +1 -0
  58. package/lib/types/client/roster.d.ts +26 -0
  59. package/lib/types/client/roster.test.d.ts +1 -0
  60. package/lib/types/client/styles.d.ts +3 -0
  61. package/package.json +104 -0
  62. package/roles/builder.md +40 -0
  63. package/roles/delegate.md +36 -0
  64. package/roles/lead.md +46 -0
  65. package/roles/oracle.md +36 -0
  66. package/roles/researcher.md +37 -0
  67. package/roles/reviewer.md +45 -0
  68. package/roles/scout.md +36 -0
  69. package/roles/verifier.md +36 -0
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The attention chip.
3
+ *
4
+ * The Messages panel answered "what was said to me", which is a question nobody
5
+ * asks — the human asks "does anyone need me?", and then wants the conversation,
6
+ * which lives in the member's own Session. This chip answers that question from
7
+ * anywhere: it sits in the Session header, resolves the team from the Session it
8
+ * is rendered in, and a click opens the member who is waiting.
9
+ *
10
+ * Acknowledging on click is deliberate: the delivery record is the only durable
11
+ * "the human was told" evidence, and opening the source is the human acting on
12
+ * it. Without that the chip would keep asking forever.
13
+ */
14
+ import React from 'react';
15
+ import { type TeamAttentionEntry } from './api.js';
16
+ import type { LocaleKey } from './locales.js';
17
+ import './styles.js';
18
+ export type SessionsService = {
19
+ readonly open: (sessionId: string) => void;
20
+ readonly list?: {
21
+ readonly getSnapshot: () => {
22
+ readonly current?: string;
23
+ };
24
+ readonly subscribe?: (listener: () => void) => () => void;
25
+ };
26
+ };
27
+ export type AttentionContext = {
28
+ readonly sessions: SessionsService;
29
+ readonly t: (key: LocaleKey) => string;
30
+ };
31
+ export type AttentionChipProps = {
32
+ readonly ctx?: AttentionContext;
33
+ };
34
+ /** How often the chip re-asks while a Session is open. */
35
+ export declare const ATTENTION_POLL_MS = 20000;
36
+ /**
37
+ * How long a started acknowledgement may suppress a member before the chip
38
+ * stops trusting the attempt and asks the mailbox again.
39
+ */
40
+ export declare const PENDING_CLEAR_TTL_MS = 15000;
41
+ export declare function isClearPending(memberId: string, now?: number): boolean;
42
+ /** Test seam: the marker is module state, so a test file must be able to reset it. */
43
+ export declare function resetAttentionClears(): void;
44
+ /**
45
+ * The Session the chip speaks for: the one being viewed, not the one it happens
46
+ * to be mounted in. The `conversation.session.header.utilities` slot passes no
47
+ * props (`renderSlot(name, {})`), so this is the only way to the Session id.
48
+ */
49
+ export declare function currentSessionId(sessions: SessionsService | undefined): string | undefined;
50
+ /** What the chip says: the longest-waiting member, plus how many others follow. */
51
+ export declare function attentionLabel(entries: readonly TeamAttentionEntry[]): {
52
+ name: string;
53
+ extra: number;
54
+ waiting: number;
55
+ } | undefined;
56
+ /**
57
+ * Mark everything one member is waiting on as read by the human.
58
+ *
59
+ * The waiting count comes from deliveries, whose ids only the inbox carries, so
60
+ * this reads the inbox once and acknowledges in a single request. Returns false
61
+ * when the state could not be cleared, so the chip can keep asking instead of
62
+ * pretending the human saw something they did not.
63
+ */
64
+ export declare function acknowledgeMemberWaiting(sessionId: string, memberId: string): Promise<boolean>;
65
+ export declare function AttentionChip(props: AttentionChipProps): React.ReactElement | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { type SessionsService } from './attention.js';
3
+ import { type LocaleKey } from './locales.js';
4
+ type LocaleService = {
5
+ register(namespace: string, values: {
6
+ readonly en: Record<string, string>;
7
+ readonly ru: Record<string, string>;
8
+ }): () => void;
9
+ bind(namespace: string): (key: LocaleKey) => string;
10
+ };
11
+ type SlotRegistration = {
12
+ name: string;
13
+ id: string;
14
+ order: number;
15
+ locale: string;
16
+ label: () => string;
17
+ };
18
+ type SlotsService = {
19
+ inject(name: string, callback: () => unknown): unknown;
20
+ register(registration: SlotRegistration, component: (props: unknown) => React.ReactElement): unknown;
21
+ };
22
+ type ClientContext = {
23
+ slots: SlotsService;
24
+ locale: LocaleService;
25
+ sessions: SessionsService;
26
+ effect(effect: () => void | (() => void), name?: string): unknown;
27
+ };
28
+ export declare const name = "dsh-live-teams";
29
+ export declare const inject: readonly ["slots", "locale", "sessions"];
30
+ export { NS } from './locales.js';
31
+ export declare function apply(ctx: ClientContext): void;