@skillcdn/console 0.6.2 → 0.6.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 +13 -6
- package/SKILLCDN.md +3 -2
- package/dist/agent-page.d.ts +2 -0
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +40 -3
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-state.d.ts +9 -0
- package/dist/agent-state.d.ts.map +1 -0
- package/dist/agent-state.js +28 -0
- package/dist/agent-state.js.map +1 -0
- package/dist/api.d.ts +4 -3
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -3
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +304 -130
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +13 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +43 -9
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +82 -9
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +780 -318
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/pack.d.ts +2 -2
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +6 -4
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/runner-files.d.ts +16 -0
- package/dist/cli/runner-files.d.ts.map +1 -0
- package/dist/cli/runner-files.js +110 -0
- package/dist/cli/runner-files.js.map +1 -0
- package/dist/cli/runner-host.d.ts +7 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +40 -2
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/client.d.ts +16 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +28 -3
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +48 -3
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +3 -2
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +9 -3
- package/dist/components/agents.js.map +1 -1
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +1 -1
- package/dist/console.js.map +1 -1
- package/dist/feed-words.d.ts.map +1 -1
- package/dist/feed-words.js +12 -1
- package/dist/feed-words.js.map +1 -1
- package/dist/i18n/en.d.ts +45 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +36 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +28 -0
- package/dist/i18n/ko.js.map +1 -1
- package/dist/limits.d.ts +10 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +10 -0
- package/dist/limits.js.map +1 -1
- package/dist/plugin/context.d.ts +39 -7
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +9 -3
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +5 -1
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +14 -2
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +18 -0
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +77 -1
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +7 -0
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +9 -0
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +16 -22
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +72 -120
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/runner.d.ts +25 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +404 -19
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack-status.d.ts +19 -0
- package/dist/runner/slack-status.d.ts.map +1 -0
- package/dist/runner/slack-status.js +332 -0
- package/dist/runner/slack-status.js.map +1 -0
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +245 -57
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +109 -15
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +6 -1
- package/dist/runner/usage.d.ts.map +1 -1
- package/dist/runner/usage.js +9 -2
- package/dist/runner/usage.js.map +1 -1
- package/dist/runner.d.ts +2 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +160 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +82 -5
- package/dist/schemas.js.map +1 -1
- package/dist/vocabulary.d.ts +7 -0
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +6 -0
- package/dist/vocabulary.js.map +1 -1
- package/dist/wake-text.d.ts +43 -0
- package/dist/wake-text.d.ts.map +1 -0
- package/dist/wake-text.js +115 -0
- package/dist/wake-text.js.map +1 -0
- package/docs/specs/cli.md +19 -11
- package/docs/specs/plugins.md +5 -5
- package/docs/specs/rest.md +10 -3
- package/docs/specs/runner.md +96 -20
- package/docs/start.md +26 -5
- package/package.json +3 -3
- package/skills/building-a-plugin/SKILL.md +2 -2
- package/skills/deploying-a-console/SKILL.md +3 -3
- package/skills/deploying-a-console/references/access.md +15 -1
- package/skills/deploying-a-console/references/resources.md +2 -2
- package/skills/deploying-a-console/scripts/github-app.mjs +593 -0
- package/skills/running-an-agent/SKILL.md +13 -10
- package/skills/running-an-agent/references/preparing-the-machine.md +1 -1
- package/skills/running-an-agent/references/slack-app.md +25 -8
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +1 -1
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +1 -1
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +1 -1
- package/skills/running-an-agent/references/your-first-task.md +7 -2
- package/skills/trying-a-console/SKILL.md +136 -0
- package/skills/trying-a-console/references/when-it-does-not-go.md +30 -0
- package/skills/working-the-board/SKILL.md +3 -3
- package/skills/working-the-board/references/the-pack.md +3 -3
- package/skills/working-the-board/references/what-they-were-told.md +1 -1
- package/src/agent-page.tsx +92 -1
- package/src/agent-state.ts +33 -0
- package/src/api.ts +16 -0
- package/src/cli/cli.ts +359 -137
- package/src/cli/format.ts +49 -9
- package/src/cli/help.ts +904 -359
- package/src/cli/pack.ts +6 -4
- package/src/cli/runner-files.ts +120 -0
- package/src/cli/runner-host.ts +48 -2
- package/src/client.ts +53 -0
- package/src/components/agent-page.tsx +150 -3
- package/src/components/agents.tsx +20 -5
- package/src/console.tsx +1 -0
- package/src/feed-words.ts +14 -1
- package/src/i18n/en.ts +39 -1
- package/src/i18n/ko.ts +32 -0
- package/src/limits.ts +10 -0
- package/src/plugin/context.ts +40 -7
- package/src/runner/acp.ts +9 -3
- package/src/runner/claude.ts +5 -1
- package/src/runner/codex.ts +14 -2
- package/src/runner/config.ts +114 -1
- package/src/runner/desk.ts +10 -0
- package/src/runner/message.ts +88 -126
- package/src/runner/runner.ts +487 -22
- package/src/runner/slack-status.ts +423 -0
- package/src/runner/slack.ts +293 -61
- package/src/runner/types.ts +108 -13
- package/src/runner/usage.ts +16 -3
- package/src/runner.ts +4 -0
- package/src/schemas.ts +97 -3
- package/src/vocabulary.ts +9 -0
- package/src/wake-text.ts +133 -0
package/src/agent-page.tsx
CHANGED
|
@@ -20,6 +20,8 @@ import {
|
|
|
20
20
|
AgentElsewhereList,
|
|
21
21
|
AgentRunnerFacts,
|
|
22
22
|
AgentSecretList,
|
|
23
|
+
AgentSecretOfferForm,
|
|
24
|
+
AgentSecretOfferList,
|
|
23
25
|
AgentSessionList,
|
|
24
26
|
AgentStateBadge,
|
|
25
27
|
AgentUsage,
|
|
@@ -679,6 +681,68 @@ function AgentSessions(props: {
|
|
|
679
681
|
);
|
|
680
682
|
}
|
|
681
683
|
|
|
684
|
+
/** How many offers that no longer wait a member is shown of their own, beside those that wait. */
|
|
685
|
+
const OFFERS_SHOWN_AFTER = 3;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Under an agent's plate, for whoever sees the account and supervises it not (ADR-0169): the
|
|
689
|
+
* way to offer it a secret, and how their own offers stand. For the account itself, what it was
|
|
690
|
+
* offered that waits, which it takes or leaves with its command.
|
|
691
|
+
*/
|
|
692
|
+
function AgentOffers(props: {
|
|
693
|
+
readonly client: ConsoleClient;
|
|
694
|
+
readonly agent: RestAgent;
|
|
695
|
+
readonly handle: string;
|
|
696
|
+
/** Whether the page is the account's own. */
|
|
697
|
+
readonly own: boolean;
|
|
698
|
+
}) {
|
|
699
|
+
const words = useWords().agents.page.offers;
|
|
700
|
+
const { client, agent, handle, own } = props;
|
|
701
|
+
const { busy, error, act } = useAction();
|
|
702
|
+
const read = useCallback(
|
|
703
|
+
(signal: AbortSignal) =>
|
|
704
|
+
own ? client.secretOffers(signal) : client.agentSecretOffers(handle, signal),
|
|
705
|
+
[client, handle, own],
|
|
706
|
+
);
|
|
707
|
+
const found = useRead(read);
|
|
708
|
+
const all = found.value?.items ?? [];
|
|
709
|
+
const waiting = all.filter((offer) => offer.state === "waiting");
|
|
710
|
+
const shown = own
|
|
711
|
+
? waiting
|
|
712
|
+
: [
|
|
713
|
+
...waiting,
|
|
714
|
+
...all.filter((offer) => offer.state !== "waiting").slice(0, OFFERS_SHOWN_AFTER),
|
|
715
|
+
];
|
|
716
|
+
if (own && shown.length === 0) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
return (
|
|
720
|
+
<section className="sc-panel" aria-label={own ? words.title : words.offerTitle}>
|
|
721
|
+
<h2 className="sc-section-title">{own ? words.title : words.offerTitle}</h2>
|
|
722
|
+
{error !== undefined && <Callout tone="danger">{error}</Callout>}
|
|
723
|
+
{shown.length > 0 && <AgentSecretOfferList offers={shown} />}
|
|
724
|
+
{own ? (
|
|
725
|
+
<p className="sc-field-hint">{words.own}</p>
|
|
726
|
+
) : (
|
|
727
|
+
<AgentSecretOfferForm
|
|
728
|
+
account={personName(agent.person)}
|
|
729
|
+
busy={busy}
|
|
730
|
+
onOffer={(offer) =>
|
|
731
|
+
void act(async () => {
|
|
732
|
+
await client.offerAgentSecret(handle, {
|
|
733
|
+
name: offer.name,
|
|
734
|
+
value: offer.value,
|
|
735
|
+
...(offer.note === undefined ? {} : { note: offer.note }),
|
|
736
|
+
});
|
|
737
|
+
found.again();
|
|
738
|
+
})
|
|
739
|
+
}
|
|
740
|
+
/>
|
|
741
|
+
)}
|
|
742
|
+
</section>
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
|
|
682
746
|
/** What is kept of the agent: its runner, where it is signed in, what it runs with, its secrets by name, its persona. */
|
|
683
747
|
function AgentSettings(props: {
|
|
684
748
|
readonly client: ConsoleClient;
|
|
@@ -699,6 +763,13 @@ function AgentSettings(props: {
|
|
|
699
763
|
[client, handle],
|
|
700
764
|
);
|
|
701
765
|
const secrets = useRead(readSecrets);
|
|
766
|
+
const readOffers = useCallback(
|
|
767
|
+
(signal: AbortSignal) => client.agentSecretOffers(handle, signal),
|
|
768
|
+
[client, handle],
|
|
769
|
+
);
|
|
770
|
+
const offers = useRead(readOffers);
|
|
771
|
+
/** What members offered the account that it has neither taken nor left (ADR-0169). */
|
|
772
|
+
const offered = (offers.value?.items ?? []).filter((offer) => offer.state === "waiting");
|
|
702
773
|
const readSignIns = useCallback(
|
|
703
774
|
(signal: AbortSignal) =>
|
|
704
775
|
viaToken ? Promise.resolve(undefined) : client.agentSignIns(handle, signal),
|
|
@@ -894,6 +965,13 @@ function AgentSettings(props: {
|
|
|
894
965
|
}
|
|
895
966
|
/>
|
|
896
967
|
</section>
|
|
968
|
+
{offered.length > 0 && (
|
|
969
|
+
<section className="sc-panel" aria-label={page.offers.title}>
|
|
970
|
+
<h2 className="sc-section-title">{page.offers.title}</h2>
|
|
971
|
+
<AgentSecretOfferList offers={offered} />
|
|
972
|
+
<p className="sc-field-hint">{page.offers.waits(personName(agent.person))}</p>
|
|
973
|
+
</section>
|
|
974
|
+
)}
|
|
897
975
|
</div>
|
|
898
976
|
</div>
|
|
899
977
|
);
|
|
@@ -910,6 +988,8 @@ export interface AgentPageProps {
|
|
|
910
988
|
readonly providers?: readonly RestProvider[] | undefined;
|
|
911
989
|
/** The agent's plate, which the console draws as it draws a person's. */
|
|
912
990
|
readonly work: (agent: RestAgent) => ReactNode;
|
|
991
|
+
/** The member who looks at the page, by their id: the account itself is offered no secret of its own. */
|
|
992
|
+
readonly me?: string | undefined;
|
|
913
993
|
}
|
|
914
994
|
|
|
915
995
|
/**
|
|
@@ -1007,7 +1087,18 @@ export function AgentPage(props: AgentPageProps) {
|
|
|
1007
1087
|
</nav>
|
|
1008
1088
|
)}
|
|
1009
1089
|
{view === "work" ? (
|
|
1010
|
-
|
|
1090
|
+
<>
|
|
1091
|
+
{props.work(agent)}
|
|
1092
|
+
{/* A supervisor seeds a secret among what is kept of the agent; anyone else offers one. */}
|
|
1093
|
+
{!agent.supervised && props.me !== undefined && (
|
|
1094
|
+
<AgentOffers
|
|
1095
|
+
client={client}
|
|
1096
|
+
agent={agent}
|
|
1097
|
+
handle={handle}
|
|
1098
|
+
own={props.me === person.id}
|
|
1099
|
+
/>
|
|
1100
|
+
)}
|
|
1101
|
+
</>
|
|
1011
1102
|
) : view === "closed" ? (
|
|
1012
1103
|
<EmptyState title={words.notSupervised.title} body={words.notSupervised.body} />
|
|
1013
1104
|
) : view === "live" ? (
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RestAgentState } from "./schemas.js";
|
|
2
|
+
|
|
3
|
+
// How an agent account stands (ADR-0085), as the pages and the command read it: the state has
|
|
4
|
+
// a moment, since when it stands, and the reason may have another, when it was said. A reason
|
|
5
|
+
// changes under a state that stays, a turn completes or a new conversation begins while the
|
|
6
|
+
// agent runs on, so the one is never shown as the other's.
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* How far apart the two moments are before the reason's is shown beside it: a reason said
|
|
10
|
+
* within a minute of its state is the state's own, and the pages show a moment to the minute.
|
|
11
|
+
* The runner's clock and the console's are two machines', a few seconds apart.
|
|
12
|
+
*/
|
|
13
|
+
const OWN_MOMENT_MS = 60_000;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* When the reason was said, where that is a moment of its own to show beside it: one the
|
|
17
|
+
* console keeps, and another than the state's. A reason that came with its state is of the
|
|
18
|
+
* state's moment, which stands with the state; one of before the console kept such a moment
|
|
19
|
+
* has none. Either is shown without one, and never beside the state's as if it were its own.
|
|
20
|
+
*/
|
|
21
|
+
export function reasonMoment(
|
|
22
|
+
state: Pick<RestAgentState, "since" | "reasonAt">,
|
|
23
|
+
): string | undefined {
|
|
24
|
+
const at = state.reasonAt ?? undefined;
|
|
25
|
+
if (at === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const said = Date.parse(at);
|
|
29
|
+
const since = Date.parse(state.since);
|
|
30
|
+
return Number.isNaN(said) || Number.isNaN(since) || Math.abs(said - since) < OWN_MOMENT_MS
|
|
31
|
+
? undefined
|
|
32
|
+
: at;
|
|
33
|
+
}
|
package/src/api.ts
CHANGED
|
@@ -180,6 +180,10 @@ export {
|
|
|
180
180
|
MAX_SEAL_REASON_LENGTH,
|
|
181
181
|
MAX_SEARCH_LENGTH,
|
|
182
182
|
MAX_SECRET_LENGTH,
|
|
183
|
+
MAX_SECRET_OFFER_NOTE_LENGTH,
|
|
184
|
+
MAX_SECRET_OFFERS_BY_ONE,
|
|
185
|
+
MAX_SECRET_OFFERS_KEPT,
|
|
186
|
+
MAX_SECRET_OFFERS_WAITING,
|
|
183
187
|
MAX_SERVICE_PARAMETERS,
|
|
184
188
|
MAX_SERVICE_VALUE_LENGTH,
|
|
185
189
|
MAX_SESSIONS_PAGE_LIMIT,
|
|
@@ -216,6 +220,7 @@ export {
|
|
|
216
220
|
MIN_HANDLE_LENGTH,
|
|
217
221
|
MIN_OPTIONS,
|
|
218
222
|
OWN_WAKE_KEY,
|
|
223
|
+
SECRET_OFFER_DAYS,
|
|
219
224
|
SESSIONS_PAGE_LIMIT,
|
|
220
225
|
SIGNALS_PAGE_LIMIT,
|
|
221
226
|
TRANSCRIPT_INLINE_BYTES,
|
|
@@ -381,6 +386,10 @@ export {
|
|
|
381
386
|
type RestAgentSecretAccess,
|
|
382
387
|
type RestAgentSecretAccesses,
|
|
383
388
|
type RestAgentSecretInput,
|
|
389
|
+
type RestAgentSecretOffer,
|
|
390
|
+
type RestAgentSecretOfferInput,
|
|
391
|
+
type RestAgentSecretOffers,
|
|
392
|
+
type RestAgentSecretOfferTakeInput,
|
|
384
393
|
type RestAgentSecrets,
|
|
385
394
|
type RestAgentSecretValue,
|
|
386
395
|
type RestAgentSession,
|
|
@@ -562,6 +571,10 @@ export {
|
|
|
562
571
|
restAgentSecretAccessesSchema,
|
|
563
572
|
restAgentSecretAccessSchema,
|
|
564
573
|
restAgentSecretInputSchema,
|
|
574
|
+
restAgentSecretOfferInputSchema,
|
|
575
|
+
restAgentSecretOfferSchema,
|
|
576
|
+
restAgentSecretOffersSchema,
|
|
577
|
+
restAgentSecretOfferTakeInputSchema,
|
|
565
578
|
restAgentSecretSchema,
|
|
566
579
|
restAgentSecretsSchema,
|
|
567
580
|
restAgentSecretValueSchema,
|
|
@@ -817,10 +830,12 @@ export {
|
|
|
817
830
|
type RunEnding,
|
|
818
831
|
type RunStatus,
|
|
819
832
|
SECRET_ACCESSES,
|
|
833
|
+
SECRET_OFFER_STATES,
|
|
820
834
|
SERVICE_ROLES,
|
|
821
835
|
SESSION_ENDS,
|
|
822
836
|
SESSION_KINDS,
|
|
823
837
|
type SecretAccess,
|
|
838
|
+
type SecretOfferState,
|
|
824
839
|
type ServiceRole,
|
|
825
840
|
type SessionEnd,
|
|
826
841
|
type SessionKind,
|
|
@@ -843,3 +858,4 @@ export {
|
|
|
843
858
|
WEEK_STARTS,
|
|
844
859
|
type WeekStart,
|
|
845
860
|
} from "./vocabulary.js";
|
|
861
|
+
export { BOARD_PARTS_FROM, type WakePart, wakePartsOf, wakeTextOf } from "./wake-text.js";
|