@m6d/cortex 0.6.0 → 0.7.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/dist/index.d.ts CHANGED
@@ -1652,12 +1652,25 @@ export type StoredSchemaFieldRow = {
1652
1652
  };
1653
1653
  /** Each procedure's input, as it is sent, and output, as JSON carries it. */
1654
1654
  export type ManagementProcedures = {
1655
- /** Create an agent on a registered server. The draft has no prompt yet; save one with agents.savePrompt before publishing. */
1655
+ /** Give an agent an alias: a second slug it answers to wherever a slug is resolved. Refused (slug_taken) when an agent's slug or another alias holds the name; to move an alias, delete it and add it to the other agent. */
1656
+ "agents.addAlias": {
1657
+ input: {
1658
+ alias: string;
1659
+ agentId: string;
1660
+ };
1661
+ output: {
1662
+ alias: string;
1663
+ agentId: string;
1664
+ createdAt: string;
1665
+ updatedAt: string;
1666
+ };
1667
+ };
1668
+ /** Create an agent on a registered server, or on none (`serverId` null), fixed for good either way. An agent with no server has no native tools, no server variables and no server auth, and publishes only on a chat model of its own. The draft has no prompt yet; save one with agents.savePrompt before publishing. */
1656
1669
  "agents.create": {
1657
1670
  input: {
1658
1671
  slug: string;
1659
1672
  name: string;
1660
- serverId: string;
1673
+ serverId: string | null;
1661
1674
  };
1662
1675
  output: {
1663
1676
  id: string;
@@ -1666,7 +1679,7 @@ export type ManagementProcedures = {
1666
1679
  overridable: Array<string>;
1667
1680
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
1668
1681
  slug: string;
1669
- serverId: string;
1682
+ serverId: string | null;
1670
1683
  name: string;
1671
1684
  promptDraft: string;
1672
1685
  ragEnabled: boolean;
@@ -1711,7 +1724,7 @@ export type ManagementProcedures = {
1711
1724
  overridable: Array<string>;
1712
1725
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
1713
1726
  slug: string;
1714
- serverId: string;
1727
+ serverId: string | null;
1715
1728
  name: string;
1716
1729
  promptDraft: string;
1717
1730
  ragEnabled: boolean;
@@ -1743,6 +1756,18 @@ export type ManagementProcedures = {
1743
1756
  updatedAt: string;
1744
1757
  };
1745
1758
  };
1759
+ /** Remove an alias. */
1760
+ "agents.deleteAlias": {
1761
+ input: {
1762
+ alias: string;
1763
+ };
1764
+ output: {
1765
+ alias: string;
1766
+ agentId: string;
1767
+ createdAt: string;
1768
+ updatedAt: string;
1769
+ };
1770
+ };
1746
1771
  /** One agent by id, including its draft prompt and settings. */
1747
1772
  "agents.get": {
1748
1773
  input: {
@@ -1755,7 +1780,7 @@ export type ManagementProcedures = {
1755
1780
  overridable: Array<string>;
1756
1781
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
1757
1782
  slug: string;
1758
- serverId: string;
1783
+ serverId: string | null;
1759
1784
  name: string;
1760
1785
  promptDraft: string;
1761
1786
  ragEnabled: boolean;
@@ -1783,7 +1808,7 @@ export type ManagementProcedures = {
1783
1808
  summarizationModel: string | null;
1784
1809
  context: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1785
1810
  limits: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1786
- serverName: string;
1811
+ serverName: string | null;
1787
1812
  serverVerifies: boolean;
1788
1813
  variables: Array<{
1789
1814
  name: string;
@@ -1820,7 +1845,7 @@ export type ManagementProcedures = {
1820
1845
  source: "direct" | "manifest" | "server";
1821
1846
  sourceId: string | null;
1822
1847
  overridable: Array<string>;
1823
- serverName: string;
1848
+ serverName: string | null;
1824
1849
  published: boolean;
1825
1850
  toolCount: number;
1826
1851
  serviceCount: number;
@@ -1833,6 +1858,27 @@ export type ManagementProcedures = {
1833
1858
  filteredCount: number;
1834
1859
  };
1835
1860
  };
1861
+ /** List an agent's aliases (second slugs, unique across the deployment beside every agent's own), with pagination. */
1862
+ "agents.listAliases": {
1863
+ input: {
1864
+ pageIndex?: number;
1865
+ pageSize?: number;
1866
+ q?: string;
1867
+ agentId: string;
1868
+ };
1869
+ output: {
1870
+ items: Array<{
1871
+ alias: string;
1872
+ agentId: string;
1873
+ createdAt: string;
1874
+ updatedAt: string;
1875
+ }>;
1876
+ /** Every row the caller may see, ignoring the search and filters. */
1877
+ count: number;
1878
+ /** The rows matching the search and filters, over all pages: the total to report. */
1879
+ filteredCount: number;
1880
+ };
1881
+ };
1836
1882
  /** Agent id, slug, and name pairs for selectors. */
1837
1883
  "agents.options": {
1838
1884
  input: undefined;
@@ -1840,7 +1886,7 @@ export type ManagementProcedures = {
1840
1886
  id: string;
1841
1887
  slug: string;
1842
1888
  name: string;
1843
- serverId: string;
1889
+ serverId: string | null;
1844
1890
  }>;
1845
1891
  };
1846
1892
  /** Publish the agent's current draft prompt and settings so Cortex serves them. Refused as `auth_required` while the agent's end-user authentication is unchosen, and as `chat_model_required` when neither the agent nor its server picks a chat model. `warnings` says what the publish went ahead despite: published tools the prompt names without an @-mention (neither pinned nor mentioned by a skill it mentions), which the agent usually cannot see. */
@@ -1894,7 +1940,7 @@ export type ManagementProcedures = {
1894
1940
  overridable: Array<string>;
1895
1941
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
1896
1942
  slug: string;
1897
- serverId: string;
1943
+ serverId: string | null;
1898
1944
  name: string;
1899
1945
  promptDraft: string;
1900
1946
  ragEnabled: boolean;
@@ -2004,7 +2050,7 @@ export type ManagementProcedures = {
2004
2050
  overridable: Array<string>;
2005
2051
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
2006
2052
  slug: string;
2007
- serverId: string;
2053
+ serverId: string | null;
2008
2054
  name: string;
2009
2055
  promptDraft: string;
2010
2056
  ragEnabled: boolean;
@@ -2049,7 +2095,7 @@ export type ManagementProcedures = {
2049
2095
  overridable: Array<string>;
2050
2096
  applied: string | number | boolean | null | Record<string, unknown> | Array<unknown> | null;
2051
2097
  slug: string;
2052
- serverId: string;
2098
+ serverId: string | null;
2053
2099
  name: string;
2054
2100
  promptDraft: string;
2055
2101
  ragEnabled: boolean;
@@ -2912,7 +2958,7 @@ export type ManagementProcedures = {
2912
2958
  agents?: Array<{
2913
2959
  slug: string;
2914
2960
  name: string;
2915
- server: string;
2961
+ server?: string;
2916
2962
  prompt: string;
2917
2963
  auth: {
2918
2964
  kind: "jwks";
@@ -3437,7 +3483,7 @@ export type ManagementProcedures = {
3437
3483
  agents?: Array<{
3438
3484
  slug: string;
3439
3485
  name: string;
3440
- server: string;
3486
+ server?: string;
3441
3487
  prompt: string;
3442
3488
  auth: {
3443
3489
  kind: "jwks";
@@ -4396,7 +4442,7 @@ export type ManagementProcedures = {
4396
4442
  outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
4397
4443
  reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
4398
4444
  output: unknown;
4399
- serverName: string;
4445
+ serverName: string | null;
4400
4446
  agentSlug: string;
4401
4447
  agentName: string;
4402
4448
  threadTitle: string | null;
@@ -4432,8 +4478,8 @@ export type ManagementProcedures = {
4432
4478
  activeUsers: number;
4433
4479
  };
4434
4480
  perUser: Array<{
4435
- serverId: string;
4436
- serverName: string;
4481
+ scopeId: string;
4482
+ scopeName: string;
4437
4483
  userId: string;
4438
4484
  triggerName: string | null;
4439
4485
  threads: number;
@@ -4445,8 +4491,8 @@ export type ManagementProcedures = {
4445
4491
  messages: number;
4446
4492
  }>;
4447
4493
  perServer: Array<{
4448
- serverId: string;
4449
- serverName: string;
4494
+ serverId: string | null;
4495
+ serverName: string | null;
4450
4496
  totalTokens: number;
4451
4497
  }>;
4452
4498
  perAgent: Array<{
@@ -4484,7 +4530,7 @@ export type ManagementProcedures = {
4484
4530
  detail: string | null;
4485
4531
  threadId: string;
4486
4532
  createdAt: string;
4487
- serverName: string;
4533
+ serverName: string | null;
4488
4534
  agentSlug: string;
4489
4535
  agentName: string;
4490
4536
  threadTitle: string | null;
@@ -4666,7 +4712,7 @@ export type ManagementProcedures = {
4666
4712
  outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
4667
4713
  reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
4668
4714
  output: unknown;
4669
- serverName: string;
4715
+ serverName: string | null;
4670
4716
  agentSlug: string;
4671
4717
  agentName: string;
4672
4718
  threadTitle: string | null;
@@ -4981,18 +5027,6 @@ export type ManagementProcedures = {
4981
5027
  updatedAt: string;
4982
5028
  };
4983
5029
  };
4984
- /** Remove an alias. */
4985
- "servers.deleteAlias": {
4986
- input: {
4987
- alias: string;
4988
- };
4989
- output: {
4990
- alias: string;
4991
- agentId: string;
4992
- createdAt: string;
4993
- updatedAt: string;
4994
- };
4995
- };
4996
5030
  /** One server by id with its declared variables and the components whose audience is the server. */
4997
5031
  "servers.get": {
4998
5032
  input: {
@@ -5055,27 +5089,6 @@ export type ManagementProcedures = {
5055
5089
  filteredCount: number;
5056
5090
  };
5057
5091
  };
5058
- /** List the aliases (second slugs, unique across the deployment beside every agent's own) of a server's agents, with pagination. */
5059
- "servers.listAliases": {
5060
- input: {
5061
- pageIndex?: number;
5062
- pageSize?: number;
5063
- q?: string;
5064
- serverId: string;
5065
- };
5066
- output: {
5067
- items: Array<{
5068
- alias: string;
5069
- agentId: string;
5070
- agentName: string;
5071
- agentSlug: string;
5072
- }>;
5073
- /** Every row the caller may see, ignoring the search and filters. */
5074
- count: number;
5075
- /** The rows matching the search and filters, over all pages: the total to report. */
5076
- filteredCount: number;
5077
- };
5078
- };
5079
5092
  /** Server id and name pairs for selectors. Cortex's own system server is left out unless `includeSystem` asks for it, as a filter over its threads does. */
5080
5093
  "servers.options": {
5081
5094
  input: {
@@ -5086,17 +5099,6 @@ export type ManagementProcedures = {
5086
5099
  name: string;
5087
5100
  }>;
5088
5101
  };
5089
- /** Point an alias at an agent, creating it or moving it among the agents of one server. Refused (slug_taken) when an agent goes by the name or it is an alias of another server's agent. */
5090
- "servers.setAlias": {
5091
- input: {
5092
- alias: string;
5093
- agentId: string;
5094
- };
5095
- output: {
5096
- alias: string;
5097
- agentId: string;
5098
- };
5099
- };
5100
5102
  /** Read the server's manifest now and apply its variables and native tools; a refused manifest leaves the previous one in place. */
5101
5103
  "servers.sync": {
5102
5104
  input: {
@@ -5640,8 +5642,8 @@ export type ManagementProcedures = {
5640
5642
  triggerName: string | null;
5641
5643
  createdAt: string;
5642
5644
  updatedAt: string;
5643
- serverId: string;
5644
- serverName: string;
5645
+ serverId: string | null;
5646
+ serverName: string | null;
5645
5647
  agentSlug: string;
5646
5648
  agentId: string;
5647
5649
  agentName: string;
@@ -5679,8 +5681,8 @@ export type ManagementProcedures = {
5679
5681
  triggerName: string | null;
5680
5682
  createdAt: string;
5681
5683
  updatedAt: string;
5682
- serverId: string;
5683
- serverName: string;
5684
+ serverId: string | null;
5685
+ serverName: string | null;
5684
5686
  agentSlug: string;
5685
5687
  }>;
5686
5688
  /** Every row the caller may see, ignoring the search and filters. */
@@ -7182,10 +7184,19 @@ export declare class ManagementClientError extends Error {
7182
7184
  readonly refusal?: string | undefined;
7183
7185
  constructor(status: number, code: string, message: string, detail?: Record<string, unknown> | undefined, refusal?: string | undefined);
7184
7186
  }
7185
- /** Where management calls go: a console's origin and a management key (`cortex_mgmt_…`); a test hands in its own `fetch`. */
7187
+ /**
7188
+ * Where management calls go: a console's origin and a management key
7189
+ * (`cortex_mgmt_…`); a test hands in its own `fetch`. `locale` (`ar`) and
7190
+ * `timeZone` (an IANA zone, `Asia/Dubai`) are the caller's, sent as
7191
+ * `Accept-Language` and `X-Cortex-Timezone`: Cortex words its refusals in
7192
+ * the one and reads a day range in the other, else English and UTC days. A
7193
+ * host acting for many users builds a client per request.
7194
+ */
7186
7195
  export type ManagementTarget = {
7187
7196
  url: string;
7188
7197
  key: string;
7198
+ locale?: string;
7199
+ timeZone?: string;
7189
7200
  fetch?: (url: string, init: RequestInit) => Promise<Response>;
7190
7201
  };
7191
7202
  export type ManagementProcedure = keyof ManagementProcedures;
@@ -7666,6 +7677,7 @@ declare const manifestToolSchema: z.ZodDiscriminatedUnion<[
7666
7677
  required: z.ZodOptional<z.ZodArray<z.ZodString>>;
7667
7678
  "x-order": z.ZodOptional<z.ZodArray<z.ZodString>>;
7668
7679
  }, z.core.$strict>>;
7680
+ url: z.ZodURL;
7669
7681
  headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
7670
7682
  header: z.ZodString;
7671
7683
  prefix: z.ZodDefault<z.ZodString>;
@@ -7727,7 +7739,6 @@ declare const manifestToolSchema: z.ZodDiscriminatedUnion<[
7727
7739
  maxResponseBytes: z.ZodDefault<z.ZodNumber>;
7728
7740
  pinned: z.ZodDefault<z.ZodBoolean>;
7729
7741
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
7730
- url: z.ZodURL;
7731
7742
  audience: z.ZodUnion<readonly [
7732
7743
  z.ZodLiteral<"all">,
7733
7744
  z.ZodObject<{
@@ -9054,7 +9065,7 @@ export type ManifestCollection = z.input<typeof manifestCollectionSchema>;
9054
9065
  declare const manifestAgentSchema: z.ZodObject<{
9055
9066
  slug: z.ZodString;
9056
9067
  name: z.ZodString;
9057
- server: z.ZodString;
9068
+ server: z.ZodOptional<z.ZodString>;
9058
9069
  prompt: z.ZodString;
9059
9070
  auth: z.ZodDiscriminatedUnion<[
9060
9071
  z.ZodObject<{
@@ -9169,7 +9180,7 @@ declare const manifestSchema: z.ZodObject<{
9169
9180
  agents: z.ZodDefault<z.ZodArray<z.ZodObject<{
9170
9181
  slug: z.ZodString;
9171
9182
  name: z.ZodString;
9172
- server: z.ZodString;
9183
+ server: z.ZodOptional<z.ZodString>;
9173
9184
  prompt: z.ZodString;
9174
9185
  auth: z.ZodDiscriminatedUnion<[
9175
9186
  z.ZodObject<{
@@ -9734,6 +9745,7 @@ declare const manifestSchema: z.ZodObject<{
9734
9745
  required: z.ZodOptional<z.ZodArray<z.ZodString>>;
9735
9746
  "x-order": z.ZodOptional<z.ZodArray<z.ZodString>>;
9736
9747
  }, z.core.$strict>>;
9748
+ url: z.ZodURL;
9737
9749
  headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
9738
9750
  header: z.ZodString;
9739
9751
  prefix: z.ZodDefault<z.ZodString>;
@@ -9795,7 +9807,6 @@ declare const manifestSchema: z.ZodObject<{
9795
9807
  maxResponseBytes: z.ZodDefault<z.ZodNumber>;
9796
9808
  pinned: z.ZodDefault<z.ZodBoolean>;
9797
9809
  tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
9798
- url: z.ZodURL;
9799
9810
  audience: z.ZodUnion<readonly [
9800
9811
  z.ZodLiteral<"all">,
9801
9812
  z.ZodObject<{
@@ -11182,7 +11193,6 @@ export declare function defineManifest(manifest: Manifest): {
11182
11193
  agents?: {
11183
11194
  slug: string;
11184
11195
  name: string;
11185
- server: string;
11186
11196
  prompt: string;
11187
11197
  auth: {
11188
11198
  kind: "jwks";
@@ -11206,6 +11216,7 @@ export declare function defineManifest(manifest: Manifest): {
11206
11216
  } | {
11207
11217
  kind: "server";
11208
11218
  };
11219
+ server?: string | undefined;
11209
11220
  models?: {
11210
11221
  chat?: {
11211
11222
  provider: string;