@agimon-ai/po 0.0.0-alpha.194 → 0.0.0-alpha.196

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 (92) hide show
  1. package/LICENSE +110 -149
  2. package/README.md +1 -1
  3. package/dist/bin/cli.cjs +3 -1
  4. package/dist/bin/cli.cjs.map +1 -1
  5. package/dist/bin/cli.mjs +3 -1
  6. package/dist/bin/cli.mjs.map +1 -1
  7. package/dist/bin/poRunner.cjs +1 -1
  8. package/dist/bin/poRunner.mjs +1 -1
  9. package/dist/builders/cli/extensionAssembler/index.cjs +2 -1
  10. package/dist/builders/cli/extensionAssembler/index.cjs.map +1 -1
  11. package/dist/builders/cli/extensionAssembler/index.d.mts.map +1 -1
  12. package/dist/builders/cli/extensionAssembler/index.mjs +2 -1
  13. package/dist/builders/cli/extensionAssembler/index.mjs.map +1 -1
  14. package/dist/catalog/index.json +150 -120
  15. package/dist/package.cjs +1 -1
  16. package/dist/package.mjs +1 -1
  17. package/dist/src/bin/agentDirectory.cjs +3 -3
  18. package/dist/src/bin/agentDirectory.mjs +2 -2
  19. package/dist/src/builders/apiContractExport/index.cjs +1 -1
  20. package/dist/src/builders/apiContractExport/index.mjs +1 -1
  21. package/dist/src/builders/cli/entryResolution.cjs +1 -1
  22. package/dist/src/builders/cli/entryResolution.mjs +1 -1
  23. package/dist/src/builders/cli/harnessContext.cjs +2 -2
  24. package/dist/src/builders/cli/harnessContext.mjs +1 -1
  25. package/dist/src/builders/npm/index.cjs +1 -1
  26. package/dist/src/builders/npm/index.mjs +1 -1
  27. package/dist/src/builders/server/capabilities.cjs +1 -1
  28. package/dist/src/builders/server/capabilities.mjs +1 -1
  29. package/dist/src/builders/server/computerUseBinding.cjs +2 -2
  30. package/dist/src/builders/server/computerUseBinding.mjs +1 -1
  31. package/dist/src/builders/server/computerUseRecordings.cjs +2 -2
  32. package/dist/src/builders/server/computerUseRecordings.mjs +1 -1
  33. package/dist/src/builders/server/nativePush.cjs +30 -18
  34. package/dist/src/builders/server/nativePush.cjs.map +1 -1
  35. package/dist/src/builders/server/nativePush.mjs +30 -18
  36. package/dist/src/builders/server/nativePush.mjs.map +1 -1
  37. package/dist/src/builders/server/packageUrl.cjs +1 -1
  38. package/dist/src/builders/server/packageUrl.mjs +1 -1
  39. package/dist/src/builders/server/runtime.cjs +4 -3
  40. package/dist/src/builders/server/runtime.cjs.map +1 -1
  41. package/dist/src/builders/server/runtime.mjs +3 -2
  42. package/dist/src/builders/server/runtime.mjs.map +1 -1
  43. package/dist/src/builders/web/webPluginGenerate.cjs +1 -1
  44. package/dist/src/builders/web/webPluginGenerate.mjs +1 -1
  45. package/dist/src/cli/commands/api-export/index.cjs +2 -2
  46. package/dist/src/cli/commands/api-export/index.mjs +1 -1
  47. package/dist/src/cli/commands/doctor/help.cjs +3 -2
  48. package/dist/src/cli/commands/doctor/help.cjs.map +1 -1
  49. package/dist/src/cli/commands/doctor/help.d.mts.map +1 -1
  50. package/dist/src/cli/commands/doctor/help.mjs +3 -2
  51. package/dist/src/cli/commands/doctor/help.mjs.map +1 -1
  52. package/dist/src/cli/commands/doctor/index.cjs +2 -2
  53. package/dist/src/cli/commands/doctor/index.mjs +1 -1
  54. package/dist/src/cli/commands/init/help.cjs +3 -2
  55. package/dist/src/cli/commands/init/help.cjs.map +1 -1
  56. package/dist/src/cli/commands/init/help.d.mts.map +1 -1
  57. package/dist/src/cli/commands/init/help.mjs +3 -2
  58. package/dist/src/cli/commands/init/help.mjs.map +1 -1
  59. package/dist/src/cli/commands/init/index.cjs +2 -2
  60. package/dist/src/cli/commands/init/index.mjs +1 -1
  61. package/dist/src/cli/commands/sync/help.cjs +3 -2
  62. package/dist/src/cli/commands/sync/help.cjs.map +1 -1
  63. package/dist/src/cli/commands/sync/help.d.mts.map +1 -1
  64. package/dist/src/cli/commands/sync/help.mjs +3 -2
  65. package/dist/src/cli/commands/sync/help.mjs.map +1 -1
  66. package/dist/src/cli/commands/sync/index.cjs +2 -2
  67. package/dist/src/cli/commands/sync/index.mjs +1 -1
  68. package/dist/src/cli/harnessOptions.cjs +2 -2
  69. package/dist/src/cli/harnessOptions.mjs +1 -1
  70. package/dist/src/cli/help.cjs +3 -2
  71. package/dist/src/cli/help.cjs.map +1 -1
  72. package/dist/src/cli/help.d.mts.map +1 -1
  73. package/dist/src/cli/help.mjs +3 -2
  74. package/dist/src/cli/help.mjs.map +1 -1
  75. package/dist/src/cli/locale.cjs +41 -0
  76. package/dist/src/cli/locale.cjs.map +1 -0
  77. package/dist/src/cli/locale.mjs +37 -0
  78. package/dist/src/cli/locale.mjs.map +1 -0
  79. package/dist/src/cli/server/processGuards.cjs +1 -1
  80. package/dist/src/cli/server/processGuards.mjs +1 -1
  81. package/dist/src/cli/server/run.cjs +2 -2
  82. package/dist/src/cli/server/run.mjs +1 -1
  83. package/dist/src/composition/layerPackageInstaller/index.cjs +4 -4
  84. package/dist/src/composition/layerPackageInstaller/index.cjs.map +1 -1
  85. package/dist/src/composition/layerPackageInstaller/index.mjs +3 -3
  86. package/dist/src/composition/layerPackageInstaller/index.mjs.map +1 -1
  87. package/dist/src/composition/pluginMarketplace/index.cjs +2 -2
  88. package/dist/src/composition/pluginMarketplace/index.mjs +2 -2
  89. package/dist/src/composition/syncPrune/index.cjs +1 -1
  90. package/dist/src/composition/syncPrune/index.mjs +1 -1
  91. package/docs/server/index.md +1 -1
  92. package/package.json +38 -37
package/LICENSE CHANGED
@@ -1,149 +1,110 @@
1
- License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
- "Business Source License" is a trademark of MariaDB Corporation Ab.
3
-
4
- Parameters
5
-
6
- Licensor: Agimon Pty Ltd
7
- Licensed Work: Po, the software in the Po source repository and the
8
- packages released from it, in each version released by
9
- the Licensor.
10
- The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
- Material identified as third-party in the "Third-party
12
- components" section at the end of this file or in a
13
- NOTICE file, and any package or directory whose own
14
- license file grants a different license, is not part of
15
- the Licensed Work and remains under its own license.
16
- Additional Use Grant: You may make production use of the Licensed Work if
17
- your use is Eligible Use. "Eligible Use" is production use that falls
18
- within at least one of the following:
19
-
20
- (a) Personal Use. Use by an individual for their own personal purposes,
21
- and not on behalf of, or for the benefit of, an employer, client, or
22
- other Organization. Use by an individual in the course of employment
23
- or engagement by an Organization is use by that Organization.
24
-
25
- (b) Small Organization Use. Use by or on behalf of an Organization whose
26
- Annual Revenue is less than USD 1,000,000.
27
-
28
- (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
- Revenue, by (i) an Organization registered or recognized as a
30
- non-profit or charitable organization under the laws of its
31
- jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
- college, or university, for teaching, learning, or academic research;
33
- or (iii) a publicly funded research institution, for its research.
34
-
35
- (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
- service provider, regardless of its own Annual Revenue, solely to
37
- build, deploy, host, operate, or support the Licensed Work for a client
38
- whose own use would be Eligible Use under (a), (b), or (c). A service
39
- provider's use for its own purposes is Eligible Use only if the service
40
- provider itself qualifies under (b) or (c).
41
-
42
-
43
- Hosted services. Offering the Licensed Work to third parties as a hosted
44
- or managed service whose primary value is the Licensed Work is Eligible
45
- Use only if each such third party's own use would be Eligible Use.
46
-
47
- Definitions. "Organization" means any company, partnership, sole
48
- proprietorship, trust, association, government body, or other entity, and
49
- includes an individual acting in a business or professional capacity.
50
- "Affiliate" means any entity that directly or indirectly controls, is
51
- controlled by, or is under common control with an Organization, where
52
- "control" means ownership of more than 50% of the voting interests of an
53
- entity or the power to direct its management and policies by contract or
54
- otherwise. "Annual Revenue" means the total gross revenue of an
55
- Organization and all of its Affiliates combined, from all sources and
56
- whether or not related to the Licensed Work, for its most recently
57
- completed fiscal year, or, if it has not completed a fiscal year, for the
58
- twelve months before the use (or since its formation, if shorter),
59
- converted into US dollars at the average exchange rate for that period.
60
- Proceeds of equity or debt financing are not revenue.
61
-
62
- Threshold. If an Organization stops qualifying under (b), its existing
63
- production use remains Eligible Use for 90 days after it stops
64
- qualifying, after which it must obtain a commercial license or stop
65
- production use. Use that was Eligible Use when it occurred never requires
66
- a commercial license after the fact.
67
- Change Date: Four years from the date a version of the Licensed Work
68
- is first publicly released by the Licensor.
69
- Change License: Apache License, Version 2.0
70
-
71
- For information about alternative licensing arrangements for the Licensed
72
- Work, please visit: https://agimon.ai/licensing
73
-
74
- Notice
75
-
76
- The Business Source License (this document, or the "License") is not an Open
77
- Source license. However, the Licensed Work will eventually be made available
78
- under an Open Source License, as stated in this License.
79
-
80
- -----------------------------------------------------------------------------
81
-
82
- Business Source License 1.1
83
-
84
- Terms
85
-
86
- The Licensor hereby grants you the right to copy, modify, create derivative
87
- works, redistribute, and make non-production use of the Licensed Work. The
88
- Licensor may make an Additional Use Grant, above, permitting limited
89
- production use.
90
-
91
- Effective on the Change Date, or the fourth anniversary of the first publicly
92
- available distribution of a specific version of the Licensed Work under this
93
- License, whichever comes first, the Licensor hereby grants you rights under
94
- the terms of the Change License, and the rights granted in the paragraph
95
- above terminate.
96
-
97
- If your use of the Licensed Work does not comply with the requirements
98
- currently in effect as described in this License, you must purchase a
99
- commercial license from the Licensor, its affiliated entities, or authorized
100
- resellers, or you must refrain from using the Licensed Work.
101
-
102
- All copies of the original and modified Licensed Work, and derivative works
103
- of the Licensed Work, are subject to this License. This License applies
104
- separately for each version of the Licensed Work and the Change Date may vary
105
- for each version of the Licensed Work released by Licensor.
106
-
107
- You must conspicuously display this License on each original or modified copy
108
- of the Licensed Work. If you receive the Licensed Work in original or
109
- modified form from a third party, the terms and conditions set forth in this
110
- License apply to your use of that work.
111
-
112
- Any use of the Licensed Work in violation of this License will automatically
113
- terminate your rights under this License for the current and all other
114
- versions of the Licensed Work.
115
-
116
- This License does not grant you any right in any trademark or logo of
117
- Licensor or its affiliates (provided that you may use a trademark or logo of
118
- Licensor as expressly required by this License).
119
-
120
- TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
- AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
- EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
- TITLE.
125
-
126
- MariaDB hereby grants you permission to use this License’s text to license
127
- your works, and to refer to it using the trademark “Business Source License”,
128
- as long as you comply with the Covenants of Licensor below.
129
-
130
- Covenants of Licensor
131
-
132
- In consideration of the right to use this License’s text and the “Business
133
- Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
- other recipients of the licensed work to be provided by Licensor:
135
-
136
- 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
- or a license that is compatible with GPL Version 2.0 or a later version,
138
- where “compatible” means that software provided under the Change License can
139
- be included in a program with software provided under GPL Version 2.0 or a
140
- later version. Licensor may specify additional Change Licenses without
141
- limitation.
142
-
143
- 2. To either: (a) specify an additional grant of rights to use that does not
144
- impose any additional restriction on the right granted in this License, as
145
- the Additional Use Grant; or (b) insert the text “None”.
146
-
147
- 3. To specify a Change Date.
148
-
149
- 4. Not to modify this License in any other way.
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Agimon Pty Ltd
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
package/README.md CHANGED
@@ -70,4 +70,4 @@ Shared contract packages (`po-core` and `po-hashline`) must be available before
70
70
 
71
71
  ## License
72
72
 
73
- Business Source License 1.1: free for personal use, organisations under USD 1M revenue, non-profits and education. See [LICENSE](LICENSE) and https://agimon.ai/licensing.
73
+ Functional Source License 1.1, MIT Future License (FSL-1.1-MIT): free for any purpose except a Competing Use; each version converts to MIT two years after release. See [LICENSE](LICENSE).
package/dist/bin/cli.cjs CHANGED
@@ -3,9 +3,9 @@ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
3
3
  const require_agentDirectory = require("../src/bin/agentDirectory.cjs");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_runtime.__toESM(node_path, 1);
6
+ let node_url = require("node:url");
6
7
  let node_fs_promises = require("node:fs/promises");
7
8
  node_fs_promises = require_runtime.__toESM(node_fs_promises, 1);
8
- let node_url = require("node:url");
9
9
  //#region src/bin/cli.ts
10
10
  /**
11
11
  * CLI Entry Point for po
@@ -25,6 +25,8 @@ async function main() {
25
25
  return;
26
26
  }
27
27
  }
28
+ const { loadCliLocale } = await Promise.resolve().then(() => require("../src/cli/locale.cjs"));
29
+ await loadCliLocale(process.env);
28
30
  const { HARNESS_VERSION, printHelp } = await Promise.resolve().then(() => require("../src/cli/help.cjs"));
29
31
  const { informationalRequest, routeCommand } = await Promise.resolve().then(() => require("../src/cli/router.cjs"));
30
32
  const args = process.argv.slice(2);
@@ -1 +1 @@
1
- {"version":3,"file":"cli.cjs","names":["initializeAgentDirectory","testRoot","path","fs","fileURLToPath","pathToFileURL"],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * CLI Entry Point for po\n *\n * The executable installed as the `po` binary, and the file the repository\n * launcher (pi.sh) invoke directly from source.\n */\n\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nimport { initializeAgentDirectory, testRoot } from './agentDirectory';\n\nasync function main(): Promise<number | undefined> {\n await initializeAgentDirectory();\n if (testRoot) {\n const target = path.join(testRoot, 'packages/cli/po/dist/bin/cli.mjs');\n const realTarget = await fs.realpath(target).catch((error: NodeJS.ErrnoException) => {\n if (error.code === 'ENOENT')\n throw new Error(`Local test CLI build is missing: ${target}. Build @agimon-ai/po first.`);\n throw error;\n });\n if (realTarget !== (await fs.realpath(fileURLToPath(import.meta.url)))) {\n await import(pathToFileURL(target).href);\n return;\n }\n }\n const { HARNESS_VERSION, printHelp } = await import('../cli/help');\n const { informationalRequest, routeCommand } = await import('../cli/router');\n\n const args = process.argv.slice(2);\n // A named subcommand parses its own arguments, including its own --help, so the\n // fast path below must not answer for it.\n const ownsArguments = routeCommand(args) !== undefined;\n\n // Keep informational startup independent from telemetry, configuration, Pi,\n // and the extension compiler. Those graphs are useful for a real command but\n // used to account for almost all of `po --help` and `po --version`.\n const informational = ownsArguments ? undefined : informationalRequest(args);\n const informationalExit =\n informational === 'help'\n ? (() => {\n printHelp();\n return 0;\n })()\n : informational === 'version'\n ? (() => {\n process.stdout.write(`${HARNESS_VERSION}\\n`);\n return 0;\n })()\n : undefined;\n\n const run =\n informationalExit === undefined\n ? import('../cli/cliApp').then(({ runCli }) => runCli(args))\n : Promise.resolve(informationalExit);\n\n return run;\n}\n\nmain().then(\n (exitCode) => {\n if (exitCode !== undefined) process.exitCode = exitCode;\n },\n (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`[po] ${message}\\n`);\n process.exitCode = 1;\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;AAeA,eAAe,OAAoC;CACjD,MAAMA,uBAAAA,yBAAyB;CAC/B,IAAIC,uBAAAA,UAAU;EACZ,MAAM,SAASC,UAAAA,QAAK,KAAKD,uBAAAA,UAAU,kCAAkC;EAMrE,IAAI,MALqBE,iBAAAA,QAAG,SAAS,MAAM,CAAC,CAAC,OAAO,UAAiC;GACnF,IAAI,MAAM,SAAS,UACjB,MAAM,IAAI,MAAM,oCAAoC,OAAO,6BAA6B;GAC1F,MAAM;EACR,CAAC,MACmB,MAAMA,iBAAAA,QAAG,UAAA,GAASC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,GAAI;GACtE,MAAM,QAAA,GAAOC,SAAAA,cAAAA,CAAc,MAAM,CAAC,CAAC;GACnC;EACF;CACF;CACA,MAAM,EAAE,iBAAiB,cAAc,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;CAC7C,MAAM,EAAE,sBAAsB,iBAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;CAErD,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CAQjC,MAAM,gBALgB,aAAa,IAAI,MAAM,KAAA,IAKP,KAAA,IAAY,qBAAqB,IAAI;CAC3E,MAAM,oBACJ,kBAAkB,gBACP;EACL,UAAU;EACV,OAAO;CACT,EAAA,CAAG,IACH,kBAAkB,mBACT;EACL,QAAQ,OAAO,MAAM,GAAG,gBAAgB,GAAG;EAC3C,OAAO;CACT,EAAA,CAAG,IACH,KAAA;CAOR,OAJE,sBAAsB,KAAA,IAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAClB,uBAAA,CAAA,CAAA,CAAwB,MAAM,EAAE,aAAa,OAAO,IAAI,CAAC,IACzD,QAAQ,QAAQ,iBAAiB;AAGzC;AAEA,KAAK,CAAC,CAAC,MACJ,aAAa;CACZ,IAAI,aAAa,KAAA,GAAW,QAAQ,WAAW;AACjD,IACC,UAAmB;CAClB,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,QAAQ,OAAO,MAAM,QAAQ,QAAQ,GAAG;CACxC,QAAQ,WAAW;AACrB,CACF"}
1
+ {"version":3,"file":"cli.cjs","names":["initializeAgentDirectory","testRoot","path","fs","fileURLToPath","pathToFileURL"],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * CLI Entry Point for po\n *\n * The executable installed as the `po` binary, and the file the repository\n * launcher (pi.sh) invoke directly from source.\n */\n\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nimport { initializeAgentDirectory, testRoot } from './agentDirectory';\n\nasync function main(): Promise<number | undefined> {\n await initializeAgentDirectory();\n if (testRoot) {\n const target = path.join(testRoot, 'packages/cli/po/dist/bin/cli.mjs');\n const realTarget = await fs.realpath(target).catch((error: NodeJS.ErrnoException) => {\n if (error.code === 'ENOENT')\n throw new Error(`Local test CLI build is missing: ${target}. Build @agimon-ai/po first.`);\n throw error;\n });\n if (realTarget !== (await fs.realpath(fileURLToPath(import.meta.url)))) {\n await import(pathToFileURL(target).href);\n return;\n }\n }\n const { loadCliLocale } = await import('../cli/locale');\n await loadCliLocale(process.env);\n const { HARNESS_VERSION, printHelp } = await import('../cli/help');\n const { informationalRequest, routeCommand } = await import('../cli/router');\n\n const args = process.argv.slice(2);\n // A named subcommand parses its own arguments, including its own --help, so the\n // fast path below must not answer for it.\n const ownsArguments = routeCommand(args) !== undefined;\n\n // Keep informational startup independent from telemetry, configuration, Pi,\n // and the extension compiler. Those graphs are useful for a real command but\n // used to account for almost all of `po --help` and `po --version`.\n const informational = ownsArguments ? undefined : informationalRequest(args);\n const informationalExit =\n informational === 'help'\n ? (() => {\n printHelp();\n return 0;\n })()\n : informational === 'version'\n ? (() => {\n process.stdout.write(`${HARNESS_VERSION}\\n`);\n return 0;\n })()\n : undefined;\n\n const run =\n informationalExit === undefined\n ? import('../cli/cliApp').then(({ runCli }) => runCli(args))\n : Promise.resolve(informationalExit);\n\n return run;\n}\n\nmain().then(\n (exitCode) => {\n if (exitCode !== undefined) process.exitCode = exitCode;\n },\n (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`[po] ${message}\\n`);\n process.exitCode = 1;\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;AAeA,eAAe,OAAoC;CACjD,MAAMA,uBAAAA,yBAAyB;CAC/B,IAAIC,uBAAAA,UAAU;EACZ,MAAM,SAASC,UAAAA,QAAK,KAAKD,uBAAAA,UAAU,kCAAkC;EAMrE,IAAI,MALqBE,iBAAAA,QAAG,SAAS,MAAM,CAAC,CAAC,OAAO,UAAiC;GACnF,IAAI,MAAM,SAAS,UACjB,MAAM,IAAI,MAAM,oCAAoC,OAAO,6BAA6B;GAC1F,MAAM;EACR,CAAC,MACmB,MAAMA,iBAAAA,QAAG,UAAA,GAASC,SAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B,CAAC,GAAI;GACtE,MAAM,QAAA,GAAOC,SAAAA,cAAAA,CAAc,MAAM,CAAC,CAAC;GACnC;EACF;CACF;CACA,MAAM,EAAE,kBAAkB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;CAChC,MAAM,cAAc,QAAQ,GAAG;CAC/B,MAAM,EAAE,iBAAiB,cAAc,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,qBAAA,CAAA;CAC7C,MAAM,EAAE,sBAAsB,iBAAiB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,uBAAA,CAAA;CAErD,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CAQjC,MAAM,gBALgB,aAAa,IAAI,MAAM,KAAA,IAKP,KAAA,IAAY,qBAAqB,IAAI;CAC3E,MAAM,oBACJ,kBAAkB,gBACP;EACL,UAAU;EACV,OAAO;CACT,EAAA,CAAG,IACH,kBAAkB,mBACT;EACL,QAAQ,OAAO,MAAM,GAAG,gBAAgB,GAAG;EAC3C,OAAO;CACT,EAAA,CAAG,IACH,KAAA;CAOR,OAJE,sBAAsB,KAAA,IAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAClB,uBAAA,CAAA,CAAA,CAAwB,MAAM,EAAE,aAAa,OAAO,IAAI,CAAC,IACzD,QAAQ,QAAQ,iBAAiB;AAGzC;AAEA,KAAK,CAAC,CAAC,MACJ,aAAa;CACZ,IAAI,aAAa,KAAA,GAAW,QAAQ,WAAW;AACjD,IACC,UAAmB;CAClB,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,QAAQ,OAAO,MAAM,QAAQ,QAAQ,GAAG;CACxC,QAAQ,WAAW;AACrB,CACF"}
package/dist/bin/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { initializeAgentDirectory, testRoot } from "../src/bin/agentDirectory.mjs";
3
3
  import path from "node:path";
4
- import fs from "node:fs/promises";
5
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import fs from "node:fs/promises";
6
6
  //#region src/bin/cli.ts
7
7
  /**
8
8
  * CLI Entry Point for po
@@ -22,6 +22,8 @@ async function main() {
22
22
  return;
23
23
  }
24
24
  }
25
+ const { loadCliLocale } = await import("../src/cli/locale.mjs");
26
+ await loadCliLocale(process.env);
25
27
  const { HARNESS_VERSION, printHelp } = await import("../src/cli/help.mjs");
26
28
  const { informationalRequest, routeCommand } = await import("../src/cli/router.mjs");
27
29
  const args = process.argv.slice(2);
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * CLI Entry Point for po\n *\n * The executable installed as the `po` binary, and the file the repository\n * launcher (pi.sh) invoke directly from source.\n */\n\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nimport { initializeAgentDirectory, testRoot } from './agentDirectory';\n\nasync function main(): Promise<number | undefined> {\n await initializeAgentDirectory();\n if (testRoot) {\n const target = path.join(testRoot, 'packages/cli/po/dist/bin/cli.mjs');\n const realTarget = await fs.realpath(target).catch((error: NodeJS.ErrnoException) => {\n if (error.code === 'ENOENT')\n throw new Error(`Local test CLI build is missing: ${target}. Build @agimon-ai/po first.`);\n throw error;\n });\n if (realTarget !== (await fs.realpath(fileURLToPath(import.meta.url)))) {\n await import(pathToFileURL(target).href);\n return;\n }\n }\n const { HARNESS_VERSION, printHelp } = await import('../cli/help');\n const { informationalRequest, routeCommand } = await import('../cli/router');\n\n const args = process.argv.slice(2);\n // A named subcommand parses its own arguments, including its own --help, so the\n // fast path below must not answer for it.\n const ownsArguments = routeCommand(args) !== undefined;\n\n // Keep informational startup independent from telemetry, configuration, Pi,\n // and the extension compiler. Those graphs are useful for a real command but\n // used to account for almost all of `po --help` and `po --version`.\n const informational = ownsArguments ? undefined : informationalRequest(args);\n const informationalExit =\n informational === 'help'\n ? (() => {\n printHelp();\n return 0;\n })()\n : informational === 'version'\n ? (() => {\n process.stdout.write(`${HARNESS_VERSION}\\n`);\n return 0;\n })()\n : undefined;\n\n const run =\n informationalExit === undefined\n ? import('../cli/cliApp').then(({ runCli }) => runCli(args))\n : Promise.resolve(informationalExit);\n\n return run;\n}\n\nmain().then(\n (exitCode) => {\n if (exitCode !== undefined) process.exitCode = exitCode;\n },\n (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`[po] ${message}\\n`);\n process.exitCode = 1;\n },\n);\n"],"mappings":";;;;;;;;;;;;AAeA,eAAe,OAAoC;CACjD,MAAM,yBAAyB;CAC/B,IAAI,UAAU;EACZ,MAAM,SAAS,KAAK,KAAK,UAAU,kCAAkC;EAMrE,IAAI,MALqB,GAAG,SAAS,MAAM,CAAC,CAAC,OAAO,UAAiC;GACnF,IAAI,MAAM,SAAS,UACjB,MAAM,IAAI,MAAM,oCAAoC,OAAO,6BAA6B;GAC1F,MAAM;EACR,CAAC,MACmB,MAAM,GAAG,SAAS,cAAc,YAAY,GAAG,CAAC,GAAI;GACtE,MAAM,OAAO,cAAc,MAAM,CAAC,CAAC;GACnC;EACF;CACF;CACA,MAAM,EAAE,iBAAiB,cAAc,MAAM,OAAO;CACpD,MAAM,EAAE,sBAAsB,iBAAiB,MAAM,OAAO;CAE5D,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CAQjC,MAAM,gBALgB,aAAa,IAAI,MAAM,KAAA,IAKP,KAAA,IAAY,qBAAqB,IAAI;CAC3E,MAAM,oBACJ,kBAAkB,gBACP;EACL,UAAU;EACV,OAAO;CACT,EAAA,CAAG,IACH,kBAAkB,mBACT;EACL,QAAQ,OAAO,MAAM,GAAG,gBAAgB,GAAG;EAC3C,OAAO;CACT,EAAA,CAAG,IACH,KAAA;CAOR,OAJE,sBAAsB,KAAA,IAClB,OAAO,wBAAgB,CAAC,MAAM,EAAE,aAAa,OAAO,IAAI,CAAC,IACzD,QAAQ,QAAQ,iBAAiB;AAGzC;AAEA,KAAK,CAAC,CAAC,MACJ,aAAa;CACZ,IAAI,aAAa,KAAA,GAAW,QAAQ,WAAW;AACjD,IACC,UAAmB;CAClB,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,QAAQ,OAAO,MAAM,QAAQ,QAAQ,GAAG;CACxC,QAAQ,WAAW;AACrB,CACF"}
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../../src/bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * CLI Entry Point for po\n *\n * The executable installed as the `po` binary, and the file the repository\n * launcher (pi.sh) invoke directly from source.\n */\n\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nimport { initializeAgentDirectory, testRoot } from './agentDirectory';\n\nasync function main(): Promise<number | undefined> {\n await initializeAgentDirectory();\n if (testRoot) {\n const target = path.join(testRoot, 'packages/cli/po/dist/bin/cli.mjs');\n const realTarget = await fs.realpath(target).catch((error: NodeJS.ErrnoException) => {\n if (error.code === 'ENOENT')\n throw new Error(`Local test CLI build is missing: ${target}. Build @agimon-ai/po first.`);\n throw error;\n });\n if (realTarget !== (await fs.realpath(fileURLToPath(import.meta.url)))) {\n await import(pathToFileURL(target).href);\n return;\n }\n }\n const { loadCliLocale } = await import('../cli/locale');\n await loadCliLocale(process.env);\n const { HARNESS_VERSION, printHelp } = await import('../cli/help');\n const { informationalRequest, routeCommand } = await import('../cli/router');\n\n const args = process.argv.slice(2);\n // A named subcommand parses its own arguments, including its own --help, so the\n // fast path below must not answer for it.\n const ownsArguments = routeCommand(args) !== undefined;\n\n // Keep informational startup independent from telemetry, configuration, Pi,\n // and the extension compiler. Those graphs are useful for a real command but\n // used to account for almost all of `po --help` and `po --version`.\n const informational = ownsArguments ? undefined : informationalRequest(args);\n const informationalExit =\n informational === 'help'\n ? (() => {\n printHelp();\n return 0;\n })()\n : informational === 'version'\n ? (() => {\n process.stdout.write(`${HARNESS_VERSION}\\n`);\n return 0;\n })()\n : undefined;\n\n const run =\n informationalExit === undefined\n ? import('../cli/cliApp').then(({ runCli }) => runCli(args))\n : Promise.resolve(informationalExit);\n\n return run;\n}\n\nmain().then(\n (exitCode) => {\n if (exitCode !== undefined) process.exitCode = exitCode;\n },\n (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`[po] ${message}\\n`);\n process.exitCode = 1;\n },\n);\n"],"mappings":";;;;;;;;;;;;AAeA,eAAe,OAAoC;CACjD,MAAM,yBAAyB;CAC/B,IAAI,UAAU;EACZ,MAAM,SAAS,KAAK,KAAK,UAAU,kCAAkC;EAMrE,IAAI,MALqB,GAAG,SAAS,MAAM,CAAC,CAAC,OAAO,UAAiC;GACnF,IAAI,MAAM,SAAS,UACjB,MAAM,IAAI,MAAM,oCAAoC,OAAO,6BAA6B;GAC1F,MAAM;EACR,CAAC,MACmB,MAAM,GAAG,SAAS,cAAc,YAAY,GAAG,CAAC,GAAI;GACtE,MAAM,OAAO,cAAc,MAAM,CAAC,CAAC;GACnC;EACF;CACF;CACA,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACvC,MAAM,cAAc,QAAQ,GAAG;CAC/B,MAAM,EAAE,iBAAiB,cAAc,MAAM,OAAO;CACpD,MAAM,EAAE,sBAAsB,iBAAiB,MAAM,OAAO;CAE5D,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CAQjC,MAAM,gBALgB,aAAa,IAAI,MAAM,KAAA,IAKP,KAAA,IAAY,qBAAqB,IAAI;CAC3E,MAAM,oBACJ,kBAAkB,gBACP;EACL,UAAU;EACV,OAAO;CACT,EAAA,CAAG,IACH,kBAAkB,mBACT;EACL,QAAQ,OAAO,MAAM,GAAG,gBAAgB,GAAG;EAC3C,OAAO;CACT,EAAA,CAAG,IACH,KAAA;CAOR,OAJE,sBAAsB,KAAA,IAClB,OAAO,wBAAgB,CAAC,MAAM,EAAE,aAAa,OAAO,IAAI,CAAC,IACzD,QAAQ,QAAQ,iBAAiB;AAGzC;AAEA,KAAK,CAAC,CAAC,MACJ,aAAa;CACZ,IAAI,aAAa,KAAA,GAAW,QAAQ,WAAW;AACjD,IACC,UAAmB;CAClB,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,QAAQ,OAAO,MAAM,QAAQ,QAAQ,GAAG;CACxC,QAAQ,WAAW;AACrB,CACF"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_index = require("../src/composition/repository/index.cjs");
4
4
  const require_agentDirectory = require("../src/bin/agentDirectory.cjs");
5
- let node_fs_promises = require("node:fs/promises");
6
5
  let node_url = require("node:url");
6
+ let node_fs_promises = require("node:fs/promises");
7
7
  let _agimon_ai_po_core_moduleResolution = require("@agimon-ai/po-core/moduleResolution");
8
8
  //#region src/bin/poRunner.ts
9
9
  /**
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { findRepositoryRoot } from "../src/composition/repository/index.mjs";
3
3
  import { initializeAgentDirectory } from "../src/bin/agentDirectory.mjs";
4
- import { realpath } from "node:fs/promises";
5
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import { realpath } from "node:fs/promises";
6
6
  import { consumerPackageEntry } from "@agimon-ai/po-core/moduleResolution";
7
7
  //#region src/bin/poRunner.ts
8
8
  /**
@@ -3,9 +3,9 @@ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
3
3
  const require_entryResolution = require("../../../src/builders/cli/entryResolution.cjs");
4
4
  let node_path = require("node:path");
5
5
  node_path = require_runtime.__toESM(node_path, 1);
6
+ let node_url = require("node:url");
6
7
  let node_fs = require("node:fs");
7
8
  node_fs = require_runtime.__toESM(node_fs, 1);
8
- let node_url = require("node:url");
9
9
  let _agimon_ai_po_config_presets = require("@agimon-ai/po-config/presets");
10
10
  let _agimon_ai_po_core_moduleResolution = require("@agimon-ai/po-core/moduleResolution");
11
11
  let _agimon_ai_po_core_runtimeIdentity = require("@agimon-ai/po-core/runtimeIdentity");
@@ -27,6 +27,7 @@ const CORE_PACKAGE_ENTRIES = [
27
27
  "@agimon-ai/po-mode/extensions/server",
28
28
  "@agimon-ai/po-config/extensions/server",
29
29
  "@agimon-ai/po-db/extensions/server",
30
+ "@agimon-ai/po-lang/extensions/server",
30
31
  "@agimon-ai/po-vault/extensions/server",
31
32
  "@agimon-ai/po-ui/extensions/server",
32
33
  "@agimon-ai/po-notification/extensions/server",
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["FIXED_CORE_PACKAGE_NAMES","fs","path","declaredServerPackagesOf","splitPackageSpecifier","consumerPackageEntry","localPackageExport","localPackageEntries","fileURLToPath","resolvePackageEntry","resolveOptionalPackageEntry","resolveLocalPackageName","checkoutPackageEntry","canonicalModulePath","isLocalPackageSpecifier","sha256"],"sources":["../../../../src/builders/cli/extensionAssembler/index.ts"],"sourcesContent":["// sync: package resolvers implement po-config's synchronous LayerResolvers contract.\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { isLocalPackageSpecifier, type LayerResolvers, type PresetsConfig } from '@agimon-ai/po-config/presets';\nimport {\n checkoutPackageEntry,\n consumerPackageEntry,\n localEntries,\n localEntry,\n localPackageEntries,\n localPackageExport,\n localPackageName as resolveLocalPackageName,\n optionalPackageEntry as resolveOptionalPackageEntry,\n packageEntry as resolvePackageEntry,\n splitPackageSpecifier,\n} from '@agimon-ai/po-core/moduleResolution';\nimport { canonicalModulePath, sha256 } from '@agimon-ai/po-core/runtimeIdentity';\nimport {\n declaredServerPackagesOf,\n FIXED_CORE_PACKAGES as FIXED_CORE_PACKAGE_NAMES,\n} from '@agimon-ai/po-core/serverPlugin';\n\nimport { ownEntry } from '../entryResolution';\n\nexport interface ExtensionLayerResolvers extends LayerResolvers {\n /** Resolves a path authored under packages to its native discovery anchor. */\n localPackageEntries?: (specifier: string, baseDirectory: string) => string[] | undefined;\n /** Canonical manifest name for a path that represents a package directory. */\n localPackageName?: (specifier: string, baseDirectory: string) => string | undefined;\n}\n\nexport interface ExtensionContext {\n /** Named mode whose occurrence is part of composition identity. */\n preset?: string;\n /** Ordered layer occurrences selected by the active preset. */\n layers: string[];\n presetsConfig: PresetsConfig;\n /** Resolver override used by synchronized replay. */\n resolvers?: ExtensionLayerResolvers;\n /**\n * Turns a configured package that does not resolve yet (not installed, or a local package\n * not built) into a missing selection with a diagnostic instead of an error, so a host that\n * only reads what sync prepared can still open. A fixed host package selected as a feature\n * still throws: that is a configuration error, not something sync can fix.\n */\n tolerateUnsynced?: boolean;\n}\n\nexport type SelectedEntryKind = 'extension' | 'package';\ntype ExtensionResolutionOutcome = 'resolved' | 'missing-optional';\n\n/**\n * One resolver-derived extension occurrence.\n *\n * This remains private to Po composition. It is not package metadata and\n * deliberately retains authored duplicates even though activation paths are\n * deduplicated later.\n */\ninterface ResolvedExtensionSelection {\n readonly layer: string;\n readonly layerIndex: number;\n readonly entryKind: SelectedEntryKind;\n readonly entryIndex: number;\n readonly manifestIndex: number;\n readonly selector: string;\n readonly sourceFile?: string;\n readonly baseDirectory: string;\n readonly optional: boolean;\n readonly outcome: ExtensionResolutionOutcome;\n readonly path?: string;\n readonly canonicalPath?: string;\n readonly diagnostic?: string;\n /** Left out because Po now builds the package in; a sync never makes it resolve. */\n readonly retired?: true;\n readonly config?: Record<string, unknown>;\n}\n\nexport interface CompositionLayerOccurrence {\n readonly name: string;\n readonly index: number;\n readonly sourceFile?: string;\n readonly baseDirectory: string;\n}\n\n/** Internal normalized composition shared by sync, bundles, and the session server. */\nexport interface ExtensionComposition {\n readonly preset?: {\n readonly name: string;\n readonly sourceFile?: string;\n readonly baseDirectory?: string;\n };\n readonly layers: readonly CompositionLayerOccurrence[];\n readonly selections: readonly ResolvedExtensionSelection[];\n /** Entries whose owning packages this composition selects, for native package discovery. */\n readonly packageEntries: readonly string[];\n /** Stable identity of this composition, published as the session's composition fingerprint. */\n readonly fingerprint: string;\n}\n\nconst DEFAULT_SELECTION_LAYER = 'default';\nconst DEFAULT_SELECTION_LAYER_INDEX = -1;\n\nconst FIXED_CORE_PACKAGES = new Set<string>(FIXED_CORE_PACKAGE_NAMES);\n\n/**\n * Feature packages Po has absorbed into its host. A preset that still lists one is left out with a\n * notice instead of failing. ponytail: it holds one name; if promotions become common, move this\n * to a manifest field.\n */\nconst RETIRED_FEATURE_PACKAGES = new Set(['@agimon-ai/po-author']);\n\n/** A fixed Po host package: the only kind whose manifest may make a load failure fatal. */\nexport const isFixedHostPackage = (name: string): boolean => FIXED_CORE_PACKAGES.has(name);\n/** Native server entries of the fixed host packages every composition selects. */\nconst CORE_PACKAGE_ENTRIES = [\n '@agimon-ai/po-mode/extensions/server',\n '@agimon-ai/po-config/extensions/server',\n '@agimon-ai/po-db/extensions/server',\n '@agimon-ai/po-vault/extensions/server',\n '@agimon-ai/po-ui/extensions/server',\n '@agimon-ai/po-notification/extensions/server',\n '@agimon-ai/po-profile/extensions/server',\n '@agimon-ai/po-preset/extensions/server',\n '@agimon-ai/po-skill/extensions/server',\n '@agimon-ai/po-domain/extensions/server',\n '@agimon-ai/po-artifact/extensions/server',\n '@agimon-ai/po-author/extensions/server',\n '@agimon-ai/po-infinite-canvas/extensions/server',\n '@agimon-ai/po-approval/extensions/server',\n '@agimon-ai/po-session-mcp/extensions/server',\n '@agimon-ai/po-federation/extensions/server',\n '@agimon-ai/po-remote/extensions/server',\n] as const;\nconst CACHE_PACKAGE_ENTRY = '@agimon-ai/po-cache/extensions/server';\nconst SESSION_PACKAGE_ENTRY = '@agimon-ai/po-session/extensions/server';\n/** Po's own server package, resolved through the distribution like any own entry. */\nconst PO_SERVER_ENTRY = 'server';\n\n/** Manifest fields through which a selected package contributes to a Po host. */\nconst PO_CONTRIBUTION_FIELDS = ['poServer', 'poWeb', 'poMcp'] as const;\n\n/**\n * Resolves a selected package to its built server entry, or to its manifest as the discovery\n * anchor of a web or MCP only package. A package with no Po contribution resolves empty.\n */\nfunction nativePackageEntries(manifestPath: string, resolveExport: () => string | undefined): string[] {\n const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Record<string, unknown>;\n const root = path.dirname(fs.realpathSync(manifestPath));\n const declaration = declaredServerPackagesOf(root, manifest)[0];\n if (!declaration) {\n return PO_CONTRIBUTION_FIELDS.some((field) => manifest[field] !== undefined)\n ? [path.join(root, 'package.json')]\n : [];\n }\n const exported = resolveExport();\n const dist = path.resolve(root, declaration.dist);\n if (!exported || !fs.existsSync(dist) || fs.realpathSync(exported) !== fs.realpathSync(dist)) {\n throw new Error(\n `Native package ${declaration.packageName} must export its built poServer dist as ./extensions/server.`,\n );\n }\n return [fs.realpathSync(dist)];\n}\n\n/** Resolves an installed package selection, or one explicit export subpath, from root. */\nfunction installedPackageEntries(\n specifier: string,\n root: string,\n environment: NodeJS.ProcessEnv = process.env,\n): string[] | undefined {\n if (splitPackageSpecifier(specifier).subpath !== '.') {\n const entry = consumerPackageEntry(specifier, root, environment);\n return entry ? [fs.realpathSync(entry)] : undefined;\n }\n const manifestPath = consumerPackageEntry(`${specifier}/package.json`, root, environment);\n return manifestPath\n ? nativePackageEntries(manifestPath, () =>\n consumerPackageEntry(`${specifier}/extensions/server`, root, environment),\n )\n : undefined;\n}\n\nfunction localSelectedPackageEntries(specifier: string, baseDirectory: string): string[] | undefined {\n const manifest = path.resolve(baseDirectory, specifier, 'package.json');\n return fs.existsSync(manifest)\n ? nativePackageEntries(manifest, () => localPackageExport(specifier, baseDirectory, './extensions/server'))\n : localPackageEntries(specifier, baseDirectory);\n}\n\nconst HOST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));\n\nexport const LAYER_RESOLVERS: ExtensionLayerResolvers = {\n ownEntry,\n packageEntry: (specifier) => resolvePackageEntry(specifier, import.meta.url, process.env),\n optionalPackageEntry: (specifier) => resolveOptionalPackageEntry(specifier, import.meta.url, process.env),\n packageEntries: (specifier) => {\n const entries = installedPackageEntries(specifier, HOST_DIRECTORY);\n if (!entries) throw new Error(`Cannot resolve package ${specifier}.`);\n return entries;\n },\n optionalPackageEntries: (specifier) => installedPackageEntries(specifier, HOST_DIRECTORY),\n localEntry,\n localEntries,\n localPackageEntries: localSelectedPackageEntries,\n localPackageName: resolveLocalPackageName,\n};\n\nfunction missingConsumerPackage(name: string, consumerRoot: string): Error {\n return new Error(`Cannot resolve configured package \"${name}\" from ${consumerRoot}.`);\n}\n\n/**\n * Resolves configured packages only from the consumer, while fixed core entries\n * may fall back to the host package's private dependency closure. `environment` names\n * the Po home whose shared runtime answers after the consumer's own tree.\n */\nexport function createLayerResolvers(\n consumerRoot?: string,\n environment: NodeJS.ProcessEnv = process.env,\n): ExtensionLayerResolvers {\n if (!consumerRoot) return LAYER_RESOLVERS;\n // Fixed host packages must match the executable, even when home contains an older installation.\n const fallbackEntry = (name: string): string | undefined =>\n FIXED_CORE_PACKAGES.has(packageName(name))\n ? resolveOptionalPackageEntry(name, import.meta.url, environment)\n : undefined;\n // A checkout executable with no installed copy in the consumer still runs its own fixed packages.\n const entryOf = (name: string): string | undefined =>\n fallbackEntry(name) ??\n consumerPackageEntry(name, consumerRoot, environment) ??\n (FIXED_CORE_PACKAGES.has(packageName(name)) ? checkoutPackageEntry(name, import.meta.url) : undefined);\n const requiredEntry = (name: string): string => {\n const entry = entryOf(name);\n if (!entry) throw missingConsumerPackage(name, consumerRoot);\n return entry;\n };\n const requiredEntries = (name: string): string[] => {\n const entries = installedPackageEntries(name, consumerRoot, environment);\n if (!entries) throw missingConsumerPackage(name, consumerRoot);\n return entries;\n };\n return {\n ownEntry,\n packageEntry: requiredEntry,\n optionalPackageEntry: entryOf,\n packageEntries: requiredEntries,\n optionalPackageEntries: (name) => installedPackageEntries(name, consumerRoot, environment),\n localEntry,\n localEntries,\n localPackageEntries: localSelectedPackageEntries,\n localPackageName: resolveLocalPackageName,\n };\n}\n\nfunction packageName(specifier: string): string {\n const segments = specifier.split('/');\n return specifier.startsWith('@') ? segments.slice(0, 2).join('/') : (segments[0] ?? specifier);\n}\n\n/** A fixed host package selected as a feature: a configuration error that tolerance never hides. */\nclass FixedPackageSelectionError extends Error {}\n\nfunction assertFeaturePackage(specifier: string, layer: string): void {\n const selectedPackage = packageName(specifier);\n if (FIXED_CORE_PACKAGES.has(selectedPackage)) {\n throw new FixedPackageSelectionError(\n `Layer \"${layer}\" cannot select fixed Po host package \"${selectedPackage}\" as a feature extension.`,\n );\n }\n}\n\nfunction resolveLocalExtensionEntries(\n resolvers: ExtensionLayerResolvers,\n specifier: string,\n baseDirectory: string,\n): string[] | undefined {\n const resolved = resolvers.localEntries?.(specifier, baseDirectory);\n if (resolved !== undefined) return resolved;\n const single = resolvers.localEntry(specifier, baseDirectory);\n return single ? [single] : undefined;\n}\n\nfunction resolveLocalPackageSelections(\n resolvers: ExtensionLayerResolvers,\n specifier: string,\n baseDirectory: string,\n): string[] | undefined {\n const resolved = resolvers.localPackageEntries?.(specifier, baseDirectory);\n if (resolved !== undefined) return resolved;\n return resolveLocalExtensionEntries(resolvers, specifier, baseDirectory);\n}\n\ninterface SelectionIdentity {\n layer: string;\n layerIndex: number;\n entryKind: SelectedEntryKind;\n entryIndex: number;\n selector: string;\n sourceFile?: string;\n baseDirectory: string;\n optional: boolean;\n config?: Record<string, unknown>;\n}\n\nfunction resolvedSelection(\n identity: SelectionIdentity,\n manifestIndex: number,\n resolvedPath: string,\n): ResolvedExtensionSelection {\n return {\n ...identity,\n manifestIndex,\n outcome: 'resolved',\n path: resolvedPath,\n canonicalPath: canonicalModulePath(resolvedPath),\n };\n}\n\nfunction missingOptionalSelection(\n identity: SelectionIdentity,\n diagnostic: string,\n retired = false,\n): ResolvedExtensionSelection {\n return {\n ...identity,\n manifestIndex: 0,\n outcome: 'missing-optional',\n diagnostic,\n ...(retired ? { retired: true as const } : {}),\n };\n}\n\n/**\n * The selectors a tolerant composition left out because they do not resolve yet: the missing\n * selections of entries that are not optional, each once, in composition order. Retired entries\n * never resolve, so they are not counted.\n */\nexport function unsyncedSelectors(compositions: readonly ExtensionComposition[]): string[] {\n return [\n ...new Set(\n compositions.flatMap((composition) =>\n composition.selections\n .filter((selection) => selection.outcome === 'missing-optional' && !selection.optional && !selection.retired)\n .map((selection) => selection.selector),\n ),\n ),\n ];\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction resolveDefinitionSelections(\n definition: PresetsConfig['layers'][string],\n layer: string,\n layerIndex: number,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced = false,\n): ResolvedExtensionSelection[] {\n const resolvedSelections: ResolvedExtensionSelection[] = [];\n const extensionEntries = definition.extensions ?? [];\n for (const [entryIndex, selector] of extensionEntries.entries()) {\n const identity: SelectionIdentity = {\n layer,\n layerIndex,\n entryKind: 'extension',\n entryIndex,\n selector,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n optional: false,\n };\n if (!isLocalPackageSpecifier(selector)) {\n resolvedSelections.push(resolvedSelection(identity, 0, resolvers.ownEntry(selector)));\n continue;\n }\n const resolved = resolveLocalExtensionEntries(resolvers, selector, definition.baseDirectory);\n if (!resolved?.length) {\n throw new Error(\n `Layer \"${layer}\" extension \"${selector}\" does not resolve under ${definition.baseDirectory}. ` +\n 'Point it at a Pi extension file or directory.',\n );\n }\n resolved.forEach((resolvedPath, manifestIndex) => {\n resolvedSelections.push(resolvedSelection(identity, manifestIndex, resolvedPath));\n });\n }\n\n const packageOffset = extensionEntries.length;\n for (const [packageIndex, configured] of (definition.packages ?? []).entries()) {\n const selector = typeof configured === 'string' ? configured : configured.name;\n const optional = typeof configured === 'string' ? false : configured.optional === true;\n const configValue = typeof configured === 'string' ? undefined : configured.config;\n const identity: SelectionIdentity = {\n layer,\n layerIndex,\n entryKind: 'package',\n entryIndex: packageOffset + packageIndex,\n selector,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n optional,\n ...(configValue === undefined ? {} : { config: configValue }),\n };\n\n let resolved: string[] | undefined;\n try {\n const local = isLocalPackageSpecifier(selector);\n const manifestName = local ? resolvers.localPackageName?.(selector, definition.baseDirectory) : undefined;\n const selectedPackage = local ? manifestName && packageName(manifestName) : packageName(selector);\n if (selectedPackage && RETIRED_FEATURE_PACKAGES.has(selectedPackage)) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `${selectedPackage} is built into Po now; remove it from ${definition.filePath ?? `layer \"${layer}\"`}.`,\n true,\n ),\n );\n continue;\n }\n if (local) {\n if (manifestName) assertFeaturePackage(manifestName, layer);\n resolved = resolveLocalPackageSelections(resolvers, selector, definition.baseDirectory);\n } else {\n assertFeaturePackage(selector, layer);\n if (optional) {\n resolved = resolvers.optionalPackageEntries?.(selector);\n if (resolved === undefined && !resolvers.optionalPackageEntries) {\n const single = resolvers.optionalPackageEntry(selector);\n resolved = single ? [single] : undefined;\n }\n } else {\n resolved = resolvers.packageEntries?.(selector) ?? [resolvers.packageEntry(selector)];\n }\n }\n } catch (error) {\n if (optional || (tolerateUnsynced && !(error instanceof FixedPackageSelectionError))) {\n resolvedSelections.push(missingOptionalSelection(identity, errorMessage(error)));\n continue;\n }\n throw error;\n }\n\n if (!resolved?.length && tolerateUnsynced && !optional) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `Package \"${selector}\" is not synced yet: it resolves to no Po server, web or MCP contribution.`,\n ),\n );\n continue;\n }\n if (!resolved?.length) {\n if (optional) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `Optional package \"${selector}\" is unavailable or declares no Po server, web or MCP contribution.`,\n ),\n );\n continue;\n }\n if (isLocalPackageSpecifier(selector)) {\n throw new Error(\n `Layer \"${layer}\" package \"${selector}\" does not resolve under ${definition.baseDirectory}. ` +\n 'Point it at an extension file, or a package directory whose package.json declares a Po contribution.',\n );\n }\n throw new Error(`Layer \"${layer}\" package \"${selector}\" declares no Po server, web or MCP contribution.`);\n }\n\n resolved.forEach((resolvedPath, manifestIndex) => {\n resolvedSelections.push(resolvedSelection(identity, manifestIndex, resolvedPath));\n });\n }\n\n return resolvedSelections;\n}\n\nfunction resolveLayerSelections(\n config: PresetsConfig,\n layer: string,\n layerIndex: number,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced: boolean,\n): ResolvedExtensionSelection[] {\n const definition = config.layers[layer];\n if (!definition) throw new Error(`Unknown layer: ${layer}`);\n return resolveDefinitionSelections(definition, layer, layerIndex, resolvers, tolerateUnsynced);\n}\n\nfunction resolveDefaultSelections(\n config: PresetsConfig,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced: boolean,\n): ResolvedExtensionSelection[] {\n if (!config.default) return [];\n return resolveDefinitionSelections(\n config.default,\n DEFAULT_SELECTION_LAYER,\n DEFAULT_SELECTION_LAYER_INDEX,\n resolvers,\n tolerateUnsynced,\n );\n}\n\nfunction resolveSelectedExtensions(context: ExtensionContext): ResolvedExtensionSelection[] {\n const resolvers = context.resolvers ?? LAYER_RESOLVERS;\n return context.layers.flatMap((layer, layerIndex) =>\n resolveLayerSelections(context.presetsConfig, layer, layerIndex, resolvers, context.tolerateUnsynced === true),\n );\n}\n\nfunction deduplicatePaths(paths: readonly string[]): string[] {\n const seen = new Set<string>();\n const selected: string[] = [];\n for (const entry of paths) {\n const identity = canonicalModulePath(entry);\n if (seen.has(identity)) continue;\n seen.add(identity);\n selected.push(entry);\n }\n return selected;\n}\n\nfunction selectedFeaturePaths(selections: readonly ResolvedExtensionSelection[]): string[] {\n return deduplicatePaths(\n selections.flatMap((entry) => (entry.outcome === 'resolved' && entry.path ? [entry.path] : [])),\n );\n}\n\n/** Package anchors in the order the previous host activated them, so discovery order holds. */\nfunction selectedPackageEntries(\n resolve: ExtensionLayerResolvers,\n distributionPaths: readonly string[],\n featurePaths: readonly string[],\n): string[] {\n return deduplicatePaths([\n resolve.ownEntry(PO_SERVER_ENTRY),\n ...CORE_PACKAGE_ENTRIES.map((entry) => resolve.packageEntry(entry)),\n ...distributionPaths,\n ...featurePaths,\n resolve.packageEntry(CACHE_PACKAGE_ENTRY),\n resolve.packageEntry(SESSION_PACKAGE_ENTRY),\n ]);\n}\n\nfunction canonicalValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(canonicalValue);\n if (value === null || typeof value !== 'object') return value;\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>)\n .filter(([, entry]) => entry !== undefined)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, canonicalValue(entry)]),\n );\n}\n\n/** Resolve one deterministic composition from authored layer occurrences. */\nexport function resolveExtensionComposition(context: ExtensionContext): ExtensionComposition {\n const resolvers = context.resolvers ?? LAYER_RESOLVERS;\n const defaultSelections = resolveDefaultSelections(\n context.presetsConfig,\n resolvers,\n context.tolerateUnsynced === true,\n );\n const layerSelections = resolveSelectedExtensions(context);\n const selections = [...defaultSelections, ...layerSelections];\n const distributionPaths = selectedFeaturePaths(defaultSelections);\n const featurePaths = selectedFeaturePaths(layerSelections);\n const layers = context.layers.map((name, index): CompositionLayerOccurrence => {\n const definition = context.presetsConfig.layers[name];\n if (!definition) throw new Error(`Unknown layer: ${name}`);\n return {\n name,\n index,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n };\n });\n const modeSource = context.preset ? context.presetsConfig.presetSources?.[context.preset] : undefined;\n const composition = {\n ...(context.preset\n ? {\n preset: {\n name: context.preset,\n ...(modeSource?.filePath ? { sourceFile: modeSource.filePath } : {}),\n ...(modeSource?.baseDirectory ? { baseDirectory: modeSource.baseDirectory } : {}),\n },\n }\n : {}),\n layers,\n selections,\n packageEntries: selectedPackageEntries(resolvers, distributionPaths, featurePaths),\n };\n // Keys the prompt-cache namespace, so a different selection never shares cached prefixes.\n return {\n ...composition,\n fingerprint: sha256(\n JSON.stringify(\n canonicalValue({ ...composition, canonicalEntries: composition.packageEntries.map(canonicalModulePath) }),\n ),\n ),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAqGA,MAAM,0BAA0B;AAChC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;GACN,MAAM,QAAQ;GACd,GAAI,YAAY,WAAW,EAAE,YAAY,WAAW,SAAS,IAAI,CAAC;GAClE,GAAI,YAAY,gBAAgB,EAAE,eAAe,WAAW,cAAc,IAAI,CAAC;EACjF,EACF,IACA,CAAC;EACL;EACA;EACA,gBAAgB,uBAAuB,WAAW,mBAAmB,YAAY;CACnF;CAEA,OAAO;EACL,GAAG;EACH,cAAA,GAAaE,mCAAAA,OAAAA,CACX,KAAK,UACH,eAAe;GAAE,GAAG;GAAa,kBAAkB,YAAY,eAAe,IAAIF,mCAAAA,mBAAmB;EAAE,CAAC,CAC1G,CACF;CACF;AACF"}
1
+ {"version":3,"file":"index.cjs","names":["FIXED_CORE_PACKAGE_NAMES","fs","path","declaredServerPackagesOf","splitPackageSpecifier","consumerPackageEntry","localPackageExport","localPackageEntries","fileURLToPath","resolvePackageEntry","resolveOptionalPackageEntry","resolveLocalPackageName","checkoutPackageEntry","canonicalModulePath","isLocalPackageSpecifier","sha256"],"sources":["../../../../src/builders/cli/extensionAssembler/index.ts"],"sourcesContent":["// sync: package resolvers implement po-config's synchronous LayerResolvers contract.\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { isLocalPackageSpecifier, type LayerResolvers, type PresetsConfig } from '@agimon-ai/po-config/presets';\nimport {\n checkoutPackageEntry,\n consumerPackageEntry,\n localEntries,\n localEntry,\n localPackageEntries,\n localPackageExport,\n localPackageName as resolveLocalPackageName,\n optionalPackageEntry as resolveOptionalPackageEntry,\n packageEntry as resolvePackageEntry,\n splitPackageSpecifier,\n} from '@agimon-ai/po-core/moduleResolution';\nimport { canonicalModulePath, sha256 } from '@agimon-ai/po-core/runtimeIdentity';\nimport {\n declaredServerPackagesOf,\n FIXED_CORE_PACKAGES as FIXED_CORE_PACKAGE_NAMES,\n} from '@agimon-ai/po-core/serverPlugin';\n\nimport { ownEntry } from '../entryResolution';\n\nexport interface ExtensionLayerResolvers extends LayerResolvers {\n /** Resolves a path authored under packages to its native discovery anchor. */\n localPackageEntries?: (specifier: string, baseDirectory: string) => string[] | undefined;\n /** Canonical manifest name for a path that represents a package directory. */\n localPackageName?: (specifier: string, baseDirectory: string) => string | undefined;\n}\n\nexport interface ExtensionContext {\n /** Named mode whose occurrence is part of composition identity. */\n preset?: string;\n /** Ordered layer occurrences selected by the active preset. */\n layers: string[];\n presetsConfig: PresetsConfig;\n /** Resolver override used by synchronized replay. */\n resolvers?: ExtensionLayerResolvers;\n /**\n * Turns a configured package that does not resolve yet (not installed, or a local package\n * not built) into a missing selection with a diagnostic instead of an error, so a host that\n * only reads what sync prepared can still open. A fixed host package selected as a feature\n * still throws: that is a configuration error, not something sync can fix.\n */\n tolerateUnsynced?: boolean;\n}\n\nexport type SelectedEntryKind = 'extension' | 'package';\ntype ExtensionResolutionOutcome = 'resolved' | 'missing-optional';\n\n/**\n * One resolver-derived extension occurrence.\n *\n * This remains private to Po composition. It is not package metadata and\n * deliberately retains authored duplicates even though activation paths are\n * deduplicated later.\n */\ninterface ResolvedExtensionSelection {\n readonly layer: string;\n readonly layerIndex: number;\n readonly entryKind: SelectedEntryKind;\n readonly entryIndex: number;\n readonly manifestIndex: number;\n readonly selector: string;\n readonly sourceFile?: string;\n readonly baseDirectory: string;\n readonly optional: boolean;\n readonly outcome: ExtensionResolutionOutcome;\n readonly path?: string;\n readonly canonicalPath?: string;\n readonly diagnostic?: string;\n /** Left out because Po now builds the package in; a sync never makes it resolve. */\n readonly retired?: true;\n readonly config?: Record<string, unknown>;\n}\n\nexport interface CompositionLayerOccurrence {\n readonly name: string;\n readonly index: number;\n readonly sourceFile?: string;\n readonly baseDirectory: string;\n}\n\n/** Internal normalized composition shared by sync, bundles, and the session server. */\nexport interface ExtensionComposition {\n readonly preset?: {\n readonly name: string;\n readonly sourceFile?: string;\n readonly baseDirectory?: string;\n };\n readonly layers: readonly CompositionLayerOccurrence[];\n readonly selections: readonly ResolvedExtensionSelection[];\n /** Entries whose owning packages this composition selects, for native package discovery. */\n readonly packageEntries: readonly string[];\n /** Stable identity of this composition, published as the session's composition fingerprint. */\n readonly fingerprint: string;\n}\n\nconst DEFAULT_SELECTION_LAYER = 'default';\nconst DEFAULT_SELECTION_LAYER_INDEX = -1;\n\nconst FIXED_CORE_PACKAGES = new Set<string>(FIXED_CORE_PACKAGE_NAMES);\n\n/**\n * Feature packages Po has absorbed into its host. A preset that still lists one is left out with a\n * notice instead of failing. ponytail: it holds one name; if promotions become common, move this\n * to a manifest field.\n */\nconst RETIRED_FEATURE_PACKAGES = new Set(['@agimon-ai/po-author']);\n\n/** A fixed Po host package: the only kind whose manifest may make a load failure fatal. */\nexport const isFixedHostPackage = (name: string): boolean => FIXED_CORE_PACKAGES.has(name);\n/** Native server entries of the fixed host packages every composition selects. */\nconst CORE_PACKAGE_ENTRIES = [\n '@agimon-ai/po-mode/extensions/server',\n '@agimon-ai/po-config/extensions/server',\n '@agimon-ai/po-db/extensions/server',\n '@agimon-ai/po-lang/extensions/server',\n '@agimon-ai/po-vault/extensions/server',\n '@agimon-ai/po-ui/extensions/server',\n '@agimon-ai/po-notification/extensions/server',\n '@agimon-ai/po-profile/extensions/server',\n '@agimon-ai/po-preset/extensions/server',\n '@agimon-ai/po-skill/extensions/server',\n '@agimon-ai/po-domain/extensions/server',\n '@agimon-ai/po-artifact/extensions/server',\n '@agimon-ai/po-author/extensions/server',\n '@agimon-ai/po-infinite-canvas/extensions/server',\n '@agimon-ai/po-approval/extensions/server',\n '@agimon-ai/po-session-mcp/extensions/server',\n '@agimon-ai/po-federation/extensions/server',\n '@agimon-ai/po-remote/extensions/server',\n] as const;\nconst CACHE_PACKAGE_ENTRY = '@agimon-ai/po-cache/extensions/server';\nconst SESSION_PACKAGE_ENTRY = '@agimon-ai/po-session/extensions/server';\n/** Po's own server package, resolved through the distribution like any own entry. */\nconst PO_SERVER_ENTRY = 'server';\n\n/** Manifest fields through which a selected package contributes to a Po host. */\nconst PO_CONTRIBUTION_FIELDS = ['poServer', 'poWeb', 'poMcp'] as const;\n\n/**\n * Resolves a selected package to its built server entry, or to its manifest as the discovery\n * anchor of a web or MCP only package. A package with no Po contribution resolves empty.\n */\nfunction nativePackageEntries(manifestPath: string, resolveExport: () => string | undefined): string[] {\n const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')) as Record<string, unknown>;\n const root = path.dirname(fs.realpathSync(manifestPath));\n const declaration = declaredServerPackagesOf(root, manifest)[0];\n if (!declaration) {\n return PO_CONTRIBUTION_FIELDS.some((field) => manifest[field] !== undefined)\n ? [path.join(root, 'package.json')]\n : [];\n }\n const exported = resolveExport();\n const dist = path.resolve(root, declaration.dist);\n if (!exported || !fs.existsSync(dist) || fs.realpathSync(exported) !== fs.realpathSync(dist)) {\n throw new Error(\n `Native package ${declaration.packageName} must export its built poServer dist as ./extensions/server.`,\n );\n }\n return [fs.realpathSync(dist)];\n}\n\n/** Resolves an installed package selection, or one explicit export subpath, from root. */\nfunction installedPackageEntries(\n specifier: string,\n root: string,\n environment: NodeJS.ProcessEnv = process.env,\n): string[] | undefined {\n if (splitPackageSpecifier(specifier).subpath !== '.') {\n const entry = consumerPackageEntry(specifier, root, environment);\n return entry ? [fs.realpathSync(entry)] : undefined;\n }\n const manifestPath = consumerPackageEntry(`${specifier}/package.json`, root, environment);\n return manifestPath\n ? nativePackageEntries(manifestPath, () =>\n consumerPackageEntry(`${specifier}/extensions/server`, root, environment),\n )\n : undefined;\n}\n\nfunction localSelectedPackageEntries(specifier: string, baseDirectory: string): string[] | undefined {\n const manifest = path.resolve(baseDirectory, specifier, 'package.json');\n return fs.existsSync(manifest)\n ? nativePackageEntries(manifest, () => localPackageExport(specifier, baseDirectory, './extensions/server'))\n : localPackageEntries(specifier, baseDirectory);\n}\n\nconst HOST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));\n\nexport const LAYER_RESOLVERS: ExtensionLayerResolvers = {\n ownEntry,\n packageEntry: (specifier) => resolvePackageEntry(specifier, import.meta.url, process.env),\n optionalPackageEntry: (specifier) => resolveOptionalPackageEntry(specifier, import.meta.url, process.env),\n packageEntries: (specifier) => {\n const entries = installedPackageEntries(specifier, HOST_DIRECTORY);\n if (!entries) throw new Error(`Cannot resolve package ${specifier}.`);\n return entries;\n },\n optionalPackageEntries: (specifier) => installedPackageEntries(specifier, HOST_DIRECTORY),\n localEntry,\n localEntries,\n localPackageEntries: localSelectedPackageEntries,\n localPackageName: resolveLocalPackageName,\n};\n\nfunction missingConsumerPackage(name: string, consumerRoot: string): Error {\n return new Error(`Cannot resolve configured package \"${name}\" from ${consumerRoot}.`);\n}\n\n/**\n * Resolves configured packages only from the consumer, while fixed core entries\n * may fall back to the host package's private dependency closure. `environment` names\n * the Po home whose shared runtime answers after the consumer's own tree.\n */\nexport function createLayerResolvers(\n consumerRoot?: string,\n environment: NodeJS.ProcessEnv = process.env,\n): ExtensionLayerResolvers {\n if (!consumerRoot) return LAYER_RESOLVERS;\n // Fixed host packages must match the executable, even when home contains an older installation.\n const fallbackEntry = (name: string): string | undefined =>\n FIXED_CORE_PACKAGES.has(packageName(name))\n ? resolveOptionalPackageEntry(name, import.meta.url, environment)\n : undefined;\n // A checkout executable with no installed copy in the consumer still runs its own fixed packages.\n const entryOf = (name: string): string | undefined =>\n fallbackEntry(name) ??\n consumerPackageEntry(name, consumerRoot, environment) ??\n (FIXED_CORE_PACKAGES.has(packageName(name)) ? checkoutPackageEntry(name, import.meta.url) : undefined);\n const requiredEntry = (name: string): string => {\n const entry = entryOf(name);\n if (!entry) throw missingConsumerPackage(name, consumerRoot);\n return entry;\n };\n const requiredEntries = (name: string): string[] => {\n const entries = installedPackageEntries(name, consumerRoot, environment);\n if (!entries) throw missingConsumerPackage(name, consumerRoot);\n return entries;\n };\n return {\n ownEntry,\n packageEntry: requiredEntry,\n optionalPackageEntry: entryOf,\n packageEntries: requiredEntries,\n optionalPackageEntries: (name) => installedPackageEntries(name, consumerRoot, environment),\n localEntry,\n localEntries,\n localPackageEntries: localSelectedPackageEntries,\n localPackageName: resolveLocalPackageName,\n };\n}\n\nfunction packageName(specifier: string): string {\n const segments = specifier.split('/');\n return specifier.startsWith('@') ? segments.slice(0, 2).join('/') : (segments[0] ?? specifier);\n}\n\n/** A fixed host package selected as a feature: a configuration error that tolerance never hides. */\nclass FixedPackageSelectionError extends Error {}\n\nfunction assertFeaturePackage(specifier: string, layer: string): void {\n const selectedPackage = packageName(specifier);\n if (FIXED_CORE_PACKAGES.has(selectedPackage)) {\n throw new FixedPackageSelectionError(\n `Layer \"${layer}\" cannot select fixed Po host package \"${selectedPackage}\" as a feature extension.`,\n );\n }\n}\n\nfunction resolveLocalExtensionEntries(\n resolvers: ExtensionLayerResolvers,\n specifier: string,\n baseDirectory: string,\n): string[] | undefined {\n const resolved = resolvers.localEntries?.(specifier, baseDirectory);\n if (resolved !== undefined) return resolved;\n const single = resolvers.localEntry(specifier, baseDirectory);\n return single ? [single] : undefined;\n}\n\nfunction resolveLocalPackageSelections(\n resolvers: ExtensionLayerResolvers,\n specifier: string,\n baseDirectory: string,\n): string[] | undefined {\n const resolved = resolvers.localPackageEntries?.(specifier, baseDirectory);\n if (resolved !== undefined) return resolved;\n return resolveLocalExtensionEntries(resolvers, specifier, baseDirectory);\n}\n\ninterface SelectionIdentity {\n layer: string;\n layerIndex: number;\n entryKind: SelectedEntryKind;\n entryIndex: number;\n selector: string;\n sourceFile?: string;\n baseDirectory: string;\n optional: boolean;\n config?: Record<string, unknown>;\n}\n\nfunction resolvedSelection(\n identity: SelectionIdentity,\n manifestIndex: number,\n resolvedPath: string,\n): ResolvedExtensionSelection {\n return {\n ...identity,\n manifestIndex,\n outcome: 'resolved',\n path: resolvedPath,\n canonicalPath: canonicalModulePath(resolvedPath),\n };\n}\n\nfunction missingOptionalSelection(\n identity: SelectionIdentity,\n diagnostic: string,\n retired = false,\n): ResolvedExtensionSelection {\n return {\n ...identity,\n manifestIndex: 0,\n outcome: 'missing-optional',\n diagnostic,\n ...(retired ? { retired: true as const } : {}),\n };\n}\n\n/**\n * The selectors a tolerant composition left out because they do not resolve yet: the missing\n * selections of entries that are not optional, each once, in composition order. Retired entries\n * never resolve, so they are not counted.\n */\nexport function unsyncedSelectors(compositions: readonly ExtensionComposition[]): string[] {\n return [\n ...new Set(\n compositions.flatMap((composition) =>\n composition.selections\n .filter((selection) => selection.outcome === 'missing-optional' && !selection.optional && !selection.retired)\n .map((selection) => selection.selector),\n ),\n ),\n ];\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction resolveDefinitionSelections(\n definition: PresetsConfig['layers'][string],\n layer: string,\n layerIndex: number,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced = false,\n): ResolvedExtensionSelection[] {\n const resolvedSelections: ResolvedExtensionSelection[] = [];\n const extensionEntries = definition.extensions ?? [];\n for (const [entryIndex, selector] of extensionEntries.entries()) {\n const identity: SelectionIdentity = {\n layer,\n layerIndex,\n entryKind: 'extension',\n entryIndex,\n selector,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n optional: false,\n };\n if (!isLocalPackageSpecifier(selector)) {\n resolvedSelections.push(resolvedSelection(identity, 0, resolvers.ownEntry(selector)));\n continue;\n }\n const resolved = resolveLocalExtensionEntries(resolvers, selector, definition.baseDirectory);\n if (!resolved?.length) {\n throw new Error(\n `Layer \"${layer}\" extension \"${selector}\" does not resolve under ${definition.baseDirectory}. ` +\n 'Point it at a Pi extension file or directory.',\n );\n }\n resolved.forEach((resolvedPath, manifestIndex) => {\n resolvedSelections.push(resolvedSelection(identity, manifestIndex, resolvedPath));\n });\n }\n\n const packageOffset = extensionEntries.length;\n for (const [packageIndex, configured] of (definition.packages ?? []).entries()) {\n const selector = typeof configured === 'string' ? configured : configured.name;\n const optional = typeof configured === 'string' ? false : configured.optional === true;\n const configValue = typeof configured === 'string' ? undefined : configured.config;\n const identity: SelectionIdentity = {\n layer,\n layerIndex,\n entryKind: 'package',\n entryIndex: packageOffset + packageIndex,\n selector,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n optional,\n ...(configValue === undefined ? {} : { config: configValue }),\n };\n\n let resolved: string[] | undefined;\n try {\n const local = isLocalPackageSpecifier(selector);\n const manifestName = local ? resolvers.localPackageName?.(selector, definition.baseDirectory) : undefined;\n const selectedPackage = local ? manifestName && packageName(manifestName) : packageName(selector);\n if (selectedPackage && RETIRED_FEATURE_PACKAGES.has(selectedPackage)) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `${selectedPackage} is built into Po now; remove it from ${definition.filePath ?? `layer \"${layer}\"`}.`,\n true,\n ),\n );\n continue;\n }\n if (local) {\n if (manifestName) assertFeaturePackage(manifestName, layer);\n resolved = resolveLocalPackageSelections(resolvers, selector, definition.baseDirectory);\n } else {\n assertFeaturePackage(selector, layer);\n if (optional) {\n resolved = resolvers.optionalPackageEntries?.(selector);\n if (resolved === undefined && !resolvers.optionalPackageEntries) {\n const single = resolvers.optionalPackageEntry(selector);\n resolved = single ? [single] : undefined;\n }\n } else {\n resolved = resolvers.packageEntries?.(selector) ?? [resolvers.packageEntry(selector)];\n }\n }\n } catch (error) {\n if (optional || (tolerateUnsynced && !(error instanceof FixedPackageSelectionError))) {\n resolvedSelections.push(missingOptionalSelection(identity, errorMessage(error)));\n continue;\n }\n throw error;\n }\n\n if (!resolved?.length && tolerateUnsynced && !optional) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `Package \"${selector}\" is not synced yet: it resolves to no Po server, web or MCP contribution.`,\n ),\n );\n continue;\n }\n if (!resolved?.length) {\n if (optional) {\n resolvedSelections.push(\n missingOptionalSelection(\n identity,\n `Optional package \"${selector}\" is unavailable or declares no Po server, web or MCP contribution.`,\n ),\n );\n continue;\n }\n if (isLocalPackageSpecifier(selector)) {\n throw new Error(\n `Layer \"${layer}\" package \"${selector}\" does not resolve under ${definition.baseDirectory}. ` +\n 'Point it at an extension file, or a package directory whose package.json declares a Po contribution.',\n );\n }\n throw new Error(`Layer \"${layer}\" package \"${selector}\" declares no Po server, web or MCP contribution.`);\n }\n\n resolved.forEach((resolvedPath, manifestIndex) => {\n resolvedSelections.push(resolvedSelection(identity, manifestIndex, resolvedPath));\n });\n }\n\n return resolvedSelections;\n}\n\nfunction resolveLayerSelections(\n config: PresetsConfig,\n layer: string,\n layerIndex: number,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced: boolean,\n): ResolvedExtensionSelection[] {\n const definition = config.layers[layer];\n if (!definition) throw new Error(`Unknown layer: ${layer}`);\n return resolveDefinitionSelections(definition, layer, layerIndex, resolvers, tolerateUnsynced);\n}\n\nfunction resolveDefaultSelections(\n config: PresetsConfig,\n resolvers: ExtensionLayerResolvers,\n tolerateUnsynced: boolean,\n): ResolvedExtensionSelection[] {\n if (!config.default) return [];\n return resolveDefinitionSelections(\n config.default,\n DEFAULT_SELECTION_LAYER,\n DEFAULT_SELECTION_LAYER_INDEX,\n resolvers,\n tolerateUnsynced,\n );\n}\n\nfunction resolveSelectedExtensions(context: ExtensionContext): ResolvedExtensionSelection[] {\n const resolvers = context.resolvers ?? LAYER_RESOLVERS;\n return context.layers.flatMap((layer, layerIndex) =>\n resolveLayerSelections(context.presetsConfig, layer, layerIndex, resolvers, context.tolerateUnsynced === true),\n );\n}\n\nfunction deduplicatePaths(paths: readonly string[]): string[] {\n const seen = new Set<string>();\n const selected: string[] = [];\n for (const entry of paths) {\n const identity = canonicalModulePath(entry);\n if (seen.has(identity)) continue;\n seen.add(identity);\n selected.push(entry);\n }\n return selected;\n}\n\nfunction selectedFeaturePaths(selections: readonly ResolvedExtensionSelection[]): string[] {\n return deduplicatePaths(\n selections.flatMap((entry) => (entry.outcome === 'resolved' && entry.path ? [entry.path] : [])),\n );\n}\n\n/** Package anchors in the order the previous host activated them, so discovery order holds. */\nfunction selectedPackageEntries(\n resolve: ExtensionLayerResolvers,\n distributionPaths: readonly string[],\n featurePaths: readonly string[],\n): string[] {\n return deduplicatePaths([\n resolve.ownEntry(PO_SERVER_ENTRY),\n ...CORE_PACKAGE_ENTRIES.map((entry) => resolve.packageEntry(entry)),\n ...distributionPaths,\n ...featurePaths,\n resolve.packageEntry(CACHE_PACKAGE_ENTRY),\n resolve.packageEntry(SESSION_PACKAGE_ENTRY),\n ]);\n}\n\nfunction canonicalValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(canonicalValue);\n if (value === null || typeof value !== 'object') return value;\n return Object.fromEntries(\n Object.entries(value as Record<string, unknown>)\n .filter(([, entry]) => entry !== undefined)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, canonicalValue(entry)]),\n );\n}\n\n/** Resolve one deterministic composition from authored layer occurrences. */\nexport function resolveExtensionComposition(context: ExtensionContext): ExtensionComposition {\n const resolvers = context.resolvers ?? LAYER_RESOLVERS;\n const defaultSelections = resolveDefaultSelections(\n context.presetsConfig,\n resolvers,\n context.tolerateUnsynced === true,\n );\n const layerSelections = resolveSelectedExtensions(context);\n const selections = [...defaultSelections, ...layerSelections];\n const distributionPaths = selectedFeaturePaths(defaultSelections);\n const featurePaths = selectedFeaturePaths(layerSelections);\n const layers = context.layers.map((name, index): CompositionLayerOccurrence => {\n const definition = context.presetsConfig.layers[name];\n if (!definition) throw new Error(`Unknown layer: ${name}`);\n return {\n name,\n index,\n ...(definition.filePath ? { sourceFile: definition.filePath } : {}),\n baseDirectory: definition.baseDirectory,\n };\n });\n const modeSource = context.preset ? context.presetsConfig.presetSources?.[context.preset] : undefined;\n const composition = {\n ...(context.preset\n ? {\n preset: {\n name: context.preset,\n ...(modeSource?.filePath ? { sourceFile: modeSource.filePath } : {}),\n ...(modeSource?.baseDirectory ? { baseDirectory: modeSource.baseDirectory } : {}),\n },\n }\n : {}),\n layers,\n selections,\n packageEntries: selectedPackageEntries(resolvers, distributionPaths, featurePaths),\n };\n // Keys the prompt-cache namespace, so a different selection never shares cached prefixes.\n return {\n ...composition,\n fingerprint: sha256(\n JSON.stringify(\n canonicalValue({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M,aAAa,QAAQ,SAAS,QAAQ,cAAc,gBAAgB,QAAQ,UAAU,KAAA;CAC5F,MAAM,cAAc;EAClB,GAAI,QAAQ,SACR,EACE,QAAQ;GACN,MAAM,QAAQ;GACd,GAAI,YAAY,WAAW,EAAE,YAAY,WAAW,SAAS,IAAI,CAAC;GAClE,GAAI,YAAY,gBAAgB,EAAE,eAAe,WAAW,cAAc,IAAI,CAAC;EACjF,EACF,IACA,CAAC;EACL;EACA;EACA,gBAAgB,uBAAuB,WAAW,mBAAmB,YAAY;CACnF;CAEA,OAAO;EACL,GAAG;EACH,cAAA,GAAaE,mCAAAA,OAAAA,CACX,KAAK,UACH,eAAe;GAAE,GAAG;GAAa,kBAAkB,YAAY,eAAe,IAAIF,mCAAAA,mBAAmB;EAAE,CAAC,CAC1G,CACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/builders/cli/extensionAssembler/index.ts"],"mappings":";;iBA0BiB,gCAAgC;;EAE/C,uBAAuB,mBAAmB;;EAE1C,oBAAoB,mBAAmB;;iBAGxB;;EAEf;;EAEA;EACA,eAAe;;EAEf,YAAY;;;;;;;EAOZ;;YAGU;KACP;;;;;;;;UASK;WACC;WACA;WACA,WAAW;WACX;WACA;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;;WAEA;WACA,SAAS;;iBAGH;WACN;WACA;WACA;WACA;;;iBAIM;WACN;aACE;aACA;aACA;;WAEF,iBAAiB;WACjB,qBAAqB;;WAErB;;WAEA;;;qBAgBE,qBAAkB;qBA+ElB,iBAAiB;;;;;;wBAyBd,qBACd,uBACA,cAAa,OAAO,aACnB;;;;;;wBAsHa,kBAAkB,uBAAuB;;wBA+NzC,4BAA4B,SAAS,mBAAmB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/builders/cli/extensionAssembler/index.ts"],"mappings":";;iBA0BiB,gCAAgC;;EAE/C,uBAAuB,mBAAmB;;EAE1C,oBAAoB,mBAAmB;;iBAGxB;;EAEf;;EAEA;EACA,eAAe;;EAEf,YAAY;;;;;;;EAOZ;;YAGU;KACP;;;;;;;;UASK;WACC;WACA;WACA,WAAW;WACX;WACA;WACA;WACA;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;;WAEA;WACA,SAAS;;iBAGH;WACN;WACA;WACA;WACA;;;iBAIM;WACN;aACE;aACA;aACA;;WAEF,iBAAiB;WACjB,qBAAqB;;WAErB;;WAEA;;;qBAgBE,qBAAkB;qBAgFlB,iBAAiB;;;;;;wBAyBd,qBACd,uBACA,cAAa,OAAO,aACnB;;;;;;wBAsHa,kBAAkB,uBAAuB;;wBA+NzC,4BAA4B,SAAS,mBAAmB"}
@@ -1,7 +1,7 @@
1
1
  import { ownEntry } from "../../../src/builders/cli/entryResolution.mjs";
2
2
  import path from "node:path";
3
- import fs from "node:fs";
4
3
  import { fileURLToPath } from "node:url";
4
+ import fs from "node:fs";
5
5
  import { isLocalPackageSpecifier } from "@agimon-ai/po-config/presets";
6
6
  import { checkoutPackageEntry, consumerPackageEntry, localEntries, localEntry, localPackageEntries, localPackageExport, localPackageName, optionalPackageEntry, packageEntry, splitPackageSpecifier } from "@agimon-ai/po-core/moduleResolution";
7
7
  import { canonicalModulePath, sha256 } from "@agimon-ai/po-core/runtimeIdentity";
@@ -23,6 +23,7 @@ const CORE_PACKAGE_ENTRIES = [
23
23
  "@agimon-ai/po-mode/extensions/server",
24
24
  "@agimon-ai/po-config/extensions/server",
25
25
  "@agimon-ai/po-db/extensions/server",
26
+ "@agimon-ai/po-lang/extensions/server",
26
27
  "@agimon-ai/po-vault/extensions/server",
27
28
  "@agimon-ai/po-ui/extensions/server",
28
29
  "@agimon-ai/po-notification/extensions/server",