@personaai/react 0.9.0 → 0.11.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.
- package/README.md +210 -187
- package/dist/docs/.nojekyll +1 -0
- package/dist/index.cjs +1324 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +456 -13
- package/dist/index.d.ts +456 -13
- package/dist/index.js +1321 -254
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -343,6 +343,28 @@ interface UseChatOptions {
|
|
|
343
343
|
*/
|
|
344
344
|
context?: Record<string, unknown> | (() => Record<string, unknown>);
|
|
345
345
|
}
|
|
346
|
+
interface UseArchitectChatOptions {
|
|
347
|
+
threadId?: string;
|
|
348
|
+
initialMessages?: PersonaMessage[];
|
|
349
|
+
onFinish?: (message: PersonaMessage) => void;
|
|
350
|
+
onError?: (error: Error) => void;
|
|
351
|
+
/** Hook for receiving every low-level AG-UI streaming event (tool calls, steps, subagents) */
|
|
352
|
+
onEvent?: (event: PersonaStreamingEvent) => void;
|
|
353
|
+
/** Called when a fake/ephemeral chat mints a real thread on first send. Use to sync sidebar state (e.g. setThreadId(id)). */
|
|
354
|
+
onThreadCreated?: (threadId: string) => void;
|
|
355
|
+
/** Called when the backend auto-generates a thread title (3-4 word LLM summary of first user message). */
|
|
356
|
+
onTitle?: (title: string) => void;
|
|
357
|
+
}
|
|
358
|
+
interface SendArchitectMessageOverride {
|
|
359
|
+
/**
|
|
360
|
+
* A plain id, or a promise/thunk for one still in flight (e.g. a thread
|
|
361
|
+
* being lazily created for the first message of a new conversation).
|
|
362
|
+
* Mirrors {@link SendMessageOverride.threadId}.
|
|
363
|
+
*/
|
|
364
|
+
threadId?: string | Promise<string | undefined>;
|
|
365
|
+
/** Answers/approves a paused interrupt from a previous turn instead of starting a fresh one. */
|
|
366
|
+
resume?: PersonaResumeValue;
|
|
367
|
+
}
|
|
346
368
|
interface SendMessageOverride {
|
|
347
369
|
agentId?: string;
|
|
348
370
|
/**
|
|
@@ -598,6 +620,293 @@ interface UseWorkflowRunsOptions {
|
|
|
598
620
|
page?: number;
|
|
599
621
|
limit?: number;
|
|
600
622
|
}
|
|
623
|
+
/** Shared list envelope every Developer Platform discovery endpoint uses (Agents/Skills/Knowledge/MCP/Threads/Files). */
|
|
624
|
+
interface PersonaPagination {
|
|
625
|
+
total: number;
|
|
626
|
+
page: number;
|
|
627
|
+
limit: number;
|
|
628
|
+
pages: number;
|
|
629
|
+
}
|
|
630
|
+
/** `{ deleted, failed }` from a `POST .../bulk-delete` — a best-effort batch, not all-or-nothing; check `failed` for per-id reasons. */
|
|
631
|
+
interface PersonaBulkDeleteResult {
|
|
632
|
+
deleted: string[];
|
|
633
|
+
failed: Array<{
|
|
634
|
+
id: string;
|
|
635
|
+
reason: string;
|
|
636
|
+
}>;
|
|
637
|
+
}
|
|
638
|
+
/** A file bundled with a Skill (e.g. a reference doc or script an Agent can read). */
|
|
639
|
+
interface PersonaSkillFile {
|
|
640
|
+
path: string;
|
|
641
|
+
content: string;
|
|
642
|
+
mimeType?: string;
|
|
643
|
+
createdAt?: string;
|
|
644
|
+
updatedAt?: string;
|
|
645
|
+
}
|
|
646
|
+
interface PersonaSkill {
|
|
647
|
+
_id: string;
|
|
648
|
+
domain: string;
|
|
649
|
+
ownerType: "PersonaUser" | "Project" | "ExternalUser";
|
|
650
|
+
ownerId?: string;
|
|
651
|
+
externalOwnerId?: string;
|
|
652
|
+
name: string;
|
|
653
|
+
description: string;
|
|
654
|
+
instructions: string;
|
|
655
|
+
files: PersonaSkillFile[];
|
|
656
|
+
/** Visible to every credential in the platform when `true`, not just this Domain. */
|
|
657
|
+
isPublic: boolean;
|
|
658
|
+
createdAt: string;
|
|
659
|
+
updatedAt: string;
|
|
660
|
+
/** Present only on a single `getSkill()` read — whether the calling identity owns this Skill. */
|
|
661
|
+
isOwner?: boolean;
|
|
662
|
+
}
|
|
663
|
+
interface CreatePersonaSkillInput {
|
|
664
|
+
name: string;
|
|
665
|
+
description: string;
|
|
666
|
+
/** The actual prompt text given to an Agent that has this Skill attached. */
|
|
667
|
+
instructions: string;
|
|
668
|
+
/** @default false */
|
|
669
|
+
isPublic?: boolean;
|
|
670
|
+
files?: Array<{
|
|
671
|
+
path: string;
|
|
672
|
+
content: string;
|
|
673
|
+
mimeType?: string;
|
|
674
|
+
}>;
|
|
675
|
+
}
|
|
676
|
+
/** All fields optional — only what you pass is changed. */
|
|
677
|
+
interface UpdatePersonaSkillInput {
|
|
678
|
+
name?: string;
|
|
679
|
+
description?: string;
|
|
680
|
+
instructions?: string;
|
|
681
|
+
isPublic?: boolean;
|
|
682
|
+
/** Replaces the entire `files` array — not a merge/append. */
|
|
683
|
+
files?: Array<{
|
|
684
|
+
path: string;
|
|
685
|
+
content: string;
|
|
686
|
+
mimeType?: string;
|
|
687
|
+
}>;
|
|
688
|
+
}
|
|
689
|
+
/** Agents referencing a Skill — check before deleting it to avoid a blocked-delete error. */
|
|
690
|
+
interface PersonaSkillUsage {
|
|
691
|
+
/** The real total — `agents` below is a preview capped at 20. */
|
|
692
|
+
agentCount: number;
|
|
693
|
+
agents: Array<{
|
|
694
|
+
_id: string;
|
|
695
|
+
name: string;
|
|
696
|
+
}>;
|
|
697
|
+
}
|
|
698
|
+
interface UseSkillsOptions {
|
|
699
|
+
/** @default true */
|
|
700
|
+
autoFetch?: boolean;
|
|
701
|
+
page?: number;
|
|
702
|
+
limit?: number;
|
|
703
|
+
/** Free-text match against name/description. */
|
|
704
|
+
search?: string;
|
|
705
|
+
/** Restricts to the asserted external user's own Skills. Requires a `ProjectRuntimeContext` (i.e. `PersonaProvider` talking through an adapter with `resolveUserFrom`/`resolveUser`) — a no-op otherwise. */
|
|
706
|
+
scope?: "mine";
|
|
707
|
+
}
|
|
708
|
+
interface PersonaAgentSocialLinks {
|
|
709
|
+
website?: string;
|
|
710
|
+
twitter?: string;
|
|
711
|
+
github?: string;
|
|
712
|
+
linkedin?: string;
|
|
713
|
+
}
|
|
714
|
+
/** `unlisted` is reachable by direct link/id but excluded from public discovery listings. */
|
|
715
|
+
type PersonaAgentVisibility = "private" | "unlisted" | "public";
|
|
716
|
+
type PersonaAgentCategory = "productivity" | "coding" | "creative" | "research" | "roleplay" | "other";
|
|
717
|
+
/**
|
|
718
|
+
* Mirrors the real wire shape (`_id`, raw domain/ownerType fields) —
|
|
719
|
+
* `getAgent()` returns `skills`/`mcps`/`knowledgeBases` populated as
|
|
720
|
+
* objects, while `createAgent()`/`updateAgent()`/`agents` (from the list)
|
|
721
|
+
* return them as bare id strings; typed loosely (`unknown[]`) to reflect
|
|
722
|
+
* that real difference rather than picking one shape and being wrong for
|
|
723
|
+
* the other calls.
|
|
724
|
+
*/
|
|
725
|
+
interface PersonaAgent {
|
|
726
|
+
_id: string;
|
|
727
|
+
domain: string;
|
|
728
|
+
ownerType: "PersonaUser" | "Project" | "ExternalUser";
|
|
729
|
+
ownerId?: string;
|
|
730
|
+
externalOwnerId?: string;
|
|
731
|
+
name: string;
|
|
732
|
+
/** URL-safe, unique within the Domain; used in some public-facing routes. */
|
|
733
|
+
slug: string;
|
|
734
|
+
description?: string;
|
|
735
|
+
avatar?: string;
|
|
736
|
+
tags?: string[];
|
|
737
|
+
/** Short one-liner shown in list/card views. */
|
|
738
|
+
tagline?: string;
|
|
739
|
+
/** Longer free-text bio shown on the Agent's own profile view. */
|
|
740
|
+
bio?: string;
|
|
741
|
+
personalityTraits?: string[];
|
|
742
|
+
socialLinks?: PersonaAgentSocialLinks;
|
|
743
|
+
/** Stripped from the response when the calling identity doesn't own this Agent. */
|
|
744
|
+
systemPrompt?: string;
|
|
745
|
+
/** Stripped from the response when the calling identity doesn't own this Agent. */
|
|
746
|
+
providerId?: string;
|
|
747
|
+
/** Overrides the referenced Provider's `defaultModel` when set. */
|
|
748
|
+
modelName?: string;
|
|
749
|
+
webSearchEnabled: boolean;
|
|
750
|
+
/** Real shell execution in an isolated CodeSandbox VM — requires a `CSB_API_KEY` Project Secret to already exist. */
|
|
751
|
+
sandboxEnabled: boolean;
|
|
752
|
+
visibility: PersonaAgentVisibility;
|
|
753
|
+
category: PersonaAgentCategory;
|
|
754
|
+
skills?: unknown[];
|
|
755
|
+
mcps?: unknown[];
|
|
756
|
+
knowledgeBases?: unknown[];
|
|
757
|
+
storeMounts?: unknown[];
|
|
758
|
+
/** Maps a tool name to whether calling it pauses the run for human approval. */
|
|
759
|
+
interruptOn?: Record<string, boolean>;
|
|
760
|
+
isActive: boolean;
|
|
761
|
+
/** Whether this is the Project's designated default/primary Agent. */
|
|
762
|
+
isMainAgent: boolean;
|
|
763
|
+
createdAt: string;
|
|
764
|
+
updatedAt: string;
|
|
765
|
+
}
|
|
766
|
+
interface CreatePersonaAgentInput {
|
|
767
|
+
name: string;
|
|
768
|
+
/** The instructions that define this Agent's behavior/persona. */
|
|
769
|
+
systemPrompt: string;
|
|
770
|
+
/** Must reference a Provider the host Project already created. */
|
|
771
|
+
providerId: string;
|
|
772
|
+
description?: string;
|
|
773
|
+
avatar?: string;
|
|
774
|
+
tags?: string[];
|
|
775
|
+
tagline?: string;
|
|
776
|
+
bio?: string;
|
|
777
|
+
personalityTraits?: string[];
|
|
778
|
+
socialLinks?: PersonaAgentSocialLinks;
|
|
779
|
+
modelName?: string;
|
|
780
|
+
/** @default false */
|
|
781
|
+
webSearchEnabled?: boolean;
|
|
782
|
+
/** @default false */
|
|
783
|
+
sandboxEnabled?: boolean;
|
|
784
|
+
/** @default 'private' */
|
|
785
|
+
visibility?: PersonaAgentVisibility;
|
|
786
|
+
/** @default 'other' */
|
|
787
|
+
category?: PersonaAgentCategory;
|
|
788
|
+
/** Skill ids to attach at creation time. */
|
|
789
|
+
skills?: string[];
|
|
790
|
+
/** MCP server ids to attach at creation time. */
|
|
791
|
+
mcps?: string[];
|
|
792
|
+
/** Knowledge base ids to attach at creation time. */
|
|
793
|
+
knowledgeBases?: string[];
|
|
794
|
+
/** Store ids to mount at creation time. */
|
|
795
|
+
storeMounts?: string[];
|
|
796
|
+
interruptOn?: Record<string, boolean>;
|
|
797
|
+
/** @default true */
|
|
798
|
+
isActive?: boolean;
|
|
799
|
+
}
|
|
800
|
+
/** All fields optional — only what you pass is changed; array/map fields replace the whole value, not a merge/append. */
|
|
801
|
+
interface UpdatePersonaAgentInput {
|
|
802
|
+
name?: string;
|
|
803
|
+
description?: string;
|
|
804
|
+
avatar?: string;
|
|
805
|
+
tags?: string[];
|
|
806
|
+
tagline?: string;
|
|
807
|
+
bio?: string;
|
|
808
|
+
personalityTraits?: string[];
|
|
809
|
+
socialLinks?: PersonaAgentSocialLinks;
|
|
810
|
+
systemPrompt?: string;
|
|
811
|
+
providerId?: string;
|
|
812
|
+
modelName?: string;
|
|
813
|
+
webSearchEnabled?: boolean;
|
|
814
|
+
sandboxEnabled?: boolean;
|
|
815
|
+
skills?: string[];
|
|
816
|
+
mcps?: string[];
|
|
817
|
+
knowledgeBases?: string[];
|
|
818
|
+
storeMounts?: string[];
|
|
819
|
+
interruptOn?: Record<string, boolean>;
|
|
820
|
+
visibility?: PersonaAgentVisibility;
|
|
821
|
+
category?: PersonaAgentCategory;
|
|
822
|
+
isActive?: boolean;
|
|
823
|
+
}
|
|
824
|
+
interface UseAgentsOptions {
|
|
825
|
+
/** @default true */
|
|
826
|
+
autoFetch?: boolean;
|
|
827
|
+
page?: number;
|
|
828
|
+
limit?: number;
|
|
829
|
+
/** Free-text match against name/description/tagline. */
|
|
830
|
+
search?: string;
|
|
831
|
+
category?: PersonaAgentCategory;
|
|
832
|
+
/** Restricts to the asserted external user's own Agents. Requires a `ProjectRuntimeContext` — a no-op otherwise. */
|
|
833
|
+
scope?: "mine";
|
|
834
|
+
}
|
|
835
|
+
interface PersonaRcpSourceToolParamSummary {
|
|
836
|
+
name: string;
|
|
837
|
+
type: string;
|
|
838
|
+
description: string;
|
|
839
|
+
required: boolean;
|
|
840
|
+
}
|
|
841
|
+
/** A display cache only, written by `testRcpSourceConnection` — Agent execution discovers tools live via `rcp-sdk`, never reads this. */
|
|
842
|
+
interface PersonaRcpSourceToolSummary {
|
|
843
|
+
name: string;
|
|
844
|
+
description: string;
|
|
845
|
+
method: string;
|
|
846
|
+
url: string;
|
|
847
|
+
/** Every param this tool exposes (never resolver-filtered) — needed client-side to build `paramContextMap`. */
|
|
848
|
+
params: PersonaRcpSourceToolParamSummary[];
|
|
849
|
+
}
|
|
850
|
+
/** Maps one of this source's tool param names to a key sent in a message's per-turn `context` — see `SendMessageOverride.context`. Shared across every Agent this source is attached to, not per-attachment. */
|
|
851
|
+
interface PersonaRcpParamContextMapEntry {
|
|
852
|
+
param: string;
|
|
853
|
+
contextKey: string;
|
|
854
|
+
}
|
|
855
|
+
/** A hosted RCP (REST Connector Protocol, npm `rcp-sdk`) manifest URL Persona discovers tools from live on every Agent run. */
|
|
856
|
+
interface PersonaRcpSource {
|
|
857
|
+
_id: string;
|
|
858
|
+
domain: string;
|
|
859
|
+
ownerType: "PersonaUser" | "Project" | "ExternalUser";
|
|
860
|
+
ownerId?: string;
|
|
861
|
+
externalOwnerId?: string;
|
|
862
|
+
name: string;
|
|
863
|
+
description: string;
|
|
864
|
+
/** `GET url` must return a conformant `{ rcpVersion, auth, tools[] }` manifest. */
|
|
865
|
+
url: string;
|
|
866
|
+
authType: "none" | "header";
|
|
867
|
+
/** A Project Secret id — present only when `authType` is `'header'`. Never returns the secret's plaintext value. */
|
|
868
|
+
secretRef?: string | null;
|
|
869
|
+
isEnabled: boolean;
|
|
870
|
+
lastTestedAt?: string | null;
|
|
871
|
+
tools: PersonaRcpSourceToolSummary[];
|
|
872
|
+
paramContextMap: PersonaRcpParamContextMapEntry[];
|
|
873
|
+
createdAt: string;
|
|
874
|
+
updatedAt: string;
|
|
875
|
+
}
|
|
876
|
+
interface CreatePersonaRcpSourceInput {
|
|
877
|
+
name: string;
|
|
878
|
+
description?: string;
|
|
879
|
+
url: string;
|
|
880
|
+
/** @default 'none' */
|
|
881
|
+
authType?: "none" | "header";
|
|
882
|
+
/** A Project Secret id. Required when `authType` is `'header'`. */
|
|
883
|
+
secretRef?: string;
|
|
884
|
+
/** @default true */
|
|
885
|
+
isEnabled?: boolean;
|
|
886
|
+
paramContextMap?: PersonaRcpParamContextMapEntry[];
|
|
887
|
+
}
|
|
888
|
+
/** All fields optional — only what you pass is changed. */
|
|
889
|
+
interface UpdatePersonaRcpSourceInput {
|
|
890
|
+
name?: string;
|
|
891
|
+
description?: string;
|
|
892
|
+
url?: string;
|
|
893
|
+
authType?: "none" | "header";
|
|
894
|
+
secretRef?: string | null;
|
|
895
|
+
isEnabled?: boolean;
|
|
896
|
+
paramContextMap?: PersonaRcpParamContextMapEntry[];
|
|
897
|
+
}
|
|
898
|
+
/** From `testConnection()` — discovers the source's manifest live and persists it as the new display cache. */
|
|
899
|
+
interface PersonaRcpSourceTestResult {
|
|
900
|
+
tools: PersonaRcpSourceToolSummary[];
|
|
901
|
+
}
|
|
902
|
+
interface UseRcpSourcesOptions {
|
|
903
|
+
/** @default true */
|
|
904
|
+
autoFetch?: boolean;
|
|
905
|
+
page?: number;
|
|
906
|
+
limit?: number;
|
|
907
|
+
/** Free-text match against name. */
|
|
908
|
+
search?: string;
|
|
909
|
+
}
|
|
601
910
|
|
|
602
911
|
interface PersonaContextValue {
|
|
603
912
|
baseUrl: string;
|
|
@@ -638,6 +947,61 @@ declare function useChat(options?: UseChatOptions): {
|
|
|
638
947
|
loadThreadMessages: (id: string) => Promise<PersonaMessage[]>;
|
|
639
948
|
};
|
|
640
949
|
|
|
950
|
+
/**
|
|
951
|
+
* The Developer Platform Architect's own reserved Agent id
|
|
952
|
+
* (`DEVELOPER_ARCHITECT_AGENT_ID` in agent-backend/src/modules/agents/
|
|
953
|
+
* architectConstants.js) — it isn't a row in the Agent collection, but the
|
|
954
|
+
* backend's `POST /api/v1/developer/threads` special-cases exactly this id
|
|
955
|
+
* past its usual Agent-existence check (see developerThread.controller.js's
|
|
956
|
+
* `assertAgentAccessible`), so a named Architect Thread can be created the
|
|
957
|
+
* same way as for a real Agent. Kept in sync with that backend constant —
|
|
958
|
+
* update both together if it ever changes.
|
|
959
|
+
*/
|
|
960
|
+
declare const ARCHITECT_AGENT_ID = "000000000000000000000002";
|
|
961
|
+
/**
|
|
962
|
+
* Runs the Agent Architect co-pilot — a conversational tool-calling agent
|
|
963
|
+
* that creates/edits the caller's own Agents (`manage_agent`, `manage_skill`,
|
|
964
|
+
* etc.), reached over the runtime's `POST /architect` route (see
|
|
965
|
+
* `@personaai/runtime`'s `routes/architect.ts`). Structurally a trimmed
|
|
966
|
+
* `useChat`: same streaming/interrupt/reload/thread-resume mechanics, but
|
|
967
|
+
* with no `agentId` to pass (the Architect is a single fixed target) and no
|
|
968
|
+
* `voice`/`sandboxCommands` (the Architect has no voice mode and no
|
|
969
|
+
* `execute` tool).
|
|
970
|
+
*
|
|
971
|
+
* `threadId` resume only has an effect when the underlying credential
|
|
972
|
+
* asserts an external user — a bare Project credential has no Subject for a
|
|
973
|
+
* Thread to belong to, so the backend silently keeps its single
|
|
974
|
+
* deterministic per-Project conversation either way (see
|
|
975
|
+
* `developerArchitect.controller.js`'s doc comment).
|
|
976
|
+
*/
|
|
977
|
+
declare function useArchitectChat(options?: UseArchitectChatOptions): {
|
|
978
|
+
messages: PersonaMessage[];
|
|
979
|
+
input: string;
|
|
980
|
+
setInput: react.Dispatch<react.SetStateAction<string>>;
|
|
981
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
982
|
+
handleSubmit: (e?: React.FormEvent) => void;
|
|
983
|
+
sendMessage: (contentToSend?: string, overrideOptions?: SendArchitectMessageOverride) => Promise<boolean>;
|
|
984
|
+
isStreaming: boolean;
|
|
985
|
+
isLoading: boolean;
|
|
986
|
+
isLoadingHistory: boolean;
|
|
987
|
+
error: Error | null;
|
|
988
|
+
interrupt: PersonaInterrupt | null;
|
|
989
|
+
resumeInterrupt: (resume: PersonaResumeValue, displayContent: string) => Promise<boolean>;
|
|
990
|
+
files: Record<string, PersonaWorkspaceFile>;
|
|
991
|
+
todos: PersonaTodo[];
|
|
992
|
+
presentedFile: PersonaPresentedFile | null;
|
|
993
|
+
dismissPresentedFile: () => void;
|
|
994
|
+
openWorkspaceFile: (path: string) => void;
|
|
995
|
+
stop: () => void;
|
|
996
|
+
reload: () => Promise<boolean>;
|
|
997
|
+
clear: () => void;
|
|
998
|
+
startNewChat: () => void;
|
|
999
|
+
currentThreadId: string | undefined;
|
|
1000
|
+
isEphemeral: boolean;
|
|
1001
|
+
setMessages: react.Dispatch<react.SetStateAction<PersonaMessage[]>>;
|
|
1002
|
+
loadThreadMessages: (id: string) => Promise<PersonaMessage[]>;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
641
1005
|
declare function useMemory(autoFetch?: boolean): {
|
|
642
1006
|
memory: PersonaMemoryList;
|
|
643
1007
|
isLoading: boolean;
|
|
@@ -726,19 +1090,31 @@ declare function useFiles(autoFetch?: boolean): {
|
|
|
726
1090
|
getDownloadUrl: (fileId: string) => string;
|
|
727
1091
|
};
|
|
728
1092
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
1093
|
+
/**
|
|
1094
|
+
* Read-only discovery (`agents`) is always on. Create/update/delete/
|
|
1095
|
+
* bulk-delete/getAgent require the host's `createPersonaHandler`/
|
|
1096
|
+
* `createRuntime` to opt in with `capabilities: { agentsWrite: true }` —
|
|
1097
|
+
* every write route this hook calls 404s/is unreachable otherwise
|
|
1098
|
+
* (provisioning Agents is Project-level work the host must deliberately
|
|
1099
|
+
* turn on, not something a chat session gets by default).
|
|
1100
|
+
*
|
|
1101
|
+
* Ownership follows the same self-serve model as `useSkills`/`useWorkflows`:
|
|
1102
|
+
* pass `scope: 'mine'` to restrict `agents` to the asserted external user's
|
|
1103
|
+
* own Agents (only meaningful when `PersonaProvider` is wired through an
|
|
1104
|
+
* adapter that resolves a real end-user identity) — omit it to see every
|
|
1105
|
+
* Agent visible to this Project.
|
|
1106
|
+
*/
|
|
1107
|
+
declare function useAgents(options?: UseAgentsOptions | boolean): {
|
|
1108
|
+
agents: PersonaAgent[];
|
|
1109
|
+
pagination: PersonaPagination;
|
|
739
1110
|
isLoading: boolean;
|
|
740
1111
|
error: Error | null;
|
|
741
|
-
refetch: () => Promise<
|
|
1112
|
+
refetch: () => Promise<PersonaAgent[]>;
|
|
1113
|
+
getAgent: (agentId: string) => Promise<PersonaAgent>;
|
|
1114
|
+
createAgent: (input: CreatePersonaAgentInput) => Promise<PersonaAgent>;
|
|
1115
|
+
updateAgent: (agentId: string, input: UpdatePersonaAgentInput) => Promise<PersonaAgent>;
|
|
1116
|
+
deleteAgent: (agentId: string) => Promise<void>;
|
|
1117
|
+
bulkDeleteAgents: (ids: string[]) => Promise<PersonaBulkDeleteResult>;
|
|
742
1118
|
};
|
|
743
1119
|
|
|
744
1120
|
interface PersonaHealthInfo {
|
|
@@ -790,6 +1166,8 @@ declare function useMcpConnections(options?: UseMcpConnectionsOptions): {
|
|
|
790
1166
|
isLoading: boolean;
|
|
791
1167
|
error: Error | null;
|
|
792
1168
|
refetch: () => Promise<PersonaMcpConnection[]>;
|
|
1169
|
+
disconnect: (mcpId: string) => Promise<void>;
|
|
1170
|
+
isDisconnecting: boolean;
|
|
793
1171
|
};
|
|
794
1172
|
|
|
795
1173
|
interface UseMcpOptions {
|
|
@@ -805,6 +1183,71 @@ declare function useMcp(options?: UseMcpOptions): {
|
|
|
805
1183
|
callTool: (name: string, args?: Record<string, unknown>, mcpId?: string) => Promise<any>;
|
|
806
1184
|
};
|
|
807
1185
|
|
|
1186
|
+
/**
|
|
1187
|
+
* CRUD for Skills — a reusable instruction + optional file bundle an Agent
|
|
1188
|
+
* can be given. Requires the host's `createPersonaHandler`/`createRuntime`
|
|
1189
|
+
* to opt in with `capabilities: { skills: true }`; every route this hook
|
|
1190
|
+
* calls 404s/is unreachable otherwise (skill authoring is Project-level
|
|
1191
|
+
* content management the host must deliberately turn on, not something a
|
|
1192
|
+
* chat session gets by default).
|
|
1193
|
+
*
|
|
1194
|
+
* Ownership follows the same self-serve model as `useAgents`/`useWorkflows`:
|
|
1195
|
+
* pass `scope: 'mine'` to restrict `skills` to the asserted external user's
|
|
1196
|
+
* own Skills (only meaningful when `PersonaProvider` is wired through an
|
|
1197
|
+
* adapter that resolves a real end-user identity) — omit it to see every
|
|
1198
|
+
* Skill visible to this Project (its own, plus public ones).
|
|
1199
|
+
*/
|
|
1200
|
+
declare function useSkills(options?: UseSkillsOptions): {
|
|
1201
|
+
skills: PersonaSkill[];
|
|
1202
|
+
pagination: PersonaPagination;
|
|
1203
|
+
isLoading: boolean;
|
|
1204
|
+
error: Error | null;
|
|
1205
|
+
refetch: () => Promise<PersonaSkill[]>;
|
|
1206
|
+
getSkill: (skillId: string) => Promise<PersonaSkill>;
|
|
1207
|
+
createSkill: (input: CreatePersonaSkillInput) => Promise<PersonaSkill>;
|
|
1208
|
+
updateSkill: (skillId: string, input: UpdatePersonaSkillInput) => Promise<PersonaSkill>;
|
|
1209
|
+
deleteSkill: (skillId: string) => Promise<void>;
|
|
1210
|
+
bulkDeleteSkills: (ids: string[]) => Promise<PersonaBulkDeleteResult>;
|
|
1211
|
+
getSkillUsage: (skillId: string) => Promise<PersonaSkillUsage>;
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
interface PersonaResourceUsage {
|
|
1215
|
+
/** The real total — `agents` below is a preview capped at 20. */
|
|
1216
|
+
agentCount: number;
|
|
1217
|
+
agents: Array<{
|
|
1218
|
+
_id: string;
|
|
1219
|
+
name: string;
|
|
1220
|
+
}>;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* CRUD for RCP (REST Connector Protocol, npm `rcp-sdk`) sources — a hosted
|
|
1224
|
+
* manifest URL Persona discovers tools from live on every Agent run.
|
|
1225
|
+
* Requires the host's `createPersonaHandler`/`createRuntime` to opt in with
|
|
1226
|
+
* `capabilities: { rcpSources: true }`; every route this hook calls
|
|
1227
|
+
* 404s/is unreachable otherwise.
|
|
1228
|
+
*
|
|
1229
|
+
* Ownership follows the same self-serve model as `useSkills`/`useAgents`:
|
|
1230
|
+
* an RCP source can be owned by the Project or by the asserted external
|
|
1231
|
+
* user — but unlike Skills there's no `isPublic` concept here, so
|
|
1232
|
+
* `getRcpSource`/list only ever return sources the calling identity
|
|
1233
|
+
* actually owns (no server-side `scope: 'mine'` filter needed or
|
|
1234
|
+
* supported — every visible source already is "mine").
|
|
1235
|
+
*/
|
|
1236
|
+
declare function useRcpSources(options?: UseRcpSourcesOptions): {
|
|
1237
|
+
rcpSources: PersonaRcpSource[];
|
|
1238
|
+
pagination: PersonaPagination;
|
|
1239
|
+
isLoading: boolean;
|
|
1240
|
+
error: Error | null;
|
|
1241
|
+
refetch: () => Promise<PersonaRcpSource[]>;
|
|
1242
|
+
getRcpSource: (sourceId: string) => Promise<PersonaRcpSource>;
|
|
1243
|
+
createRcpSource: (input: CreatePersonaRcpSourceInput) => Promise<PersonaRcpSource>;
|
|
1244
|
+
updateRcpSource: (sourceId: string, input: UpdatePersonaRcpSourceInput) => Promise<PersonaRcpSource>;
|
|
1245
|
+
deleteRcpSource: (sourceId: string) => Promise<void>;
|
|
1246
|
+
bulkDeleteRcpSources: (ids: string[]) => Promise<PersonaBulkDeleteResult>;
|
|
1247
|
+
getRcpSourceUsage: (sourceId: string) => Promise<PersonaResourceUsage>;
|
|
1248
|
+
testRcpSourceConnection: (sourceId: string) => Promise<PersonaRcpSourceTestResult>;
|
|
1249
|
+
};
|
|
1250
|
+
|
|
808
1251
|
interface WorkflowsPagination {
|
|
809
1252
|
page: number;
|
|
810
1253
|
limit: number;
|
|
@@ -908,6 +1351,6 @@ declare function supportsStreamingFetch(): boolean;
|
|
|
908
1351
|
*/
|
|
909
1352
|
declare function openSSEStream(opts: OpenSSEOptions): Promise<SSEStream>;
|
|
910
1353
|
|
|
911
|
-
declare const VERSION = "0.
|
|
1354
|
+
declare const VERSION = "0.10.0";
|
|
912
1355
|
|
|
913
|
-
export { type CreateWorkflowInput, type OpenSSEOptions, type
|
|
1356
|
+
export { ARCHITECT_AGENT_ID, type CreatePersonaAgentInput, type CreatePersonaRcpSourceInput, type CreatePersonaSkillInput, type CreateWorkflowInput, type OpenSSEOptions, type PersonaAgent, type PersonaAgentCategory, type PersonaAgentSocialLinks, type PersonaAgentVisibility, type PersonaBulkDeleteResult, type PersonaClarificationQuestion, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaInterrupt, type PersonaMcpConnection, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaNodeRunState, type PersonaPagination, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaRcpParamContextMapEntry, type PersonaRcpSource, type PersonaRcpSourceTestResult, type PersonaRcpSourceToolParamSummary, type PersonaRcpSourceToolSummary, type PersonaResourceUsage, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaSkill, type PersonaSkillFile, type PersonaSkillUsage, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkflow, type PersonaWorkflowDraft, type PersonaWorkflowEdge, type PersonaWorkflowNode, type PersonaWorkflowNodeType, type PersonaWorkflowRunSummary, type PersonaWorkflowSummary, type PersonaWorkflowTrigger, type PersonaWorkflowVersionSummary, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendArchitectMessageOverride, type SendMessageOverride, type UpdatePersonaAgentInput, type UpdatePersonaRcpSourceInput, type UpdatePersonaSkillInput, type UpdateWorkflowInput, type UseAgentsOptions, type UseArchitectChatOptions, type UseChatOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseRcpSourcesOptions, type UseSkillsOptions, type UseVoiceOptions, type UseVoiceResult, type UseWorkflowOptions, type UseWorkflowRunsOptions, type UseWorkflowStreamOptions, type UseWorkflowStreamResult, type UseWorkflowsOptions, VERSION, type WorkflowsPagination, openSSEStream, supportsStreamingFetch, useAgents, useArchitectChat, useChat, useConnection, useFiles, useMcp, useMcpConnections, useMemory, usePersonaContext, useRcpSources, useSkills, useThreads, useVoice, useWorkflow, useWorkflowRuns, useWorkflowStream, useWorkflows };
|